Go Down

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



what did you feed the circuit into? you need to give it a high-impedance load, so if it was something like a 1K line input, that would defeat the circuit entirely... when I get a chance  I'll build it myself and see what's up.



I'm feeding them into a modular synth -- Signal Input Impedance: 100K ( according to http://synthesizers.com/technical.html )


Aug 25, 2007, 05:20 am Last Edit: Aug 25, 2007, 05:21 am by relaxing Reason: 1
Actually, I think it's working now.  What I neglected to mention was that I was trying to output in the audio domain -- I was hoping I could digitalWrite out a sawtooth wave at audio frequencies, and the arduino just isn't fast enough to do it.  (There go my dreams of making a wavetable synth.)

When I gave that up and tried generating control voltages, it seems to work ok.

By turning a pot I was able control the pitch of a VCO with the CV the arduino generated.
Code: [Select]
void loop() {
 k = analogRead( 0 )/4;
 for( i = 0; i < 1000; i++ ) {
   analogWrite( 3, k );  

Now I'm not sure that it's giving me the full 0-5V range, but I'll have to play with that more tomorrow.


Has anyone made further progress with this?  I'm interested in the same thing- outputting a 0-10v CV control for my modular synth.  I see that relaxing was successful at filtering the 5v pwm output, but how does one go about scaling that to the 0-10v range?  Any chance someone could post photos or schematics for this?


I have been thinking about something similar.

My inspiration is Kymatica's parallelport CV / gate interface :


He uses a serially controlled MAX536 quad DAC to generate the CV with very high precision.
It should be easy to use Arduino in stead of the parallel port.

The MAX536 is VERY expensive and need quite a lot of external components to work in this scenario, but it can generate 4 CV's at the same time and with the high precision a musical application requires.  

Cheaper single channel DAC's could surely be found, but as soon as you require the handeling of 10V with a decent "bit depth" the pricetag just goes up.



What features should I be looking for in a DAC to provide sufficient resolution?


I just realized that the AnalogWrite function only provides 256 values, which, as already noted, is not nearly enough precision for 0-10v @ 12 steps per volt.  I suppose a workaround would be to allocate one pin for the frequency within a single octave, and a second pin for the octave offset.  This would yield 21.3 values per semitone, which seems like plenty of resolution.


The 256 value limitation for the analog out is the reason to choose a DAC that kan be serially controlled. That way you are only limited by the capability of the DAC.

The MAx536 has 12 bit precision. That will give you 4096 discreete values. If your synth use the standard 1V/octave over a 0 -10 volt range you will have a little more tha 409 "steps"/ octave or 34 "steps" for each key in the octave. This should be enough even to make pitch bends with out anoying stepping of the pitch.


I guess this is my newbie ignorance showing, but what do you mean by "serially" controlled?  Does it use several digital out pins in conjunction to communicate a single value to the DAC?


Nov 14, 2007, 12:17 am Last Edit: Nov 14, 2007, 12:18 am by MikMo Reason: 1
Yes exactly.

There are a few different "protocols" twi and i2c and  SPIare a couple of them. They use a few digital lines to implement serial communication to devices that support the protocol.


Thanks for the info.  I stumbled across this introduction to the SPI protocol, which appears to be what the MAX536 uses.

This makes a lot more sense now!


Maybe this should be a new topic, but does anyone have a suggestion for a DAC other than the MAX536?  They are almost $50 each, and a discontinued item.  I'm hoping to find something a lot cheaper, currently in production, and of course at least 12 bit.


well, its been almost 12 months since I started this beast...

Anywho, I got bored about a month ago and did some new coding and managed to put together a crude voltage "sampler" for the modular using the arduino. I have wanted one of the modcan "CV Recorder" modules for a while, but couldn't justify the cost.

I found some Arduino code for recording pot movements and just adapted it for a CV input. I hooked up a CV joystick I have and recorded myself sweeping it around into the arduino. I also ran a VCO into the arduino while I tweaked the freq knobs. I then had a toggle that I would flip and it loops through the recorded data. However, using the analog input pin to sample causes some serious stair-stepping action. (only have 256 values) I also need to understand the amount of data that I can store in the arduino ram in regards to my array. I was storing  a max of 200 values and depending on how much of a delay I use, obviously that degrades the quality as well.

If there is interest, maybe I will re-breadboard this and put the code someplace in the next few weeks.


I've been doing some more research into this myself.  I'm still looking at different DACs, and starting to feel that a 16 bit one would be necessary to get the level of precision required by a volt/octave CV system.  A CV Recorder is one of the projects I'm thinking about doing.  If you're just tweaking a joystick, 256 values should be sufficient, but if you're trying to record precise note information, it's back to the 16 bit ADC/DAC combination.  I think it would really require some external RAM as well.  As far as stairstepping goes, you could always interpolate between output values, but that still means using a high-res DAC to get better precision.

What sample rate are you recording at?



What sample rate are you recording at?

I assume you're determining sample rate based on the delay between capture loops? I really don't recall what I was messing with. I think I had the delay of around 15. It was a really crude setup.

I'm going to research using external memory in the near future.

Go Up