Yahoo Groups archive

SynthModules

Index last updated: 2026-04-28 23:14 UTC

Message

semi-tone math

2004-05-18 by djbrow54

As I use my PSIM for CV functions, the output never seems to be 'in
tune' with what I expect.  If I use the basicqu2.bas program as an
example to sample and quantize my keyboard CV, there is a
significant difference between the output and the keyboard CV.

I thought I would try and do the calculations in semitones.  The
input is 1023 steps over 10 volts.  Every 8.5 steps is a semitone (83
mV).  If I could divide the input by 8.5 then I would have the
semitone value. Since I can't divide by 8.5, I can multiply by 2 and
divide by 17.

Since the output is 4095 steps over 10.666 volts, every 32 steps is a
semitone. To convert the input from a semitone to the correct output
voltage, I would multiply by 32.  Thus if I take the input, multiply
by 64 and divide by 17 I convert it to the correct output and
quantize to the semitone.

In basicqu2, replacing the RAWDAC1=((ADC1V/16)*32)+49152 calculation
with RAWDAC1=((ADC1V*64)/17)+49152 yields an output that tracks the
keyboard CV quite well.

Does this math make sense?  I haven't seen any code use anything
similar to this.  I've been having issues with a program I'm writing
that samples and delays my keyboard output and this seems to correct
the issue.

Dave

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.