[sdiy] lookup table as expo converter
Ingo Debus
debus at cityweb.de
Tue May 25 16:41:49 CEST 2004
Am Dienstag, 25.05.04 um 00:29 Uhr schrieb Tim Ressel:
> Tim don't know compression. Tim just bang rocks
> together and make wavetable.
>
Here's an easy way how to do it with a small table:
Take the ADC value, subtract the binary equivalent of 1 volt, do this
as often as required to get into the range between 0 volts and 1 volt.
Count how often you had to subtract, this gives you the octave you're
in (assuming the input is 1volt/octave). Then use a table to decode the
remainder. If you only need semitone resolution, this table has just 12
entries. The octave gives you a multiplier, say 1 for lowest octave, 2
for next octave, 4 for next octave and so on.
I used a similar technique (just the other way around) in my
pitch-to-MIDI converter.
Ingo
More information about the Synth-diy
mailing list