Best options for fastest latency real-time pitch shifting in MSP?

Rob Marshallsay's icon

Rob Marshallsay

7月 12 2024 | 4:55 午後

I want to make a stereo delay that includes a pitch shifter before the feedback line, something akin to the classic Eventide 'Crystals' sound that their Ultra-Harmonizers are famous for.

I'm doing this mostly just to get some practice with MSP, I have a H8000FW sat directly to my left, so this is more just for fun :)

The problem I'm facing is that I cannot find a way of implementing real-time pitch shifting that has acceptable latency. The pitchshift~ object sounds okay, but has severe latency. gizmo~ similarly introduces a lot of latency.

I've experimented a bit with abusing the doppler effect by using a phasor~ to modulate a tapout~'s delay time, but of course this introduces a fair bit of latency too, as expected!

Are there any other DSP tricks for real-time pitch sifting? Quality isn't a big concern, just something that has latency good enough to be used with short delay times.

sousastep's icon

sousastep

7月 12 2024 | 9:28 午後

download the RNBO Guitar Pedals package and check out its PitchShifter

The H9000 supports RNBO and gen~ BTW. Would be cool if Eventide worked out a deal with Cycling to port some VSig3 modules to Max 👀

Jean-Francois Charles's icon

Jean-Francois Charles

7月 12 2024 | 9:32 午後

Indeed, the crystal Eventide algorithm(s) are time-based; they read the delay lines at various speeds to get the pitch shifting.

Roman Thilenius's icon

Roman Thilenius

7月 12 2024 | 9:59 午後

not sure why you would need RNBO or gen~ to do that, but i´d also choose ganular/tappingbuffer based pitching for this kind of application.

the otherwise not so useful oscillating artefacts of such an algo - or the difficulty to modulate the pitch in realtime - is no longer a problem when used inside a feedback loop.

but please upsample 4 times!

Rob Marshallsay's icon

Rob Marshallsay

7月 15 2024 | 12:36 午後

Thanks for the replies, everyone! I'm did a little more experimenting and am getting some reasonable results expanding on the delay line method, introducing time offsets to compensate for 'latency' (although I guess in this instance it's more like the delay just doing it's job!) and phase offsets to compensate for clicks caused by the phasor~ reaching the peak of it's ramp. Once it gets to a point I would deem usable I will upload the patcher here to help anyone else stumbling on this thread.


Roman, could you please expand on what you mean by using a granular/tappingbuffer and using a feeback loop for pitch shifting? I would very much appreciate it :)

And sousastep, yes I saw that too!! I really want a 9000 now...who needs two kidneys, anyway?

Thanks again, guys.

Mitch Triplett's icon

Mitch Triplett

7月 15 2024 | 1:05 午後

"...Roman, could you please expand on what you mean by using a granular/tappingbuffer and using a feeback loop for pitch shifting? I would very much appreciate it :)..."

I would also appreciate it if you could expand on this. Thanks!!

Roman Thilenius's icon

Roman Thilenius

7月 15 2024 | 1:21 午後

it is almost the same technique as the most (searchterm:) variable delay lines uses:
you write into tapin~ in realtime (i.e. with a speed of 1x), and then read it out with different speeds to obtain a pitch shift.

https://cycling74.com/forums/can-anyone-explain-the-basics-of-vdb

because of the normative force of the factual, you have to use a windowing system to continuously alternate between 2 or 3 of such buffers.

the requested property of having a very low latency is not met with this (unless you run the windowing oscillation at higher frequencies, which can cause nasty artefacts) for pitch-up, but this is true for most pitch shifting methods. for pitch-down it is less a problem.


and as you all can imagine, any bit of latency can have dramatic effects when applied inside a feedback loop, where it accumulates up.