2017-07-18 17:08:01 (edited by Green Gables Fan 2017-07-18 17:28:55)

Hello, all.
I recently asked a questiona bout how Philip Benfal created the sounds for the Alpha Urchin in Self Destruct. Someone had suggested that they could have used Pitch-shifting. However, I can't find anything on the web about how you can take one single voice and raise or lower the pitch, while at the same time giving it unusual number of odd or even harmonics in the process. Could someone explain more about how this process works?
In Audacity, I have something called Ladspa Plugins, which has something called AM Pitch shift. It has the pitch shift, and buffer size. I have a theory that the higher you go, the faster the beatings you will get. I don't know where the beatings come from, unless it is generating some kind of tone  that makes it give you the odd harmonics.
Any further information on this would be great.
Thanks!

Ulysses, KJ7ERC
She/they
Reedsy

2017-07-19 17:11:06

It's been so long since I even touched Self Destruct, so I don't know what that character sounds like.

However, I can say this much. There are definitely ways to mess with the harmonics of a sound, as you put it. You can use what is called frequency shifting. I don't know exactly how it works, and there are probably a myriad of ways to implement it. In any case, frequency shifting will shift the frequencies by an absolute amount, either by adding or subtracting a certain amount from each partial. and in doing so, will modify and subsequently distort the relationships between harmonics. For example, let's say you have partials at 100, 200, 300, 400 hz, etc. and you frequency shift by 40 hz. Now your partials are at 140, 240, 340, 440, etc. And they are no longer harmonically related. This will produce a discordant sound. You can also frequency shift by a negative amount, so if you frequency shift down by 40 HZ, you'll get partials at 60, 160, 260, 360, etc. Because the harmonics are no longer related and produce a strange sound, you could use frequency shifting on a voice to give it a strange character, and if you frequency shift by small amounts, the speech can still be easily understood.

You can also achieve a similar effect by very rapid amplitude or frequency modulation, which is basically applying a very fast tremolo or vibrato to the sound, at a rate of several hundred times a second, and often even faster. You'll often hear these processes referred to as ring modulators.

Finally, we get to pitch shifting. The goal of a pitch shifter is to multiply or divide the frequencies by some amount, instead of simply adding or subtracting as is the case with frequency shifting. If you think of pitch shifting as a multiplication/division problem, it starts to make sense. For example, if you have partials at 100, 200, 300, 400, etc. And you pitch shift 1.5x higher, that is to say you multiply the partials by 1.5, then your partials will be at 150, 300, 450, 600, etc. The relative harmonic relationships are untouched, and thus the sound is just higher pitched. The timbre and character of the sound is adversely affected, but that's a different story though. What's important here is that the harmonic relationships are maintained, so at least you can hear the intended notes, even if their timbre is odd.

As you might imagine, this world is imperfect and complicated. Doing math to all partials is a very tall order. Thus, it is not so simple to shift the partials and overtones in a transparent way, and there are bound to be artifacts. A good algorithm can produce very good results within certain constraints of course, but a poorly optimized one might produce severe problems. I remember that plug-in you mentioned being buggy. If I remember correctly, it just takes very short fragments of a sound, speeds them up in the conventional analog way, and tries to splice them back together in such a way as to restore the sound back to the original tempo. For example, if you pitch shift 1 octave up, it simply takes a small buffer, and speeds it up in the analog sense so that it's twice as high and twice as fast. Then to restore the original duration, it simply repeats that small buffer twice before moving onto the next buffer and doing the same. This is a crude and simplistic explanation of how any pitch shifting algorithm works, but it'll do for now. Not to mention, such simplistic algorithms can be used for interesting sound design purposes!

Unfortunately such a simplistic algorithm isn't very practical, because harmonic distortions will easily be noticed. Here's just one example of how. Let's go back to that example of partials at 100, 200, 300, 400, etc. Let's say you have a very small buffer, i.e. a very small window of audio to be processed at one time. For sake of simple example, we'll say we have a buffer of 1/1000 of a second. If we were to let the buffers execute for a while, we'd find that the buffers change out at 1000 hz. But our lowest partial is at 100 HZ, so it would take 10 buffers to accomodate for that. The problem is that in order to work well, these algorithms have to have at least one complete cycle of a wave in a buffer. Spreading the cycle out over 10 buffers will result in distortion, as the wave will be broken apart too finely and parts of it will be spliced together that shouldn't be. The sound of the distortion will also change as you change the amount of pitch shift, since the pitch shift amount will also dictate how the algorithm splices the buffers together to keep the tempo unchanged.

The simplest and most effective sollution is to use a larger buffer. Using a buffer of 1/100 of a second to account for the 100 hz partial would probably work very well. However this is a special case, and it wouldn't be very practical for voice since the pitch of a voice is always moving, and using a constant buffer on a moving pitch introduces distortion too. So two more optimizations would be needed to reduce the distortion on actual material: First, use some kind of detection algorithm that will lock the buffers to actual cycles of the waveform and change the buffer size accordingly, so that the distortion is kept to a minimum. And second, overlap the areas where the buffers execute to make smoother transitions between them. If you don't, you're very likely to get clicks, glitches, or at the very least a graney quality since you can hear the transitions between the buffers. To my knowledge, any half decent time stretching or pitch shifting algorithm, especially those for solo voice or instrument, have to account for all three of these optimizations to sound as good as they do.

Of course, this is probably way over your head. And since programming and high level maths are above my head too, I'm about as much in the dark as you probably are, at least when considering implementation. But, it's something that fascinates me, and so I thought I'd pass it along, since it might help explain what's going on better.

Make more of less, that way you won't make less of more!
If you like what you're reading, please give a thumbs-up.

2017-07-19 18:21:58

Hi!
Thanks for your explanation. I am familiar with overtone harmonics, beatings, and resultants from a more acoustical point of view. DTMF uses third or fourth tones to give each two tones its unique characteristics. If our fundamental frequency is 100 HZ, and we play 200 and 300 Hz which gives us a perfect fifth, we can subtract 200 from 300 and get 100. Likewise, if we play 500 and 600, which gives us a major third, we subtract 500 from 600 and get 100, and they all have that underlying tone.

so could you do frequency shifting with pure tones in Audacity, or pitch shifting by multiplying or dividing?
What is the difference between partials and fumdamentals? The only thing I know about fumdamentals is that F0 is the primary and lowest frequency in a given harmonic series. However, when you start to mix acoustics into electronics, that's where some of the rules in  physics change.

Ulysses, KJ7ERC
She/they
Reedsy

2017-07-19 19:07:58

Yes, you could mimic frequency or pitch shifting in Audacity by doing the math manually on each partial that you want. Problem is, doing that to an acoustic sound isn't easy.

From what I understand, the fundamental is the frequency from which other all other overtones are derived, and the harmonics are the multiples of that fundamental. But people have so many different names and ways of referring to partials, harmonics, fundamental, overtones, etc. I don't really know what's standard, nor how that relates to physics.

Make more of less, that way you won't make less of more!
If you like what you're reading, please give a thumbs-up.

2017-07-19 20:03:34

So how would I do this in Audacity using pure tones? would I simply create multiple tracks, generate four or five tracks with each pure tone harmonic to see how it would sound?

Ulysses, KJ7ERC
She/they
Reedsy

2017-07-20 04:27:09

You could, yes, but that wouldn't be very useful for other than experimentation purposes.

Make more of less, that way you won't make less of more!
If you like what you're reading, please give a thumbs-up.

2017-07-20 06:09:06

Well, I did that, and noticed that the adding or subtracting of frequencies from the fundamentals by 40 produced odd harmonics, while multiplying the frequencies 150, 300, 450, etc. produced a perfect series of overtones in a different key.

Ulysses, KJ7ERC
She/they
Reedsy