[sdiy] pitch to voltage
Dave Krooshof
krooshof at xs4all.nl
Mon Nov 5 01:23:16 CET 2001
Scroll down for my new oktave idea...
In pitch tracking, you can follow different tracks. To name a few:
1. count the peaks.
2. count zerocrossings
3. do FFT
4. do FFT and correlate.
1. The problems are: due to shifted overtones and other irregularities
you might end up with wrong responses. Octave jumps, mostly.
Also, you need to set a treshold.
2. The treshold is a problem. You could say things like: Only count a zero
crossing when the wave came from a certain amplitude. Otherwise it's noise.
Due to noise, however, your crossings might be too late or too early.
you'll jitter.
1+2: converting pulse rate is to a voltage is pretty straight forward.
The convertor is in fact a low pass filter, in a way...
1+2: you'll need a few pulses to get a good tracking, and in a low tone
that is a problem. For the low E, 42 Hz, and -say- 10 pulses to get stable,
your latency is some 1/4 secs!!!!
1+2 The first few pulses will be pretty messy, so expect your measurement
to raise from zero slowly, then maybe shoot over after that!
3. Fourier analysis takes a time window to do the analysis in. Fourier Analysis
is simple words comes down to notating which frequencies were in the air
in that time frame. In the digital world, there are formulas around to do that
for you.* Though you could recognize longer wavelengths then
the windowsize in a FFT, still the windowsize and the calculations take time.
So the latency = window length + calculation time. Add to that the fact that
the first window of a bassguitar note will look messy!
4. By using FFT and a correlation, you can narrow your time frame!
You can derive the pitch of a note of a (bass)guitar by its overtones.
say, if you found 400 + 500 + 600 + 700Hz** to be in that window, you
can expect 100Hz to be your real pitch.***
In theory, that is, I never got to actually implementing it, you
could derive the root harmonic from the attack, before it even
got to actually happen! Takes a heavy processor and lots of spare
time for programming. So in total the latency is about a year or two. :-)
Scroll down for my radical suboctave idea.****
Quad pickups: Some bass pickups are quadin one box. You can open them
and solder 4 outs, in stead of 1. Might take a lot of DIY skills and a good
recource of pickup data.
*Fourier was not interested in audio, but in the flow of heat in chambers
with a fire place. He came up with the idea that complex waveforms can
be reproduced by adding up simple waves and *vice versa*. He worked
out the math so clearly, that it became universal. Fourier transformation
is what the internet made beautiful: Both mp3 and Jpeg are FT in the
math! Fourier is my hero!
**See Harry's comment in the "CMOS Saw to Triangle Waveshaper" thread
and see why this measurement will produce a slightly flat output!
*** your brain/ear does this type of pitch analysis too.
This is why a man's voice through the 400Hz High pass filter still sounds
as a bassy voice. The overtone pattern is recognized.
****My radical octaver idea is... Let's name it "sheppard octaver"...
by waveshaping the input into a pattern that adds overtones in between,
the perceived octave is 1 down.
Say if a 100 Hz is played. We'll hear: 100, 200, 300, 400, 500Hz.
Then we waveshape 150, 250, 350 etc. into it. A bright 50 Hz is heard.
Any ideas on how to do this in (analogue?) hardware?
Is it possible to make a delay that is frequency dependent?
It should be .2 sec at 10 Hz, then gradually less in higher freqs:
0.02 sec at 100 Hz, 0.002 sec at 1kHz and 0.0002 sec at 10kHz.
If my imagination does not fail me, this will octavate any signal instantly,
even natural ones that hardly have the fundamental*.
Dave Krooshof
*anti fundamentalism. So far for the late nite thoughts
More information about the Synth-diy
mailing list