Author |
Message |
Tim Kleinert
Joined: Mar 12, 2004 Posts: 1148 Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236
|
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.
The parameters:
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.
cheers,
tim
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.
Description: |
Pimping the G2 pitch tracker module in a meaningful way. |
|
 Download |
Filename: |
PitchDetector_TK.pch2 |
Filesize: |
1.9 KB |
Downloaded: |
4195 Time(s) |
|
|
Back to top
|
|
 |
otoskope

Joined: Jun 14, 2005 Posts: 26 Location: Sweden
G2 patch files: 1
|
Posted: Thu Jun 06, 2013 2:44 pm Post subject:
|
 |
|
Thanks for posting this! I've used a similar approach many times, but your patch is much more elegant (and user friendly)! With this technique I have also been able to extract snippets of stable pitch detection inside polyphonic material, such as pop songs, using a check for a certain time of stability (quite short, but still). Then collecting these assembled values and doing something useful from them...
/Palle _________________ The brain is always greener on the other side. |
|
Back to top
|
|
 |
exeterdown

Joined: Oct 13, 2013 Posts: 47 Location: Melbourne, Australia
G2 patch files: 3
|
Posted: Tue Oct 07, 2014 4:50 pm Post subject:
|
 |
|
This is fantastic. I've been messing around with the pitch tracker a bit lately but got nothing near this sophistication.
Three years on and I still feel like I'm clumsily using the G2 at face value.
So much to learn.
Thanks! |
|
Back to top
|
|
 |
BobTheDog

Joined: Feb 28, 2005 Posts: 4039 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Wed Oct 15, 2014 6:24 am Post subject:
|
 |
|
exeterdown wrote: | This is fantastic. I've been messing around with the pitch tracker a bit lately but got nothing near this sophistication.
Three years on and I still feel like I'm clumsily using the G2 at face value.
So much to learn.
Thanks! |
I wouldn't worry about it, Tim is not mortal when it comes to the G2, he is some kind of higher being. I haven't got a clue what he is talking about most the time but it is always interesting. |
|
Back to top
|
|
 |
|