Go Down

Topic: Generate Control Voltage for a modular synth (Read 16822 times) previous topic - next topic

Sprak

Has anyone gotten far enough with Arduino>CV to be willing to share schematics/code?

Narbotic

Quote
Has anyone gotten far enough with Arduino>CV to be willing to share schematics/code?


I'd be quite interested as well.  I can't seem to find examples of even MIDI-in decoding anywhere.  That piece of code would be very welcome in my Arduino Synth project:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1186530609

So if anyone has the time - Thanks in advance!

Daniel

Quote
Has anyone gotten far enough with Arduino>CV to be willing to share schematics/code?




Does the otput voltage have to be super smooth?

The analog approach would be to take a PWM output, and run it into an op-amp filter to control the response-- the smoothing. I'm one of those people who just throws down an Op-amp and a bunch of .1Uf caps and 100K or 1M resistors, and fiddles with it until it works. If there's a real analog-thinking engineer in here, perhaps they could tell us the right components/schematic to turn a PWM output into a smooth voltage?


On the digital side of the solution, I found this DAC based on an AVR:
http://www.elby-designs.com/avrsynth/documents/avrsyn-dac.pdf
http://www.elby-designs.com/avrsynth/documents/avrsyn-logic.pdf

They're on this page...

It's a very cool idea to make a CV module with, say, a barebones-like board.



D

Narbotic

Hmm, I like the dirty opamp  approach.  I could use some more experience with them anyway.

veeate

I'm new to the Arduino (haven't even powered it up yet), but I'm interested in using it to generate 0-10V range voltages for use with my synth as well. There was a thread on the parallax BS2 forum about I2C/Serial DACs - has anyone considered using them with the Arduino for this purpose? The part number mentioned in that thread was MAX518 (only 8 bit though so not ideal).

http://datasheets.maxim-ic.com/en/ds/MAX517-MAX519.pdf

Daniel

hi

can someone from the music side explain how this CV thing is used what its electrical characteristics are? Then us hardware types can figure out how to do it. Not that the two sides are mutually exclusive. I'd like to build a synth too.  :)

D

relaxing

#21
Aug 23, 2007, 08:32 pm Last Edit: Aug 23, 2007, 08:34 pm by relaxing Reason: 1
Daniel: http://en.wikipedia.org/wiki/CV/Gate
Essentially, a constant voltage corresponds to a constant frequency.


The trick I think we're looking for is how to turn the analogWrite PWM into a constant voltage.
If I call analogWrite( 128 ), I want a steady 2.5V out.  Not a 5V peak square wave with a 50% duty cycle.  Makes sense?

Daniel

#22
Aug 23, 2007, 10:01 pm Last Edit: Aug 23, 2007, 10:04 pm by Daniel Reason: 1
yes that totally makes sense now.

the simple way to do that is with an Resistor and Capacitor (RC) filter. You could get what, 6 CV's form An Arduino, as it has 6 PWM pins?

It would be good to have an op-amp in there too, to prevent loading effects and to promote stability.

This Microch*p application note describes how to do it, and gives formulas for calculating the RC values. Try the values they give (4K and .01uF) and see what happens!

D

relaxing

#23
Aug 24, 2007, 01:03 am Last Edit: Aug 24, 2007, 01:07 am by relaxing Reason: 1
Thanks for your help, Daniel.  Could you explain this further for me?
My limited understanding of analog circuits was that a low pass filter, by removing the higher order harmonics, would turn the square wave into a sine wave.  How does the op-amp circuit put out a constant V?

I also don't understand why that data sheet refers to turning the PWM signal into an "analog output."  To me, PWM is an analog signal  - no digits involved.  So what do they mean then by analog?

veeate

#24
Aug 24, 2007, 02:18 pm Last Edit: Aug 24, 2007, 03:08 pm by veeate Reason: 1
I'm curious about the limitations of having the Arduino carry out the process - would using the PWM pins limit us in terms of resolution or have problems with extreme changes in voltage relatively quickly? Anyone know how to calculate how many bits would be needed for relatively precise control over 1V/oct oscillators?

Also - some synth users may require a 0-10V range - the PWM only provide a max of 5V, correct?

relaxing

There's another solution that occurred to me - what about using a digital potentiometer to attenuate a reference voltage, rather than generating the voltage out of the arduino pins. That would allow your 0-10V interface.
I'm curious what those knowledgeable about hardware think of that.


As for precision, let's say you made only a 1 octave synth.  With only 256 possible voltage levels from an analog write, that gives you about 23 steps per note, or a worst possible error of 5 cents -- kinda funky.  Trying to control a wider voltage range would get worse, obviously.

However, if you used 14 digital pins to control a DAC, 2^14 == 16384 voltage levels, which seems pretty reasonable.

veeate

I'm no expert - but from what I know the nature of digital pots is incremental (256 tap points along a particular resistance, etc) so once again we're into stepped adjustments unless an integrator or similar is used to smooth things out...

relaxing

I was looking at the data sheet for a 1024 tap digipot (MAX5481) which would probably be somewhat reasonable even across 10V.  Although you're right, it would be steppy.  The tradeoff is you get 14 CV outs, rather than 1 out from a 14 bit DAC.

Daniel

@relaxing:

the RC filter is very simple, just like a power supply filter. When the putput pin is at +5, the cpacitor charges slower than normally through thee resistor, and the voltage across the cap rises. When the output goes low, the cap discharges into the output in through the resistor. Sort of like a shock absorber.  If the values are right, the hard variations ( 90[ch730] rising and falling edge of PWM signal) will get flattened out. With just one RC, it won't be a totally smooth voltage, but it will be pretty good.

D

relaxing

I built the circuit, no luck.  All I get is the 485hz PWM tone modulated by my desired frequency.  
The RC filter just sounds like a lowpass filter -- is there some "magic" value of cap and/or resistor where the square wave will suddenly go flat?
When I tried the formula on that datasheet I ended up with a miniscule value for R... but they were dealing with a PWM frequency in the MHz range.

Go Up