• ### Modifying pitch shifter to input Hz explicitly

Does anyone have any ideas about how I can modify the pitch shifter to accept Hz? Meaning usually you would give it the amount of semitones you want to transpose, but I want to give it the number of Hz to transpose.

I am fairly new to PD and i don't fully understand how the pitchshifter works but I do have a fairly good grasp of the tape machine it's based on being an analogue person... so be gentle, but not that gentle

• Posts 9 | Views 3922
• the pitchshifter~ object, I mean...

• Hi vixo,
you can convert MIDI to frequency with [mtof] and frequency to midi with [ftom] object.

• Hi, thanks for your reply. I am aware of these objects, however that's not really what I'm getting at...

The pitchshifter works by reading a sections of an array at higher or lower speed than the normal sample rate. So to double the frequency (an octave) you can read the array at twice the speed. A semitone shift can easily be calculated from this as there are twelve semitones in an octave, but the actual amount of Hz in an octave isn't constant. So how might I modify the object to accept the number of Hz to shift, rather than the number of semitones to shift?

• where I can find [pitchshifter~] object? It seems it's not included in pd-extended.

• ahh yeah I forgot it isn't included - attached is pitchshifter~.pd which is an object version of the G09.pitchshift.pd audio example

http://www.pdpatchrepo.info/hurleur/pitchshifter~.pd

• I think you need to use the 12th root of 2 = 1.05946309436 and raise this to the relevant power for semitones up and negative power of semitones down in relation to a frequecny reference eg 440hz. Pitch semitone freqency = FreqRef * 12th root of 2 to power of semitone

• A pitch shifter scales the input frequency, so you have to know what the input frequency is to know what the output frequency will be. You could also use a frequency shifter (there's a single sideband modulator in another one of the example patches), which will shift a signal in Hz, but it doesn't preserve the harmonic series of your input signal...

• thanks for your replies. I can see now that you do indeed need to know what frequency is going in. I do however want to preserve the harmonic content so the SSB modulator wouldn't be suitable but I'll definitely play around with it - I made a hardware one a few years back and it would be interesting to compare

Posts 9 | Views 3922
Internal error.

Oops! Looks like something went wrong!