Monophonic pitch-shift: real-time, timbre-neutral?

Jul 24, 2010 at 4:25am

Monophonic pitch-shift: real-time, timbre-neutral?

Hi,

I’ve got a piece of kit from Roland called a VG-99 that uses a divided guitar pickup as input (i.e. six separate signals) and lets you detune the guitar in real time without making it sound like it’s not a guitar. It’s a great idea, but the VG-99 is horribly inflexible. Therefore I want to do it myself, in Max (or using 6 copies of some VST, if I must). Does anyone know of an algorithm, or a Max object, or a VST plugin that allows one to detune a guitar string in real time while maintaining a guitar-like timbre? I don’t need big pitch changes — just +/- 3 semitones.

I think I’ve read about the needed technique: one has to somehow separate the (high) formants from the (low) partials, and transpose the latter while keeping the former in the same shape. But I’m not nearly awesome enough to program it myself.

I tried Mattijs Knepper’s granular time stretcher / pitch shifter (http://www.cycling74.com/share.html), but it creates a weird bumpiness when the pitch shifts, even for single-pitched signals. Demo videos of elasticx~, which costs money, seems to exhibit the same problem. There are also FTT-based stretchers, but those seem to make it smear. And yet somehow Roland manage to get it to work with barely any artifacts.

Any ideas?

Many thanks in advance,
Jeff

#51499
Jul 24, 2010 at 11:04pm

I’ve looked through a number of plugins, and they almost all seem to have the artifacts I described. However, the Elastique Pro monophonic algorithm called Soloist does not — it sounds amazing (http://vielklang.zplane.de/). I can either buy that from them, at a cost of $200, or buy Reaper (a DAW) for $60, which includes the Soloist algorithm in the ReaPitch VST plugin. I’m going to do the latter …

#184606
Jul 24, 2010 at 11:42pm

Good choice, Reaper is very quickly becoming an amazing DAW :) It also uses the newer Elastique 2 pro algorithms with formant preserving modes and all those goodies. Also, you can do the Ableton Live/PT Elastic Audio stuff on any audio in the edit window by just splitting and alt+dragging the split, which can often be more useful than the plug-in; it depends on the context.

#184607
Jul 25, 2010 at 1:27am

> Good choice

Thanks! But while I’ll keep an open mind, I don’t yet know that I’ll be using it as a DAW per se — right now I just want it for the plugins it comes with!

> Ableton

Yes, I wish that were an option for me, because I already own it. Unfortunately, my desired application — retuning the six strings on a guitar independently while I play it — requires a real-time solution.

#184608
Jul 25, 2010 at 12:28pm

I’ve recently been playing with a sinusoidal+residual model with the guitar to do real-time tranformations to the spectrum.
It reconstructs the original signal fairly well. In theory you could simply double the frequency of each oscillator and it would sound fine. The attack is left untouched so it’d only transpose the appropriate part of the sound.

I’ll try to post a patch later but its essentially the sigmund~ partial tracking patch with frequency domain subtraction to isolate the attack/noise.

#184609
Jul 25, 2010 at 1:14pm

Oy, that sounds hard. What about changing the frequency by a non-integer factor — say, 3 semitones? Would that work as easily?

I just downloaded and tried playing with sigmund~, and it’s beyond me. If you post that thing I’ll try it out, though.

When you say “it reconstructs the signal fairly well”, what’s the catch? In what way does it sound different from the original — phasey? Bubbly? Something else?

#184610
Jul 25, 2010 at 10:45pm

Here it is but it needs some work particular with eliminating any outliers from sigmund~ and reducing artifacts during the attack. The frequency domain subtraction could probably also made better and the delay between sigmund’s output and the original signal is just a guess.

Its probably not good enough for your application but it certainly could be with some work. Perhaps someone else feels like fixing it up, I don’t have the time unfortunately.

#184611
Jul 27, 2010 at 8:46am

Just to notice, Gabor package (downloadable from ircam and free) also have some nice monophonic pitch-shift possibilities with formant control :
gabor.psola.maxpat
gabor.psolastic.maxpat

#184613
Jul 28, 2010 at 4:42pm

I tried Reaper out, and realized that its pitch-shift plugin has a 150 ms latency. That appears to be inherent in the Elastique algorithm. It sounds fantastic, but it’s not a viable realtime solution. I’m looking now at options from Celemony, Antares and Mu-Technologies. They all cost two or three hundred dollars. The last boasts of a latency of only 5.6 ms; that’s exciting.

Thank you both for the suggestions you posted above. I hope other readers of this thread find them useful. For me, I’m afraid they both look … um … hard. I don’t really understand enough about pith-shifting algorithms to hack them myself. When it comes to the time vs. money tradeoff, I think I’m better off spending my money than my time on this project. (I know that’s disappointing, but it’s true …)

#184614
Jul 28, 2010 at 8:49pm

The classic “harmonizer” approach for transposition is using a delay line, which gets read out faster/slower than written.
You can do this with tapin/tapout by setting the delay with a phasor~.
Due to the nature of this algorithm you will get a “sliding” latency, also depending on the overall delay time.
There’s a patch in examples/effects/transposer-folder

I think the digital whammy guitar pedals also use this technique.
It doesn’t preserve formants, but sounds ok in the range of some semitones.

#184615
Jul 29, 2010 at 2:51am

I just tried demos of a whole bunch of for-pay algorithms, and my tentative conclusion is that every real time pitch-shift algorithm not specifically intended for a guitar, when used on a guitar, either sounds like crap or has an impractically high latency. The only thing I’ve gound that sounds good enough and works fast enough is the Roland gear I’ve already got, but it’s user configurability is worthless. (I haven’t tried the Eventide plugins, but at this point I’m sure they’re just as crap.)

My only remaining hope is to buy a Hipshot Trilogy bridge and make a Lego Minstorms robot to control it for me in response to MIDI pedal commands. Ugh ugh ugh.

#184616
Jul 29, 2010 at 11:09am

To me, the gabor pitch-shift examples ( gabor.psola.maxpat ) have quite short latency. It will sound good as long as your guitar sound is – really – monophonic. it’s free at : http://ftm.ircam.fr/index.php/Download (gabor is part of the ftm package)

#184617
Jul 29, 2010 at 5:22pm

Have you tried running the pitch-shifters you’ve tried at a higher sample rate? If you double the sample rate, you’ll have about half the latency figure etc….

Also, have you thought about using a hexaphonic pickup on your guitar? If you did that, you could process each string individually with a monophonic pitch-shifter, and if you used a high sample rate it’s likely that you could get latency down to a useable amount, and have pretty decent sounding polyphonic formant preserving shifting.

#184618
Sep 19, 2010 at 11:41pm

“Here it is but it needs some work particular with eliminating….”

what are good texts for this?

#184619
Jan 9, 2011 at 1:58pm

Have you tried ‘shifter~’, a “Formant-happy, pitch-synchronous-overlap-add-based (PSOLA) pitch shifter” by Tristan Jehan?

http://web.media.mit.edu/~tristan/maxmsp.html

#184621
Feb 12, 2012 at 8:24pm

Looks like the tristan site isn’t working anymore?

Anyone know where else one can download shifter~? (maxobjects just points to tristan’s site).

I’ve been using a gizmo~ but it sounds pretty weaksauce, particularly as compared to a whammy-pedal.

Anyone find any good sounding monophonic pitch shifting options in the last year? Or more specifically something that sounds similar to a whammy-pedal (where it shifts ok, but more importantly the artifacts sound interesting, and not too fft-y).

#184622
Feb 13, 2012 at 11:26am

Hi
I briefly had some fun with elasticx, which I believe is delay-based, and it’s not free:

http://www.elasticmax.co.uk/elasticx~details.php

Here’s a free ‘version’:

http://www.youtube.com/watch?v=uyzY_ZP54pA

and I recall an external called free-elastic, but can’t find it here:

http://www.cycling74.com/forums/topic.php?id=16822

These delay versions are less artefact-y than gizmo, and then there’s always the granular approach – if you’re talking realtime stuff, I don’t know what the latency implications would be tho.

Brendan

#184623
Feb 13, 2012 at 1:04pm

That Delicious one sounds pretty good, better than gizmo and sounds realtime enough. There’s an awesome sounding gen one in the examples folder but it’s no good for realtime as it slides around all over the place.

#184624
Feb 13, 2012 at 1:16pm

Gabor sounds Far better….
( http://ftm.ircam.fr/index.php/Download -> gabor.psola.maxpat )

#184625
Feb 13, 2012 at 1:32pm

The recent external grainstretch~ by Timo Rozendal has also a pitch shifter function in real time.

#184626
Feb 13, 2012 at 2:56pm

I saw the gabor thing mentioned before but I wanted to avoid using something as heavy lifting as ftm (since I currently don’t have it installed).

I’ll take a gander at grainstretch~ though I do want to stick with vanilla objects for this.

#184627
Feb 13, 2012 at 5:41pm

Hi Rodrigo
if I haven’t done so already, will I post my own granular pitch-shifter? 2 x play + 2 x phasor objects. If you can build your own realtime record buffer, then this’ll work fine. I think it sounds quite smooth and artefact-free.

Brendan

#184628
Feb 13, 2012 at 5:54pm

I implemented a tapin/tapout system similar to the video you linked. Sounds alright.

I’d like to see if if you wouldn’t mind posting. Curious on the latency of a dynamically filled buffer system like that. (If I’m understanding it right).

#184629
Feb 13, 2012 at 9:58pm

Hi Rodrigo
here it is; while it may seem a little heavy-handed, it forms the basis of a larger more powerful granular playback engine – pitch shifting is merely one feature of it – so you might want to stick with the simplicity of dude837′s tapout version above

– Pasted Max Patch, click to expand. –

Brendan

#184630
Feb 13, 2012 at 10:25pm

That sounds good but not worlds better than the tapout version. What a finicky effect pitch shifting is….

#184631
Feb 19, 2012 at 12:23pm

I’m joining in late here.
I’ve been using the tapin~ tapout~ technique for quite a while now.
Maybe I can share it later, although it won’t be much different from Brendans version.

But I must say these psola externals are quite nice. Although some other artefacts are definitely audible.
Does anyone know how to design them in max? (Time domain preferably.)
I’ve been looking around the internet, but haven’t found out exactly how it is done.
Here’s an article explaining a bit about psola: ftp://ftp.eng.umd.edu/:/home/glue/p/r/pratkn/pub/ENEE632_Project%20Report.pdf

Is it just a granular synth, in which the window size is a division of the pitch period?

#184632
Feb 20, 2012 at 8:20am

You should try diracLE~ by Timo Rozendal.
It sounds very good and gives you control over the formants too.
It’s a bit heavy on cpu though.

#184633
Feb 20, 2012 at 10:29am

I was going to suggest DiracLE~ but then saw that the OP’s issue is the glitching when changing pitch, and sadly DiracLE~ does that too.
Have you tried Noboyasu Sakonda’s Realtime Pitch Shifter ( http://web.me.com/nsakonda/sakoweb/download.html )?
I’m not at a Max machine right now, so I can’t test if it does this too and it’s a while since I used it, but from what I remember, it does a pretty reasonable job of pitch shifting otherwise.
And Sugar Synth, which is on the same page, is, well, sweet! (as indeed is his Autotune patch, P.Molder),
Cheers
Roger

#184634
Feb 20, 2012 at 10:31am

I personally would be into some glitchy-ness, though I’m trying to stay external-free (as much as possible anyways).

I’ll check diracLE out though as it’s been mentioned a couple of times now.

#184635
Feb 20, 2012 at 12:07pm

Actually seems like diracle adds latency for realtime usage which makes it a no go unfortunately as it sounds good

#184636
Feb 20, 2012 at 12:41pm

Hi
here’s my realisation of dude837′s realtime pitch-shifter, sounds damn good to my ears:

Attachments:
  1. pitchTap101.zip
#184637
Feb 20, 2012 at 3:27pm

Mine’s quite similar though I preferred the sound with just 2 voices and a short delay window (I think I used 50). To my ears going to 3+ voices sounds worse and worse.

#184638
Feb 20, 2012 at 4:40pm

Here’s my tapin~ tapout~ version. Needs a little more debuggin.
But overall I quite like the sound.
Because I made this one to create a choir, I added a little vibrato.
I don’t know if it works so well on other sounds.

Any suggestions to make it better are more than welcome.

Attachments:
  1. pitchshiftDave.zip
#184639
Feb 20, 2012 at 5:14pm

Would be interesting to revisit these designs in gen~, since you have different interpolation modes that might affect the quality of the sound. It also might be interesting to try using allpass interpolation.

#184640
Jan 14, 2014 at 3:49am

HI there!
Happy new year 2014!
I think using tapin/tapout to built overlap-add-like pitchshift is wrong: Apparently, tapout cannot delay less than the vector size… and in overlap-add algorithms the delay go down to 0 all the time!

one should use delay~ instead in that case.

here is a topic i made about this problem: http://cycling74.com/forums/topic/same-pitchshift-algorithm-sound-different-in-gen-and-msp/#post-278182

And by the way here is a BENCHMARK of the quality/latency for various pitch shifters used on a monophonic source: http://cycling74.com/forums/topic/monophonic-pitchshift-engines-benchmark-psola-in-gen/

Tschuss!

#278184

You must be logged in to reply to this topic.