Voltage/digitally controlled volume circuit ideas

Started by rsq, April 21, 2020, 08:23:33 AM

Previous topic - Next topic

rsq

Hi !

I am trying building a synth which has 16 analog oscs driven by a microcontroller (arduino for now), to learn electronics.
I would like to make a circuit which allows the arduino to control the volume of each osc independently using a multiplexed analog output (or, maybe, digitally ?)

I am considering multiple option, and I would like to have your feedback because I'm still learning a lot in electronics.

1) Digital pots seems to be a good option but are too expensive for my budget (I would need 16 of them), and I don't need this level of precision. I would be ok with something like 16 steps of volume for each voice.

2) I have found these kind of circuits : http://www.electronicecircuits.com/electronic-circuits/voltage-controlled-volume using JFETs, but I honestly don't really understand how it works and I don't really know how to adapt it for a 0-5V modulation voltage (which is my arduino output).

3) I also thought about using opamps, found lots of schematics and very helpful ressources (like this one : http://hackmeopen.com/2011/04/voltage-controlled-amplifier/) but I'm a little lost in the dozens of designs I found. Also until now I only use 0-12V voltages so I don't know what kind of opamps I should use, and how..

4) The "simplest" solution I found : I found out that 16 analog multiplexers are quite cheap, so I thought I could just connect a mux with 16 different resistor values to each of my voices ? But it means that I would have to also multiplex each of the 4 select pins of the mux from my arduino to be able to set the volume value of each voice, am I right ? Is it a viable option ?

I would prefer not to use vactrols.. I used them in lots of project but I would like to try something different (and more precise) for this one !

There are probably many other options.. I'd love to have your opinions about these !

Thank you very much for your help !

Kevin Mitchell

#1
I'm guessing you have an individual output for each oscillator?

Are you asking for CV control just to control the output through the arduino? Or do you plan on using an external VCA to control them? For integrated control it would save you time and effort if you were to take an analog approach (10k to 100k pot for each output, oscillator signal on pin 3, output on pin 2 and ground on pin 1).

If you're mixing the oscillators via code then you'll have to try something else. There are plenty of how-to guides about using pots to control variables in your code. Some folks even adapt a 10k pot with series resistors to use as a rotary switch.

-KM
  • SUPPORTER

rsq

Thanks for your answer ! I'm not sure I understood what you suggested me. The output of the oscillators are mixed in an "analog" way (not by code - there are no ADC).
But I don't need "physical" pots, what I am trying to achieve is just that the arduino could change the volume of each channel of the mix when it wants to. Something like a relay board before a classic mixer circuit, the only difference being that I need control over the volume (not just mute/unmute a voice).



amptramp

There are a few ideas you can use:

1. Use pulse width modulation where the signal can be interrupted at an ultrasonic level.  This could be done in the Arduino or external to it.

2. Put the output through a multiplying DAC like a DAC0808 or DAC1208.  Use the signal as the reference and use the digital inputs as the volume control multiplier.  Use figure 9 of this spec:

https://html.alldatasheet.com/html-pdf/115055/NSC/DAC0808/414/7/DAC0808.html

This gives you 256 volume steps.  The DAC1208 is a bit more difficult to use since you need to load the digital signal in two bytes but it gives you 4096 volume steps.


ElectricDruid

I'd use the '2164 quad VCA for a job like this. It'll provide 0-100dB of attenuation for an input CV of 0-> 3.3V. You 0-5V Arduino output can be scaled down easily enough. Four VCAs on a single chip means it's pretty cheap per-VCA.

The output is a current that can be fed directly to an op-amp mixer(I-to-V stage) which sounds like it would be ideal for your situation, mixing a load of oscillators into one output. There's an example of this in the 2164 datasheet. There are several manufacturers making the chip now, and you'll find the AS2164, the V2164, and the SSI2164. The SSI one is slightly different, but the other two are entirely compatible with the original SSM2164.

HTH,
Tom




FiveseveN

Quote from: rsq on April 21, 2020, 08:23:33 AM
I found out that 16 analog multiplexers are quite cheap, so I thought I could just connect a mux with 16 different resistor values to each of my voices ?
That's what a digital pot is, just usually with more steps. This one's about half a buck for 64 steps (6 bits): https://eu.mouser.com/ProductDetail/Microchip-Technology/MCP4013T-503E-CH?qs=sGAEpiMZZMuD%2F7PTYBwKqQL98FwT3BeHwWnSUWNrzqs=
Quote from: R.G. on July 31, 2018, 10:34:30 PMDoes the circuit sound better when oriented to magnetic north under a pyramid?

rsq

Quote from: amptramp on April 21, 2020, 04:25:30 PM
There are a few ideas you can use:

2. Put the output through a multiplying DAC like a DAC0808 or DAC1208.  Use the signal as the reference and use the digital inputs as the volume control multiplier.  Use figure 9 of this spec:

https://html.alldatasheet.com/html-pdf/115055/NSC/DAC0808/414/7/DAC0808.html

This gives you 256 volume steps.  The DAC1208 is a bit more difficult to use since you need to load the digital signal in two bytes but it gives you 4096 volume steps.

Indeed, that should work ! but that means I'll have to get 16 dacs, which isn't the cheapest option... Also I don't need this level of precision. I would be ok with something like 16 or 32 volume steps

Quote from: ElectricDruid on April 21, 2020, 07:27:32 PM
I'd use the '2164 quad VCA for a job like this. It'll provide 0-100dB of attenuation for an input CV of 0-> 3.3V. You 0-5V Arduino output can be scaled down easily enough. Four VCAs on a single chip means it's pretty cheap per-VCA.

The output is a current that can be fed directly to an op-amp mixer(I-to-V stage) which sounds like it would be ideal for your situation, mixing a load of oscillators into one output. There's an example of this in the 2164 datasheet. There are several manufacturers making the chip now, and you'll find the AS2164, the V2164, and the SSI2164. The SSI one is slightly different, but the other two are entirely compatible with the original SSM2164.

Thanks for suggestion ! I'm just not sure about how I can output 16 different pwns from an arduino. I'll probably need an external driver (like these 16 channels PWN drivers used for servos) ? And maybe also filtering the outputs ?


Quote from: FiveseveN on April 22, 2020, 06:44:57 AM
This one's about half a buck for 64 steps (6 bits): https://eu.mouser.com/ProductDetail/Microchip-Technology/MCP4013T-503E-CH?qs=sGAEpiMZZMuD%2F7PTYBwKqQL98FwT3BeHwWnSUWNrzqs=

Good catch, this is interesting. I only searched into jlcpcb assembled available parts but these look great, I'll give it a try. The more I think about the more I believe going full digital for the volume control will be much simpler (and cheaper).

I also discovered this chip (which is cheaper than one digipot), a 6 channels I2C volume controller : https://www.electrokit.com/uploads/productfile/41011/PT2258.pdf
This seems to fit exactly my needs, have you ever used this kind of controllers ?

Thanks everyone.

ElectricDruid

Quote from: rsq on April 22, 2020, 08:43:40 AM
Quote from: ElectricDruid on April 21, 2020, 07:27:32 PM
I'd use the '2164 quad VCA for a job like this. It'll provide 0-100dB of attenuation for an input CV of 0-> 3.3V. You 0-5V Arduino output can be scaled down easily enough. Four VCAs on a single chip means it's pretty cheap per-VCA.

The output is a current that can be fed directly to an op-amp mixer(I-to-V stage) which sounds like it would be ideal for your situation, mixing a load of oscillators into one output. There's an example of this in the 2164 datasheet. There are several manufacturers making the chip now, and you'll find the AS2164, the V2164, and the SSI2164. The SSI one is slightly different, but the other two are entirely compatible with the original SSM2164.

Thanks for suggestion ! I'm just not sure about how I can output 16 different pwns from an arduino. I'll probably need an external driver (like these 16 channels PWN drivers used for servos) ? And maybe also filtering the outputs ?

Yes, you would need 16 control voltage outputs, and if you're using PWM to generate them, then yes, they *absolutely* need filtering, especially at the slow PWM frequencies the Arduino uses. If you fed that to a VCA's control input it'd make a horrible racket.


Considering all that, that PT2258 you posted does look like an excellent option. The Arduino can talk I2C easily enough, right? They have libraries for that? (he asked hopefully). Three of those chips, two comms lines, and you're about there. I don't quite get the two CODE pins, but I guess they set up an internal I2C address so you can use multiple chips (like you'd be doing).

rsq

Quote from: ElectricDruid on April 22, 2020, 10:19:43 AM
Yes, you would need 16 control voltage outputs, and if you're using PWM to generate them, then yes, they *absolutely* need filtering, especially at the slow PWM frequencies the Arduino uses. If you fed that to a VCA's control input it'd make a horrible racket.


Considering all that, that PT2258 you posted does look like an excellent option. The Arduino can talk I2C easily enough, right? They have libraries for that? (he asked hopefully). Three of those chips, two comms lines, and you're about there. I don't quite get the two CODE pins, but I guess they set up an internal I2C address so you can use multiple chips (like you'd be doing).

Thanks for the additional informations !
Indeed, I2C with arduino is pretty straightforward. From what I understood, the 2 code pins allow to choose an adress for the I2C communication. As there are 2 bits this allows for 4 different adresses, which means 4 chips simultaneously (=24 controls). Even without that, I2C multiplexing is not very difficult and allows an (almost) infinite number of controls  ;D

PRR

  • SUPPORTER