electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
Quad vca (actually quad potmeters...
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [24 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Sun Mar 13, 2016 10:41 am    Post subject: Quad vca (actually quad potmeters...
Subject description: Just a wild idea, or not?
Reply with quote  Mark this post and the followings unread

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


IMG_20160313_191543.jpg
 Description:
Speed = 2mS/div
 Filesize:  4.39 MB
 Viewed:  406 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_20160313_191543.jpg



quad_pot.JPG
 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.

quad_pot.JPG


Back to top
View user's profile Send private message Visit poster's website
Cfish



Joined: Feb 24, 2016
Posts: 477
Location: Indiana

PostPosted: Wed Mar 16, 2016 7:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Wed Mar 16, 2016 10:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Cfish



Joined: Feb 24, 2016
Posts: 477
Location: Indiana

PostPosted: Thu Mar 17, 2016 8:35 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Thu Mar 17, 2016 10:29 am    Post subject: Reply with quote  Mark this post and the followings unread

If you look at the photo in the post above, you can see that this is not really a problem if I use the ADSR generator since the fastest attack time is about 2 mSec and that is just enough to get rid of the fast switching peak you might get when switching in the middle of a peak from the audio signal.
It gets different if I use a gate signal as a ADSR input (which is possible).
I added a picture where I do just that, to show how fast the reaction of this "VCA" actually is.
Again 2mSec/div.


IMG_20160317_182352.jpg
 Description:
 Filesize:  4.01 MB
 Viewed:  392 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_20160317_182352.jpg


Back to top
View user's profile Send private message Visit poster's website
Cfish



Joined: Feb 24, 2016
Posts: 477
Location: Indiana

PostPosted: Thu Mar 17, 2016 10:46 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks Grumble you have done a nice job on this.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5810
Location: Moon Base
Audio files: 709

PostPosted: Thu Mar 17, 2016 12:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Looks pretty good. A bit limited in voltage range for standard synth use, but since you need to buffer it anyway that
can easily be adjusted. Could also be very useful for adding (voltage) control to other existing devices, instead of using a vactrol.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Thu Mar 17, 2016 1:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

This evening I have been digging in the datasheet of the AD5144 and it appeared to me that I have made a mistake: The datasheet says that the max voltage for VDD is 7 volts and the VSS is max -7 volts.
So I thought thats ok, because I'm using just +5 to -5 volts.
But then a little lower the datasheet states that Vdd to Vss is 7 volt max!
Bummer! Because now I have to make sure all voltages are at DC levell...


ratings.jpg
 Description:
A little confusing to say the least...
 Filesize:  46.61 KB
 Viewed:  15215 Time(s)

ratings.jpg


Back to top
View user's profile Send private message Visit poster's website
AlanP



Joined: Mar 11, 2014
Posts: 746
Location: New Zealand
Audio files: 41

PostPosted: Thu Mar 17, 2016 10:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

Bummer Sad

What kind of input protection are you going to use (or does the AD device have it already?)
Back to top
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Thu Mar 17, 2016 10:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5810
Location: Moon Base
Audio files: 709

PostPosted: Fri Mar 18, 2016 3:44 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Fri Mar 18, 2016 4:06 am    Post subject: Reply with quote  Mark this post and the followings unread

At this point in my design all voltages are between 0 and +5 volts (except one output of the noise generator...) Rolling Eyes
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
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5810
Location: Moon Base
Audio files: 709

PostPosted: Fri Mar 18, 2016 7:43 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
elektrouwe



Joined: May 27, 2012
Posts: 146
Location: Germany

PostPosted: Fri Mar 18, 2016 9:48 am    Post subject: Re: Quad vca (actually quad potmeters...
Subject description: Just a wild idea, or not?
Reply with quote  Mark this post and the followings unread

Grumble wrote:
... midi has 128 and nobody is complaining....

I am complaining ! Smile
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
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Fri Mar 18, 2016 10:43 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Fri Mar 18, 2016 10:52 am    Post subject: Re: Quad vca (actually quad potmeters...
Subject description: Just a wild idea, or not?
Reply with quote  Mark this post and the followings unread

elektrouwe wrote:
Grumble wrote:
... midi has 128 and nobody is complaining....

I am complaining ! Smile
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 Wink
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
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Wed Mar 23, 2016 12:55 am    Post subject: Reply with quote  Mark this post and the followings unread

The board is finished (see THIS LINK for pictures).
So now I only need two more "regular" devices, a VCF and a MIXER (mono or stereo with pan, and how many inputs?) to start working on more exotic modules Rolling Eyes
I have lots on nice ideas Idea Idea Idea
Oh...and multiples, and a connection for the scope... Oh... and there is already a half built sequencer.... Shocked
This evening I will try to make some recordings with this 4VCAt.


schematics 4VCAt.JPG
 Description:
Updated diagram
 Filesize:  89.15 KB
 Viewed:  248 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

schematics 4VCAt.JPG


Back to top
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Thu Mar 24, 2016 2:35 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Thu Apr 07, 2016 1:24 am    Post subject: Reply with quote  Mark this post and the followings unread

I have changed the schematics, added some opamps, and now it works great!


adsr.jpg
 Description:
scope settings: 5 msec/div and 2 v/div
 Filesize:  2.12 MB
 Viewed:  214 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

adsr.jpg


Back to top
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Tue Apr 12, 2016 7:49 am    Post subject: Reply with quote  Mark this post and the followings unread

It got a lot more complicated....
But it works like a charm Very Happy
Back to top
View user's profile Send private message Visit poster's website
Cfish



Joined: Feb 24, 2016
Posts: 477
Location: Indiana

PostPosted: Tue Apr 12, 2016 5:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Congratulations. I would love to see the final schematic.
Back to top
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Tue Apr 12, 2016 9:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

The signals are now AC (around 0volt) so this module is now dedicated to audio signals only for now, but I could change that by adding a voltage to the output and maybe I will...


current schematic 4VAC.JPG
 Description:
 Filesize:  94.83 KB
 Viewed:  285 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

current schematic 4VAC.JPG


Back to top
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Tue Apr 12, 2016 11:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Cfish



Joined: Feb 24, 2016
Posts: 477
Location: Indiana

PostPosted: Wed Apr 13, 2016 4:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Very nice.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [24 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use