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).

  • edited March 2024

    @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.

  • edited March 2024

    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

  • Wow that vocoder patch is fun af to play around with. Amazing

  • edited June 2024

    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 ;)

  • edited December 2024

    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

  • edited December 2024

    @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

  • edited December 2024

    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

  • edited December 2024

    @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 😅

  • edited April 11

    So originally I was toying with @bcrichards method he posted above. I thought shifting the LFO “grain size” phase yielded odd results so I tried shifting the grain envelopes “fade in/out” instead

    but it really didn’t seem to sound any different that just a very basic LFO-> modifying delay when I did that. Not sure what the move is with this style approach


    Second method I tried is make a dual pitch shifting patch that x fades between the saw LFOs while they reset so you don’t get the ugly crackling/popping noise you usually do from the delayed grains That part worked wonderfully

    The big issue here is you get a bit of tremolo which I’m not sure if anyone has input, maybe using a phase locked amp LFO at the end to correct ?

    also smaller issue even tho all the lfos are tied to the gate signal, they don’t always start together when loading and unsung when changing settings. I had to add a sync trigger, p sure ithere’s a more elegant way to sync start them together


    @rs2000 @bcrichards @Johnisfaster any thoughts?

  • Here’s my somewhat final version minus the tremolo issue (if that’s solvable).

    https://patchstorage.com/silica-diy-time-domain-granular-pitch-shifter/

  • After looking at your patch, I have to say that I've tried something very similar long ago without much success, and trying a few things again now (basically more than 2 modulated delay modules and crossfading between them using an N-to-1 switch), it seems to me like there could be a buffer or processing issue when using multiple delays. I've tested with a Supersaw oscillator.

    This is one way to create a pulse upon load (but I'm sure there are ten other ways 😄)


  • edited April 14

    Sweet. Gonna try that for the inital loading. So the issue is when you change amount of unison voices for some reason the lfo phases don’t line up properly anymore without a reset from a trigger button. I’m confused how to keep the phases stables. Not sure how to make a logic circuit that could tell unison voices value changed and do a gate reset. I originally had a very slow LFO to trigger the gate but technically introduces some artifacts when it slowly triggers

  • edited May 6

    @rs2000 i made a three channel version of this. The three channel is just even more tremolo and the more muddy and isn’t helping. Here the patch that you can shift between 2-3 channels but honestly the two is much clearer. >>Make sure you hit reSync first tho or none of the grains will line up

    also I think there’s gotta be an easier way to use unison instead seperate signal paths and use the voice number to mod the phase but that just seems to cancel out all the high frequency content ideas welcome



  • edited May 6


  • edited May 7

    @bcrichards i know you’re probably busy with projects but I bet you’d have some good insight into this patch. Also the pitch shift is someone decent at this point but it’s just kind of a Tremelo phasing problem now. Might not be perfect since there’s not a way to resynthasize individual grains forward/backward to better fit without phase interference but there probably still a way to make it slightly better ?

Sign In or Register to comment.