electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » Clavia Nord Modular » G2 Building Blocks
Improved Pitch Detection
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Tim Kleinert



Joined: Mar 12, 2004
Posts: 1148
Location: Zürich, Switzerland
Audio files: 7
G2 patch files: 236

PostPosted: Sun Mar 25, 2012 1:56 pm    Post subject: Improved Pitch Detection
Subject description: Pimping the G2 pitch tracker module in a meaningful way.
Reply with quote  Mark this post and the followings unread

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.


PitchDetector_TK.pch2
 Description:
Pimping the G2 pitch tracker module in a meaningful way.

Download
 Filename:  PitchDetector_TK.pch2
 Filesize:  1.9 KB
 Downloaded:  4308 Time(s)

Back to top
View user's profile Send private message
otoskope



Joined: Jun 14, 2005
Posts: 26
Location: Sweden
G2 patch files: 1

PostPosted: Thu Jun 06, 2013 2:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
exeterdown



Joined: Oct 13, 2013
Posts: 49
Location: Melbourne, Australia
G2 patch files: 3

PostPosted: Tue Oct 07, 2014 4:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Wed Oct 15, 2014 6:24 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » G2 Building Blocks
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use