Adding Envelope to an Output?

Magician:
Edited: 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. :wink:

I did some testing with OP-Amps, but since I have on clue on what I'm doing, it did sound good, until the volume lowered, then it didn't sound that good anymore. So I guess its a bit more complex to handle this out. Those VCA schemes I posted above are nice, but still a bit complicated, if I want to add 6 or 8 times those circuits, to get multiple voices. :astonished:

Take, for instance, the Beat707 SY LE project I did: https://github.com/Beat707/Beat707-SY-LE

If I could add at least 4 x 8 bit PWM outputs as the Envelope CV, that would be great. It would end up with at least 4 voices with 2 Square Osc each, not bad, all in a single chip design. Now add another ATmega328 or even run it at 20 Mhz, and improve even better the system. Then I could, later, find a way to add analog filters to it, also in simple terms.

I was hoping to get that with transistors or simple op-amps. But I don't know, it seems it would be more complicated than that. I will experiment some more another time.

The idea is to keep the whole thing as simple as possible. I know I could do all this in code, like the MidiVox did, but it only does one voice and I didn't like the sound...

Wk

Just apply the envelope to a voltage controlled amplifier. This is what the Moog was based on back in the day, it is a very simple circuit.

Dude, read above, I even posted a link to some VCA schematics above. :slight_smile:

What I'm trying to figure out is the simplest circuit possible, as the ones I found are still a bit "complex". :grin:

Wk

How bout a 1 transistor VCA?

It was used in the 808 drummachine (heh, a subtle tribute to the line of drummachines that I'm assuming was the inspiration for the beat707 name) but it can only do 1 polarity voltage.

But hey, the arduino only does positive voltages! How convenient!

Here's the page it's from:
DIY 808 circuits

Here's the actual VCA:

Not sure what the values should be.

Edit:
I found direct schematics for the 808:
808 schematics

Attached is a screenshot of part of the circuit that uses the transistor VCA, in the open hihat generator.
The left is coming from the envelope generator. Below this part would be the signal source. And it would be outputted to something on the right.

Picture 1.png

Oh! Oh! Oh! Thank you so much! I'm impressed I missed that one out! :blush: Thanks again.

Tomorrow I will check which parts I need, I don't have many transistors here, so I have to check which would do the job. Here's the list of what I got already:

	Transistors

		12 x 2N5087 PNP
		20 x PN2222 NPN
		25 x 2N3904 
		25 x 2N3906

Wk

BTW: Beat707 was named after the TR707 I had for a while, it was actually my cousin's, had to return to him...

Wk

Some interesting posts here: electro-music.com :: View topic - Single transistor VCA circuit

Wk

Glad I could help

It seems that one of the main thoughts on that forum is that the transistor VCA is not good for say, a mixer. Too lofi.
but the lofi-ness shouldn't be a problem for the arduino, you're not looking for the best sound quality in a synth ever.

I've been looking for a while during the last month to find a cheap and simple way to do a VCA, spent a whole day trying to do some tweakings with a BF245 and playing with its variable resistor polarisation, and eventually happen into a 4 Fet schematic with a lot of resistors...

Digging into the schematics of my old Synths like the paia Fatman showed a good tradeoff, but still costly according to your needs :confused:
Try a look at this : http://www.paia.com/manuals/docs/9308-fatman-manual.pdf

it's a kind of tradeoff, I chose the simpler way to do it : in digital world, using an 8bit LUT, one multiplication and a 8 bit shift for scaling. It's very efficient though.

Quote from: Magician on September 20, 2011, 02:01:39 PM
Edited: 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. :wink:

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.

What I'm saying, that shift registers + R2R 16-bit (homemade DAC) would win for
quality to simplicity/price ratio.

If we set amplitude resolution to less than 256 levels, R2R could be simplified to 14 (64 levels) or 12 (16 levels ).

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. :wink:

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. :wink:

Wk

Than just add digital pot, single chip: AD5204 / AD5206

Ah, I forgot about those, I did check some last time but they are a bit expensive, but them again, its a single chip solution, so I will check this out again, thanks. :blush:

Wk

How about this one?

http://www.ebay.com/itm/AD8403-AD8403AR50-4-Channel-Digital-Potentiometer-/150466582871?pt=LH_DefaultDomain_0&hash=item230881d957

I like that it has 4-channels for twice the price of a single channel chip.

Wk

what about tweaking the MCP4921 dual channel Dacs?

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

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 can
range 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...

Alternatively, if you were planning on using PWM and filter over a DAC chip, you could use the Vref on an op-amp, again driven by filtered PWM.

M

Thread resurection !

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 example
http://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."

Thanks for the link. I feel like trying one of those chips some day. They also seem to have a alternative to 13700 chips I already use today.