Author |
Message |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Sun Mar 13, 2016 10:41 am Post subject:
Quad vca (actually quad potmeters... Subject description: Just a wild idea, or not? |
 |
|
I have been struggling with building a VCA.
Recently I have tried this (with two opto fet's), but that didn't work.
So I thought, what is the easiest control available? Well a potmeter ofcourse!
Why don't I use digital controlled potmeters as a VCA?
This afternoon I have been breadboarding with an arduino and an AD5144 which is a quad 256 position potmeter, available in 10k and 100k.
I just read an (8 bit) analog input and put that value in the register of the digital controlled pot, and it works great!
I knw that there are only 256 possible values, but hey... midi has 128 and nobody is complaining....
Description: |
|
Filesize: |
4.39 MB |
Viewed: |
406 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |

|
Description: |
This is how I'm going to make it. |
|
Filesize: |
70.83 KB |
Viewed: |
525 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |

|
|
|
Back to top
|
|
 |
Cfish

Joined: Feb 24, 2016 Posts: 477 Location: Indiana
|
Posted: Wed Mar 16, 2016 7:12 pm Post subject:
|
 |
|
Just noticed this post. My brother and I have Ben knocking around the same idea. Wanting to MIDI control a set of Hammond tone wheels. It looks great on the scope. I think we were making it harder than it needed to be |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Wed Mar 16, 2016 10:20 pm Post subject:
|
 |
|
I just realised that the circuit probably will get a little more complicated because since the output is realy a 100k potmeter, the impedance at the output varies between 0 and 100k and depending what impedance the following circuit has this might pose a problem.
So the 4 outputs of this circuit probably need a buffer. |
|
Back to top
|
|
 |
Cfish

Joined: Feb 24, 2016 Posts: 477 Location: Indiana
|
Posted: Thu Mar 17, 2016 8:35 am Post subject:
|
 |
|
Another small problem can be when you use a gate signal direct in. If the phase of a sign wave is at a peak when it comes on full volume, you will get a bit of a pop when it opens. I have read about detecting the 0 point of the phase and only allowing it to come on at that point. Looks pretty complicated to me. Easier to just apply some low pass filter.
Hammond organs had a similar issue when the mechanical switch closed at the peak of the sign wave. The different capicitors used in different models to deal with that issue, have a lot to do with the different character of different models
A B3 has a lot more detonation at the beginning of a note than some newer tone wheel models. |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
|
Back to top
|
|
 |
Cfish

Joined: Feb 24, 2016 Posts: 477 Location: Indiana
|
Posted: Thu Mar 17, 2016 10:46 am Post subject:
|
 |
|
Thanks Grumble you have done a nice job on this. |
|
Back to top
|
|
 |
PHOBoS

Joined: Jan 14, 2010 Posts: 5810 Location: Moon Base
Audio files: 709
|
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
|
Back to top
|
|
 |
AlanP
Joined: Mar 11, 2014 Posts: 746 Location: New Zealand
Audio files: 41
|
Posted: Thu Mar 17, 2016 10:04 pm Post subject:
|
 |
|
Bummer
What kind of input protection are you going to use (or does the AD device have it already?) |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Thu Mar 17, 2016 10:37 pm Post subject:
|
 |
|
Well, since all voltages in this synth are from 0-5volt or from -2.5 to +2.5volt when shifted, the easiest would be to have the inputs divided by two and the outputs multiplied by two and power the VDD with +3.5volt and VSS with -3.5volt.
Control voltages are all between 0 and 5 volt, so I dont really need protection.
Btw, the adc device you are referring to is an Arduino (clone) which runs a small program to convert analog voltages to digital sequences that set the position of the wipers of the potentiometers. |
|
Back to top
|
|
 |
PHOBoS

Joined: Jan 14, 2010 Posts: 5810 Location: Moon Base
Audio files: 709
|
Posted: Fri Mar 18, 2016 3:44 am Post subject:
|
 |
|
Are you going to use a fixed (or switched) setup or patchable. If it is patchable you limit yourself by only using control
voltages for the VCAs. And there is a risk that if you would plug in an audio signal by mistake you fry the arduino. But maybe
you plan on using different connectors. Personally I just see every signal as a voltage, there is no difference between audio or
CV except maybe frequency. So I try to built my synths with -5V/+5V levels for everything except for (digital) gate/trigger signals. _________________ "My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Fri Mar 18, 2016 4:06 am Post subject:
|
 |
|
At this point in my design all voltages are between 0 and +5 volts (except one output of the noise generator...)
So I could balance the audio voltages around +2.5 volt.
The idea is to have the synth patch-able (a "real" modular).
Only with the filter (and the noise generator) I foresee problems because it will be powered by +5 volt and -5 volt will be able to self-oscillate and if that happens the output voltages will go beyond the 0 to 5 volt boundaries. |
|
Back to top
|
|
 |
PHOBoS

Joined: Jan 14, 2010 Posts: 5810 Location: Moon Base
Audio files: 709
|
Posted: Fri Mar 18, 2016 7:43 am Post subject:
|
 |
|
The noise generator output can be adjusted to the right levels with some opamps so that shouldn't be much of a problem.
You could also just rectify it and turn it into a positive signal level or simply remove the negative portion altogether.
As for the filter it is possible to limit the ouput by clipping the signal with some zenerdiodes. If there is an opamp at the
output of it you can simply put them in the feedback loop.
Also keep in mind that you don't have a lot of headroom with 5V. Opamps, even rail-to-rail ones, don't always work so well
when you push them to the supply voltage. So even if your levels are only 5V it would still be better to use a higher supply voltage.
And personally I would add some protection to the inputs just in case, it will only need 1 or 2 resistors and 2 diodes. This could save you some
trouble in the future if you want to connect something else to it. _________________ "My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube |
|
Back to top
|
|
 |
elektrouwe
Joined: May 27, 2012 Posts: 146 Location: Germany
|
Posted: Fri Mar 18, 2016 9:48 am Post subject:
Re: Quad vca (actually quad potmeters... Subject description: Just a wild idea, or not? |
 |
|
Grumble wrote: | ... midi has 128 and nobody is complaining.... |
I am complaining !
you will get linear steps, that means eg a 6dB step between control value 1 and 2 and almost no change between 254 and 255.
I would use a load resistor of 12k from wiper to GND to get a pseudo log response and then buffer with an opamp. See
http://sound.westhost.com/project01.htm
The EEPROM can stand about 10e6 amplitude step actions, which equals to some hours life time in this app. Will the potentiometer part still work properly after the EEPROM is gone ? |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Fri Mar 18, 2016 10:43 am Post subject:
|
 |
|
My Noise Generator has a built-in filter, the same as I'm planning to build as a (dual) VCF. I have two outputs on the noise generator, one going from 0 to +5 volt and one output ground referenced.
It's easy to just remove the AC output.
For opamps I use the Texas Instruments LM6132 which is great in R2R performance.
And as far as input protection goes: that is unnecessary if I stay between 0 and 5 volts.
But thank you for your advices! |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Fri Mar 18, 2016 10:52 am Post subject:
Re: Quad vca (actually quad potmeters... Subject description: Just a wild idea, or not? |
 |
|
elektrouwe wrote: | Grumble wrote: | ... midi has 128 and nobody is complaining.... |
I am complaining !
you will get linear steps, that means eg a 6dB step between control value 1 and 2 and almost no change between 254 and 255.
I would use a load resistor of 12k from wiper to GND to get a pseudo log response and then buffer with an opamp. See
http://sound.westhost.com/project01.htm
The EEPROM can stand about 10e6 amplitude step actions, which equals to some hours life time in this app. Will the potentiometer part still work properly after the EEPROM is gone ? |
The difference between step 1 and 2 is the same as between step 254 and 255, you will only hear it differently
These digital controlled potmeters may be programmed to make 6dB steps, but then there are only 16 possible steps.
The EEPROM is used to store a value to which the potmeters will go after power up (or reset), but I don't use the EEPROM. Besides that the potmeter will function just the sane without the EEPROM.
Good idea about the pseudo log resistor thinghy. Maybe I'll add a switch to choose between lin and (pseudo) log, since I have to use an opamp anyways. |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Thu Mar 24, 2016 2:35 am Post subject:
|
 |
|
FAIL
Works fine for control voltages and the lin/log switch works just fine (so not all is lost), but since my musical signals are all around +2.5volt you can hear the speakers pumping with the ADSR voltage.
What I have to do is first have the signals at the input feed thru a capacitor to have the signals around gnd level and after attenuation add 2.5 volt.
Also the input connectors are crappy chinese types, and the switch inside the connector is just lame, so have to work around that too.
So, back to the drawing board....
to be continued... |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Tue Apr 12, 2016 7:49 am Post subject:
|
 |
|
It got a lot more complicated....
But it works like a charm  |
|
Back to top
|
|
 |
Cfish

Joined: Feb 24, 2016 Posts: 477 Location: Indiana
|
Posted: Tue Apr 12, 2016 5:51 pm Post subject:
|
 |
|
Congratulations. I would love to see the final schematic. |
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
|
Back to top
|
|
 |
Grumble

Joined: Nov 23, 2015 Posts: 1310 Location: Netherlands
Audio files: 30
|
Posted: Tue Apr 12, 2016 11:24 pm Post subject:
|
 |
|
The program is quite simple: it just reads the four control voltages (or pots) at the input and returns the value to the digital controlled pots.
This is not a .ino file (for Arduino) because all the programming i do is with Atmel Studio
/*
* quad_dig_pot.cpp
*
* Created: 13-3-2016 15:39:47
* Author : Ed
*/
#define F_CPU 16000000L
#include <stdint>
#include <avr>
#include <avr>
#include <util>
#include <stdlib>
#define AD5144_INPUT_REG 0x20
#define AD5144_UPDATE_REG 0x10
#define AD5144_TO_RDACREG 0x60
#define AD5144_RESET 0xB0
#define AD5144_NORMAL_MODE 0x98
#define AD5144_TOPSCALE 0x80
#define AD5144_DONTCARE 0xFF
#define AD5144_0_CS_HIGH PORTB |= (1<<PB0)
#define AD5144_0_CS_LOW PORTB &= ~(1<<PB0)
volatile uint8_t potmeter,data_value;
void init (void)
{
//disable watchdog if enabled
MCUSR=0;
WDTCSR|=(_BV(WDCE) | _BV(WDE));
WDTCSR=0;
DDRB = (1<<DDB0)|(1<<DDB3)|(1<<DDB5);
// PB5 (SCK) = Out
// PB3 (MOSI) = Out
// PB0 (~CS) = Out
// SPI-Init
SPCR = (1<<SPE) // SPI enable
|(1<<MSTR) //master mode
|(0<<CPOL) //setup rising
|(1<<CPHA) //sample falling
|(0<<SPR0); //fosc x 1
// init the ADC
ADCSRA |= ((1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)); //Prescaler at 128 so we have an 125Khz clock source
ADMUX |= (1<<REFS0); //Avcc(+5v) as voltage reference
ADCSRA |= (1<<ADEN); //Power up the ADC
ADCSRA |= (1<<ADSC> SPI start
SPDR = AD5144_RESET; // software reset
while ( !(SPSR & (1<<SPIF))) {}; // ready?
SPDR = AD5144_DONTCARE; // send 0xFF
while ( !(SPSR & (1<<SPIF> stop SPI
//and put them in normal mode
AD5144_0_CS_LOW; // AD5144 --> SPI start
SPDR = AD5144_NORMAL_MODE; // send 0x98
while ( !(SPSR & (1<<SPIF))) {}; // ready?
SPDR = AD5144_TOPSCALE; // send 0x80
while ( !(SPSR & (1<<SPIF> stop SPI
}
void AD5144_0_write(uint8_t data_value, uint8_t potmeter)
{
//write the data in the assigned potmeter (0-3)
AD5144_0_CS_LOW; // AD5144 --> SPI start
SPDR = (AD5144_UPDATE_REG|potmeter); // send 0x10 | potmeter
while ( !(SPSR & (1<<SPIF))) {}; // ready?
SPDR = data_value; // send high Byte
while ( !(SPSR & (1<<SPIF> stop SPI
//write the data in the assigned potmeter (0-3)
AD5144_0_CS_LOW; // AD5144 --> SPI start
SPDR = (AD5144_TO_RDACREG|potmeter); // send 0x60 | potmeter
while ( !(SPSR & (1<<SPIF))) {}; // ready?
SPDR = data_value; // send high Byte
while ( !(SPSR & (1<<SPIF> stop SPI
}
uint8_t read_adc_8bit (uint8_t chan_num)
{
uint8_t _8bit_;
ADMUX &= 0xF0; // Clear the older channel that was read
ADMUX |= ((chan_num)|(1<<ADLAR)); // Defines the new ADC channel to be read, left adjusted
ADCSRA |= (1<<ADSC); // Starts a new conversion
while(ADCSRA & (1<<ADSC)); // Wait until the conversion is done
_8bit_ = ADCH;
return _8bit_;
}
int main(void)
{
init();
reset();
_delay_ms(1);
AD5144_0_write(0x00, 0x08);
while (1)
{
for (potmeter = 0; potmeter < 4; potmeter++)
{
data_value=read_adc_8bit(potmeter);
AD5144_0_write(data_value, potmeter);
}
}
}
//datasheet quad potmeter: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5124_5144_5144A.pdf |
|
Back to top
|
|
 |
Cfish

Joined: Feb 24, 2016 Posts: 477 Location: Indiana
|
Posted: Wed Apr 13, 2016 4:56 pm Post subject:
|
 |
|
Very nice. |
|
Back to top
|
|
 |
|