hi there,
i am trying to do something really nifty, and i'm almost there
basically it is a pitch to voltage converter in signal/samplerate domain only. it is a straight ripoff of the gr300 schematics (guitar synthesizer by roland made in the 80s). the principle is simple:
convert incoming signal to square wave (apply filtering first), convert to pulses, feed an accumulator to get a sawtooth wave from the pulses, measure the height of the sawtooth (which is dependant on frequency obviously) with a sample and hold circuit, and tadaa!!! you have a voltage dependant on the input frequency.
i did this in puredata and it works wonderfully, bass-guitar to any oscillator (since you can feed it from the "voltage") without additional latency! now i started porting this to axoloti and i have a problem with the last step. the "voltage" i am getting after the sample and hold is inverted to the pitch, so i have to use something like value/input to get a linear response. in puredata a simple [expr~ "samplerate"/$v1] did the trick, but in axoloti this is not possible. is there another way? i tried with reciprocal, but if i feed the signal to a frequency input of an oscillator the response is not right...or am i doing something completely wrong?
note that i used two sampleandhold, offset by one half of a wavecycle and add the results, in puredata this improved tuning stability by quite a bit. not sure if it is necessary on the axoloti.
attached is the patch, with 2 custom objects, do i have to post them?
gr300tryout.axp (5.5 KB)
also, i am well aware that this method only works in a certain range, since it will clip the sawtooth if frequency is too low, but that is ok.
cheers for anybody that will have a look.