Creating a pitch shift from scratch?
Hello there, I was checking out Ben Richard’s great tutorial and patchstorage creations. I was playing around with glacial time stretch patch he made. Obviously this is meant to run w flexi samples as an input since real time time stretch isn’t particularly viable (maybe in a delay pedal situation) but it got me wondering if there was a way to take grains with a graphic shaper and apply a custom pitch shift. Maybe something that allows for formant shifting (male->female) as well to help with chipmunking. Mostly just curious to make one as an experimental project. Any ideas? Maybe @bcrichards has some advice on this as well?
The first issue is getting the grain samples from live input to play with I’m assuming that’s a buffer rescan module, which is technically is already a pitch shifter, but I’d like more control of the grains and processing
thanks!
Comments
I’ve tried my hand at creating a workable pitch shifting patch to work with live audio, and I haven’t gotten great results so I’d be curious to see what techniques everyone else has used!
the glacial patch can pitch shift the sample, independent of the sample playback speed. I agree, live pitch shift is more fun.
This is the closest I got. It uses a saw wave to modulate a delay module which results in a constant pitch increase or decrease, and employs unison, windowing, and voice offset to remove the artifacts from when the saw wave resets. It doesn’t sound good but it might give you some ideas.
Thanks!. I’m gonna mess around with it.
What about using Drambos built in pitch shift module?
And if this is about building a low latency pitch shifter yourself, then I would experiment with heterodyne pitch shifting. It is widely used in radio circuits and was used in old voice scrambling systems:
The principle is that the input signal “I” is mixed with usually a sine wave of a fixed frequency “F”. The mixing is usually done with a ring modulator. The output of the mixer now contains a two sideband signal consisting of F+I and F-I. This output is then filtered with a high Q (sharp edge) band pass filter to get rid of the unwanted sideband. The funny thing is that the lower sideband is pitch inverted - this was used for voice scrambling.
To avoid frequency mirroring the input signal is often put through a low pass filter to prevent the pitch shifting going through the ceiling (the maximum frequency of the circuit).
@catherder thanks this is fascinating. I went down a rabbit hole for an hour today learning about demodulation. Wouldn’t this be a frequency shift not a pitch shift tho? It wouldn’t preserve harmonic relationships I don’t think since it’s a linear, uniform transformation. Oh and yea the pitch shifter in Drambo is pretty good actually but I’m just interested in making something from scratch as a project and for educational purposes.
As far as building this in Drambo how do you get the lower sideband isolated after a multiply module for audio in*sine osc? Does the carrier signal need to be routed into a layers mixer ?
I completely overlooked that this was about pitch shifters and not frequency shifting.
I would use the Analog Filter module for the filtering. For a band pass you can put a LP24TR (Transistor) or LP24OTA (OpAmp) ladder filter in series with a HP12 high pass. But your post made me doing some more research and I came across this article that has a block diagram of the classic Bode Frequency Shifter. They avoid the filtering by using quadrature oscillators that output two 90 degree out of phase signals:
In Drambo we have the Sinus and Cosinus functions that can help to create a quadrature oscillator.
@sinelanguge Yes, that's the point. Frequency shifting is much easier to build than high quality pitch shifting with formant correction.
That's not to say that Frequency shifting wouldn't be a great playground - Moog has built a dedicated stompbox just for that effect (The Moogerfooger MF102S).
Hard to tweak it into musical results though - gotta find those sweet spots :)
If you need steep filtering, just chain multiple Filter modules and modulate their cutoff knobs with one knob, slider or morph knob.
Got some wild sounds out of that. Also I didn’t know what a quadratic sine was until today. Thanks for the education! Yea I got pretty pleasantly sidetracked but am still trying to make a custom pitch shifter. Been messing around with Ben Richard’s technique using a saw LFO to modulate a delay into small chunks that are either being slowed or sped up. The issue is mostly that the chunks sound p clicky and have to be blended which requires a unison and things get pretty smeary pretty fast, and doesn’t quite fix the attack/decay clicking.
I feel like it’s probably possible but haven’t found a solid sounding solution yet.
also on topic but slightly different question how do those formant correction/voice gender bending systems work? A series of band passes at specific frequencies?
Yes, basically, peaks tuned to typical vocal formants.
The interesting part is that you'll want to detect the formants in your original signal and apply the spectral formant shape on the effected signal. You could have many filters with envelope followers on the original signal which apply filter amplitudes to the same set of filters duplicated to process the output signal.
Kind of a noise-less vocoder with the input signal analyzed and the shifted signal used as a carrier.
Sounds a bit beyond my current level but what modules would that even use
Look at the vocoder project i did 4 years ago. My gosh, 4 years already! 😂
Wow that vocoder patch is fun af to play around with. Amazing
these ring modulators are actually more used for panorama/tremolo modulation with slow mod speed, I guess ...
because A x B usually results in a lot of unmusical chaos that doesn't go along with the chromatic scale ...
so to dance around this you need to modulate "B" with cv sequencer too according to whatever input note "A" is ... so the the relation stays the same ...
if "b" doesn't "follow" pitch of "a" it results in the "hm, unsure if I have a use case for this sound thing"
you need to sequence "b" too ;)
So this is complex. Had a couple of thoughts. Is there a way to align zero crossings maybe using the declicker? Also is there a way to use an envelope follower to detect transients and turn down down the volume on a millisecond level whe there needs to be a punchy attack?
obviously making a good sounding pitch shifter isn’t probably going to compete with the built in one but I do wish it had more options to mess w it
@giku im sorry. I know you just moved (congrats btw!) and are busy with new updates (this is a low priority question) but do you think it’s possible to use small grains multiplied on eachother with the unison and graphic modulator/delay to make a decent sounding pitch shifter in Drambo or are we wasting our time? Just a wacky idea I had
This is @bcrichards crack at it Obviously there’s already a pitch shifter but I thought it would be fun to play with inner workings of the effect if it was made from scratch I know it’s dumb but I really like would love to build one in Drambo if you have any advice
Building something from scratch in Drambo is not dumb. Actually that’s the beauty of it. I would help you but we already have pitch shift, and freq scan, and freq shift, I’m good. But by all means, have a go at it. There’s some stuff on patchstorage as you found out. Ben was the pioneer if I remember correctly
@sinelanguge Using delays is definitely a good start.
There are 1000 ways to make it sound smoother, from crossfading between different delays (or "grains", if you will) to transient-aware processing.
After doing my own experiments, I can recommend to sketch the waveform processing ideas out (on paper) first, because such patches can become complicated quickly ;)
@rs2000 forgot your delay trick, that was a thing of beauty, but only accessible to wizards like you 😅
I hope not 😇