2015-04-05

Instead of adding more vowels, which I know I'll have to do soon, I decided to play around with vibrato. The voice, as it was, sounded very flat and I figured that some natural vibrato would improve it a little. I had no idea how to go about doing it initially, but discovered that you can apparently add vibrato to a synthetic signal such as a sawtooth by simply multiplying (which is to say modulating) its pitch by another waveform known as an LFO. LFO stands for low frequency oscillator, and in this case means a waveform who's pitch is only around a few HZ. I already had a sawtooth class, so I used that. Apparently you can use a cheaper oscillator to make an LFO - you don't need antialiasing as it seems, but I'm too lazy to rip another one out of Tonic.

I generated the LFO easily enough. However, my first attempt at modulating the signal sounded... Interesting.

Listen

I had made several mistakes. I had apparently forgotten to take the absolute values of the LFO, and during the pitch bend I was somehow multiplying the next to last sample by the current one each time which made the frequency low enough to be entirely inaudible. I blame it on the lateness of the hour. Eventually, I got it working:

Listen

When I say working, I mean that it actually does the correct thing mathematically. The output still sounds ridiculous, in fact it is quite close to the last one. But there are some important differences. The pitch bend is done correctly, and the vibrato is actually being applied as it should. However, it is being applied with full force so to speak. I realized that what was needed here was a way to control the amount of vibrato, preferably as some sort of percentage.

The way in which this works is pretty straightforward. If the modulator signal is 0.5 and the voice oscillator is 0.2, for instance, the signal with full vibrato applied is 0.2*0.5=0.1. So in this case, the vibrato should go between 0.2 (the original sample) and 0.1 (the modulated sample) depending on the percentage. However, I actually got stuck on this for quite some time which is probably an indication that I really need to brush up on my math. I ended up implementing a sort of convoluted function to calculate it, which I'll definitely revisit later if I actually end up doing something serious with the code.

Here is an example of the vibrato set to 50% and the modulation frequency (which is to say the speed of the vibrato) set to 5.5 HZ:

Listen

We're getting closer, but the voice still sounds ridiculous. Let's try the same modulation frequency but with a significantly lower vibrato amount (3%):

Listen

There we go, that sounds pretty reasonable - at least if the synthesizer is meant to be singing.

By this time it was getting late again and I was losing focus. Instead of looking at vowels I started playing around with head size. I wanted to see if I could make the voice sound huge or tiny by multiplying the formants by some factor. Turns out that this is quite easy, but you have to be careful with the setting. Values below 1.0 make the head larger, 1.0 is unchanged and anything above 1.0 makes it smaller. Here's an example where it is set to 0.8:

Listen

We've got a giant! Now, let's make it 1.2 to see if we get a gremlin:

Listen

Most entertaining. At this point, I set the value back to 1.0 and went to sleep.