[PD] pitch to voltage

Simon Iten itensimon at gmail.com
Sun Apr 27 11:27:33 CEST 2014


dear list,

i have a strange problem with my “sinetosawtooth” patch.

it is basically a version of the pitch to voltage conversion used in the old gr300 guitar synths from roland.

i cut out all the clutter to make it easier to look at and understand. (cut out the adaptive filtering at the input since i use a sine wave for this example and not a guitar string)

here is how it works (or should):

-an input signal gets amplified by a large factor and clipped. this squares the input.

-the square wave is converted to pulses. 

-the pulses from the rising of the square wave are used to set and reset an accumulating filter (rpole~)

this results in a sawtooth wave that varies in amplitude depending on the frequency of the input.

-a sample and hold samples the peak of the sawtooth and holds it until the next peak occurs. this, after a conversion gives us the input frequency. yeah!

	in the example patch i used the falling edges of the square wave to trigger the sample and hold. this samples the sawtooth amplitude after half the rising. (this is also why i have  22050 in fexpr~ and not 44100) i could not figure out how to sample the peak of the sawtooth, so suggestions here are very welcome.

now to the problem:

the extracted frequency does not exactly correspond to the input frequency. it is pretty close at low frequencies but gets worse at higher frequencies. the factor is not constant. at even higher frequencies (around 5000 hertz) the reported frequency gets totally out of control.

i first thought this is because the samphold~ object is inaccurate. but i then saw that the sawtooth wave from the rpole~ object has no constant amplitude even with the input frequency not changing. so it seems that either rpole~ or change~ is not accurate.

or the problem is that i sample in the middle of the rising and not at the top ( as described earlier)

attached the sinetosawtooth patch. set your sound card to 44100 or change the 22050 in fexpr~ to half the sampling frequency.

i would really appreciate if somebody could have a look at this,

thanks, simon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sinetosawtooth.pd
Type: application/octet-stream
Size: 2000 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140427/f5049643/attachment.obj>


More information about the Pd-list mailing list