Joined: Mar 12, 2004
Location: Zürich, Switzerland
Audio files: 6
G2 patch files: 201
|Posted: Sun Mar 25, 2012 1:56 pm Post subject:
Improved Pitch Detection
Subject description: Pimping the G2 pitch tracker module in a meaningful way.
|For anybody who expects me having made a workable DIY pitch detector -I have to disappoint you. Real autocorrelation is simply unpatchable on the G2. (Edit: Correction: It is patchable, but the tuning resolution of the output will be too coarse to be useful. The resolution is reciprocal to the amount of sample points processed, which in turn define the range of detectable pitches. And there is no feasible balance thereof on the G2 due to DSP limitations. I could probably cover a decent pitch range by downsampling to 12k, but the resolution in the upper register would be a joke. It would also max out a whole expanded G2. Usefulness: questionable.)
But take heart -the G2 pitch detection module is actually not bad at all. The real problem is that it makes no distinction between periodic and aperiodic signals, outputting chaotic values when dealing with the latter.
Since aperiodic signals by their definition do not contain any pitch information, a patch controlled by the pitch detector in any way should either remain silent when they occur (because there isn't any pitch information available to produce anything meaningful), or also output a synthesized aperiodic signal analogously.
So it all boils down to expanding the G2 pitch tracker module with extra circuitry that analyses the periodicity of the inputted signal and decides if it is sufficient enough for the signal to be regarded as tonal. Which is what this patch does.
IN LPF Freq: 36dB lowpass filter, to remove components irrelevant for the pitch detection.
IN HPF Freq: 36dB highpass filter, to remove components irrelevant for the pitch detection.
IN GATE threshold: A noise gate to differentiate between signal and background noise.
DEVIATE Time: Response time of the periodicity measurement. Higher values make it more sluggish, but also less prone to misfiring.
DEVIATE Tolerance: Defines how much frequency movement (deviation) is tolerated, above which the signal is considered aperiodic. Too low and everything is considered noise. Too high and everything is considered meaningful pitch information.
GLIDE Time: Smooths the detected pitch values
TRANSITION Time: Transition time between periodic and aperiodic output status. (There's also a "hard" gate output for this).
The cheapo demo circuit shows a possible scenario, using filtered noise for the aperiodic and a plain oscillator for the periodic phases. The transition time output neatly serves as a crossfade control between the two, as well as a volume control to silence out the patch when there is no pitch information.
The circuit as presented is optimized for my microphone and voice, and produces near zero pitch warbles and artifacts. (In fact I had a lot of fun building a pitch-shifter based harmonizer with it this afternoon.) You'll probably have to tweak it carefully to match your controller signal.
I don't know how well it responds to other types of signals. (If it doesn't, I might have another approach that might work.) Any feedback is welcome.
Edit: One drawback of this method is that wide/fast but perfectly periodic pitch changes will also fall into the "noise" category. By carefully tweaking the deviation response time and tolerance settings, one can often find a workable compromise though.
|Pimping the G2 pitch tracker module in a meaningful way.
|| 1.9 KB
|| 184 Time(s)