[Csnd] about pitch tracking
Date | 2012-10-13 12:40 |
From | francesco |
Subject | [Csnd] about pitch tracking |
Hello All, i'm trying to do some real time pitch tracking (with amplified guitar) using ptrack; i have this problem: when audio input is silence (well, when i'm not playing) i have output at low frequencies (and hight amplitude); using ampdbfs(kamp) into oscillator give me better result with silent input, but a more scaled audio signal although i'm using ksmps = 1. I have tried to make some sort of threshold on input, somethings like if abs(ainput < 0.1) then amplitude * 0, but then i have distort audio. There is some way to apply a threshold at input? Do i need to filter the output with a high pass filter? Do You have some advices in general? My simple test csd: audio in ; ptrack kcps, kamp ptrack audio, 4096 ;a1 poscil ampdbfs(kamp), kcps, giSine a1 poscil kamp*0.005, kcps, giSine outs a1, a1 -- View this message in context: http://csound.1045644.n5.nabble.com/about-pitch-tracking-tp5716798.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-10-13 13:43 |
From | Justin Smith |
Subject | Re: [Csnd] about pitch tracking |
The compress opcode can be used as an noise gate if you set your minimum pass through level as kthresh. This can eliminate output below a certain threshold with minimal distortion. Also, you can high pass filter your input (I recommend using buthp) to eliminate those spurious low frequency signals. Really, unless you are using a whammy bar, you can filter out everything lower than your low E, and that should help the accuracy of your pitch tracking. On Sat, Oct 13, 2012 at 4:40 AM, francesco |
Date | 2012-10-13 16:15 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] about pitch tracking |
I normally use follow2 for better control over the amp envelope extraction. Also, you can get a better tradeoff between frequency and time resolution in ptrack by switching between two different ptrack instrnaces with different hopsize, and do the switching dependent on detected fundamental frequency. Finally, some median filtering of the ptrack frequency output can get rid of most of the intermittencies. Here's some code lifted from the Hadron orchestra, I've adapted it a little bit to make it more clear for what I guess is your purpose. Hope I did not make any silly errors when cutting and pasting,... did not test this version of the code, but in any case it should show the general idea of the setup. best Oeyvind ;********************************************************************* ; Pitch and amp analysis ; from Hadron code, Oeyvind Brandtsegg 2011, adapted 2012 kcps init 0 ihopsize1 = 4096 ihopsize2 = 512 iChangeover = (sr/ihopsize2)*3 if kcps > iChangeover kgoto small kcps, kamp ptrack a1, ihopsize1 if kcps <= iChangeover kgoto nosmall small: kcps, kamp ptrack a1, ihopsize2 nosmall: ; filter pitch tracking signal imedianSize = int(0.09*kr) ; calc as (1/(ihopsize*2))*kr kcps mediank kcps, imedianSize, imedianSize ; we don't use the amp output from ptrack as it is quite noisy, now using the follow2 amp analysis iAttack = 0.001 iRelease = 0.15 aFollow follow2 a1, iAttack, iRelease kamp downsamp aFollow ;(your output is kcps and kamp) ;********************************************************************* 2012/10/13 Justin Smith |
Date | 2012-10-13 17:55 |
From | francesco |
Subject | [Csnd] Re: about pitch tracking |
Thanks All, i'm going to try Your suggestions. About plltrack i need to better understand how is working ... For example: is alock (phase lock indicator, a phase error indicating the quality of the tracking) related to amplitude values? And what exactly means pll feedback gain, controls frequency range of PLL? Where can i find some explanation about this algorithm? Thanks, ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/about-pitch-tracking-tp5716798p5716805.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-10-13 18:12 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Re: about pitch tracking |
Well, the value of alock, which will be between 0 and 1, indicates the phase errors, and so high values are good. You can ignore this if you like. The higher the PLL gain (between 0 and 1) the wider the range of the tracking, but also more instability/errors can occur. Try a value of 0.2 to start with and then increase if you need. The paper reporting on this is Zolzer, U, Sankarababu, S.V. and Moller, S, PLL-based Pitch Detection and Tracking for Audio Signals. Proc. of IIH-MSP 2012. Regards Victor On 13 Oct 2012, at 17:55, francesco wrote: > Thanks All, > i'm going to try Your suggestions. > > About plltrack i need to better understand how is working ... > For example: > is alock (phase lock indicator, a phase error indicating the quality of the > tracking) > related to amplitude values? > And what exactly means pll feedback gain, controls frequency range of PLL? > > Where can i find some explanation about this algorithm? > > Thanks, > ciao, > francesco. > > > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/about-pitch-tracking-tp5716798p5716805.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2012-10-13 18:38 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Csnd] Re: about pitch tracking |
Any chance of a manual page for this opcode? > Well, the value of alock, which will be between 0 and 1, indicates the > phase errors, and so high values are good. You can ignore this if you > like. > > The higher the PLL gain (between 0 and 1) the wider the range of the > tracking, but also more instability/errors can occur. Try a value of 0.2 > to start with and then increase if you need. > > The paper reporting on this is > > Zolzer, U, Sankarababu, S.V. and Moller, S, PLL-based Pitch Detection and > Tracking for Audio Signals. Proc. of IIH-MSP 2012. > > Regards > > Victor > > On 13 Oct 2012, at 17:55, francesco wrote: > >> Thanks All, >> i'm going to try Your suggestions. >> >> About plltrack i need to better understand how is working ... >> For example: >> is alock (phase lock indicator, a phase error indicating the quality of >> the >> tracking) >> related to amplitude values? >> And what exactly means pll feedback gain, controls frequency range of >> PLL? >> >> Where can i find some explanation about this algorithm? >> >> Thanks, >> ciao, >> francesco. >> >> >> >> >> -- >> View this message in context: >> http://csound.1045644.n5.nabble.com/about-pitch-tracking-tp5716798p5716805.html >> Sent from the Csound - General mailing list archive at Nabble.com. >> >> >> Send bugs reports to the Sourceforge bug tracker >> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >> Discussions of bugs and features can be posted here >> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe >> csound" >> > > Dr Victor Lazzarini > Senior Lecturer > Dept. of Music > NUI Maynooth Ireland > tel.: +353 1 708 3545 > Victor dot Lazzarini AT nuim dot ie > > > > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > csound" > > > > |
Date | 2012-10-13 19:12 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Re: about pitch tracking |
yes... on my todo list. On 13 Oct 2012, at 18:38, jpff@cs.bath.ac.uk wrote: > Any chance of a manual page for this opcode? > > >> Well, the value of alock, which will be between 0 and 1, indicates the >> phase errors, and so high values are good. You can ignore this if you >> like. >> >> The higher the PLL gain (between 0 and 1) the wider the range of the >> tracking, but also more instability/errors can occur. Try a value of 0.2 >> to start with and then increase if you need. >> >> The paper reporting on this is >> >> Zolzer, U, Sankarababu, S.V. and Moller, S, PLL-based Pitch Detection and >> Tracking for Audio Signals. Proc. of IIH-MSP 2012. >> >> Regards >> >> Victor >> >> On 13 Oct 2012, at 17:55, francesco wrote: >> >>> Thanks All, >>> i'm going to try Your suggestions. >>> >>> About plltrack i need to better understand how is working ... >>> For example: >>> is alock (phase lock indicator, a phase error indicating the quality of >>> the >>> tracking) >>> related to amplitude values? >>> And what exactly means pll feedback gain, controls frequency range of >>> PLL? >>> >>> Where can i find some explanation about this algorithm? >>> >>> Thanks, >>> ciao, >>> francesco. >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://csound.1045644.n5.nabble.com/about-pitch-tracking-tp5716798p5716805.html >>> Sent from the Csound - General mailing list archive at Nabble.com. >>> >>> >>> Send bugs reports to the Sourceforge bug tracker >>> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >>> Discussions of bugs and features can be posted here >>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe >>> csound" >>> >> >> Dr Victor Lazzarini >> Senior Lecturer >> Dept. of Music >> NUI Maynooth Ireland >> tel.: +353 1 708 3545 >> Victor dot Lazzarini AT nuim dot ie >> >> >> >> >> >> Send bugs reports to the Sourceforge bug tracker >> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >> Discussions of bugs and features can be posted here >> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe >> csound" >> >> >> >> > > > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2012-10-14 06:44 |
From | David Akbari |
Subject | Re: [Csnd] Re: about pitch tracking |
On Sat, Oct 13, 2012 at 12:12 PM, Victor Lazzarini |