Quote from: Magician on September 20, 2011, 02:01:39 PMEdited: Just realized, probably it would sound awful with 8 original bits scaled down to even less... But idea would still be practical with 16 bit or 24 bit R2R. Only less outputs 'd be available

Yup, that's the whole problem. That's why I want to do something in analog-domain. ;-)

The problem only I can see, is not that design isn't possible in digital domain, but only less outputs would be available in digital domain solution, than if we use PWM filtered to analog -> to VCA, just because PWM use single pin. So basically problem narrowed down to shortage of digital pins, ( for 8 voices x 8-bit envelope for each, would require 16 x 8 = 128 outputs ).It could be easily solved with shift register extender. Analog multiplier (1 transistor VCA) posted above create more distortion than 4 bit sound, and should not be considered seriously. More sophisticated VCA require more components, and higher price IC for all design.

But all that would take too many cycles and sample-rate would lower too much. To be honest, I could just add Envelope at 8-bits, but it would require multiplication or division and it slows the whole thing down to a point that I get like 1 voice.

Now, imagine the current Beat707 SY LE, which does 8 voices, now, combine that with 4 PWM outputs, there's no extra cycles added, and the Envelope math is very simple and is not per-sample calculated, so it would still fit on the code. Doing the VCA outside in analog domain would make all this work like a charm. Its only 4 voices, but still, 4 dual OSC voices, not bad for a single ATmega328. ;-)

Another path would go nuts and use another chip for processing audio, like my XMOS Shield idea, but that's another talk, check the other thread. ;-)

Those DAC have a dedicated Reference input for D to A conversion Vrefx. Acccording to the datasheet:

Quote

VREFA and VREFB are DAC voltage reference inputs.The analog signal on these pins is utilized to set the ref-erence voltage on the string DAC. The input signal canrange from AVSS to VDD.

Avss being the Analog ground, I guess you can modulate this voltage from Gnd to Vdd with the Arduino PWM to get a VCA. Output amplifier short circuit current is 17mA, so i'm sure yan can deal with it by lowpass filtering the PWout. You may need to charcterize the transfer function of such a wiring mean, but it shall do its job in the meantime, dual VCO + Dual VCA in a single chip.

There is a multiplier mode detailed in the Datasheet if this does not work as well...

I tested yesterday the simple solution of using the MCP4921 Vref input as a voltage control for my new synth project.

I basically connected a pot to the Vref, and made the voltage swing from 0 to 5V while DAC output was set full range saw wave (4096).

==> Volume control is smooth and very efficient. It's working pretty well. The only drawback is that it gets a little noisy at low Vref amplitudes (<500mV) but this was easily handled by appropriate filtering of the Vref signal (i.e. opamp buffering + 10nf cap at the input of the DAC).

I recommend this generally speaking, it's working well for a simple VCA design.

Check out coolaudio.com, they make a quad VCA chip.http://www.coolaudio.com/products.html

If the minimum buys are too much, google the part number & find a distributor, for examplehttp://www.mammothelectronics.com/Coolaudio-V2164D-Quad-Voltage-Controlled-Amplifier-p/400-1034.htm

"The V2181 is a state-of-the-art voltage-controlled amplifier (VCA) offering high-performance current-in/current-out technology including two opposing-polarity, voltage-sensitive control ports. The V2181 VCA combines many advantages such as ultra-low noise, ultra-low distortion, low offset and high gain-bandwidth. It requires few external support circuitry and is housed in a space-efficient 8-pin single-in-line (SIP) package."

"The V2162 is a new dual VCA and contains two high-performance voltage-controlled amplifiers. With two opposing-polarity, voltage-sensitive control ports, they offer wide-range exponential control of gain and high attenuation with low signal distortion. Both high-performance VCA's are factory-trimmed to deliver low distortion as well as control-voltage feed-through without further adjustment. The unit represents a highly compact and cost-effective solution."

"The V2164 contains four independent voltage controlled amplifiers (VCAs) in a single package. High performance (100 dB dynamic range, 0.02% THD) is provided at a very low-cost-per-VCA, resulting in excellent value for cost sensitive gain control applications. Each VCA offers current input and output for maximum design flexibility, and a ground referenced -33 mV/dB control port. The V2164 is available for many applications such as Automatic Volume Controls, Audio Mixers, Compressor / Limiters / Compandors, Noise Reduction Systems, Automatic Gain Controls, Voltage Controlled Filters, and Effects Processors."