[sdiy] 1v /oct with ADC question

Gordonjcp gordonjcp at gjcp.net
Thu Dec 1 11:08:02 CET 2016


On Wed, Nov 30, 2016 at 07:47:35PM -0500, Mike Boracci wrote:
> Gordon,
> Thanks for the info.
> I'm making a player piano basically.
> 
> So I have 16 sliders and an ADC. I have a 61 key organ to run so that's where the 61 discreet values come in. If I were to abandon the idea of getting CV out of this thing it might be less confusing, but I need the CV to run external synths
> 

Okay, I don't get what you're doing here.  Are the sliders the input or is the organ the input?  If the sliders are the input, you'd need to capture the values in a higher resolution, apply hysteresis so they don't jitter, and scale the results to what you want.

If the organ is the output then I don't see how CV is going to help you, since they rely on switch closures.

If you're actually driving a V/oct synthesizer then yes, the CV will work.

You can't capture the pot values with a 6-bit value, because they will jitter.

> So after reading what you wrote I figured out that the only real issue is that the CV can be correct across the span of the pot, but I'll end up with 3 extra notes on the digital side so I'm pretty sure that the cv notes and the binary notes won't line up. I don't know how to resolve this. Don't have enough experience.

I explained this in the previous paragraph briefly, so I'll go into more detail.

You'd capture the pot reading as a value from 0-1023 (for example).  If you just divide that by 16, you'll get a range of 0-63, but let's not worry about that for now.  What you'll find is that at certain points on the slider setting, it'll hunt between (say) 15 and 16, because of noise in the circuit.  Say the DAC is reading 270, it'll only take a tiny amount of noise to make it jump to 272 which would give you 17 as a note number.

So what you do is, you measure the reading with the last one.  If it hasn't changed by more than a certain number of steps, you just ignore it.  Say you find a spread of about +/- 4 steps, you'd set this to 8.  If the ADC value has gone up by 8, someone has moved the knob.

Then when you divide by 16, you get 0-63.  you can see that it's easy to add 1 to that to get 1-64, and you could then clamp the top to 61.  You could also not add 1, and clamp the bottom to 1 so if the pot reading is 0 replace it with 1, and if it's greater than 61 replace it with 61.  Little more complex but the values would be more "centred" in the range of the pot.

-- 
Gordonjcp MM0YEQ#




More information about the Synth-diy mailing list