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 » Arduino
Arduino to control linear VCA (2164 for instance)
Post new topic   Reply to topic
Page 1 of 1 [14 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
cslammy



Joined: Apr 27, 2018
Posts: 206
Location: USA
Audio files: 1

PostPosted: Fri Dec 14, 2018 8:04 am    Post subject: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

I hope this makes sense to someone.

To do this, I assume I can use a linear signal from the Arduino.

for (a = 1024; a--; a > 0)
{
//send a to a PWM and filter the PWM into CV.
}

This will sound OK right?

Volume goes from -100db to 0db. So it attenuates. And doesn't sound like it gets loud too fast or too slow--so , it doesn't sound like you have a lin/expo mismatch if you hooked RC right up to CV in of the 2164.

My Thinking:
The input of the 2164 is linear.
The output of a counter above is linear.

So there is no expo/linear issues, the type you'd need to solve with an Irwin circuit.


True? False? Does this make any sense?


My goal is to easily control a 2164 from a Nano and not have it sound completely crappy.

(NB: I know yiou have to get to -CV to get the thing to amplify. Attenuate only is good for now.)

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
ixtern



Joined: Jun 25, 2018
Posts: 145
Location: Poland

PostPosted: Thu Dec 20, 2018 6:55 am    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

cslammy wrote:
I hope this makes sense to someone.

To do this, I assume I can use a linear signal from the Arduino.

for (a = 1024; a--; a > 0)
{
//send a to a PWM and filter the PWM into CV.
}

This will sound OK right?

Volume goes from -100db to 0db. So it attenuates. And doesn't sound like it gets loud too fast or too slow--so , it doesn't sound like you have a lin/expo mismatch if you hooked RC right up to CV in of the 2164.

My Thinking:
The input of the 2164 is linear.
The output of a counter above is linear.

So there is no expo/linear issues, the type you'd need to solve with an Irwin circuit.


True? False? Does this make any sense?


My goal is to easily control a 2164 from a Nano and not have it sound completely crappy.

(NB: I know yiou have to get to -CV to get the thing to amplify. Attenuate only is good for now.)


The problem with PWM is that: if you want ho have good filtered voltage after it you must filter it heavily - then it it slow. If you filter it for a fast transitions - PWM signal will bleed through VCA.

I would stay with a cheap I2C/SPI/paralell DAC for this.
Back to top
View user's profile Send private message
cslammy



Joined: Apr 27, 2018
Posts: 206
Location: USA
Audio files: 1

PostPosted: Thu Dec 20, 2018 9:52 am    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

ixtern wrote:
The problem with PWM is that: if you want ho have good filtered voltage after it you must filter it heavily - then it it slow. If you filter it for a fast transitions - PWM signal will bleed through VCA.

I would stay with a cheap I2C/SPI/paralell DAC for this.


Hi IX: I agree and I figure I will do that. Getting 4 DACS going w 4725's is a bit of a pain but certainly doable.

Q: Do you know if the code to ramp up/down the 2164 VCA, THAT 340, etc., and have it "sound normal" is linear? So, no RC type expo curve?

I figure it is linear. It must be right? Since you have to Irwin-ize the 2164 if you use RC.

I have a lot to do on the bench and I'll run some test sketches and find out, but I figure someone out there will just know.

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
ixtern



Joined: Jun 25, 2018
Posts: 145
Location: Poland

PostPosted: Thu Dec 20, 2018 1:32 pm    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

cslammy wrote:
ixtern wrote:
The problem with PWM is that: if you want ho have good filtered voltage after it you must filter it heavily - then it it slow. If you filter it for a fast transitions - PWM signal will bleed through VCA.

I would stay with a cheap I2C/SPI/paralell DAC for this.


Hi IX: I agree and I figure I will do that. Getting 4 DACS going w 4725's is a bit of a pain but certainly doable.

Q: Do you know if the code to ramp up/down the 2164 VCA, THAT 340, etc., and have it "sound normal" is linear? So, no RC type expo curve?

I figure it is linear. It must be right? Since you have to Irwin-ize the 2164 if you use RC.

I have a lot to do on the bench and I'll run some test sketches and find out, but I figure someone out there will just know.

As usual volume control is in dB and 2164 control is also in dB (Gain Constant = –33 mV/dB from datasheet) means control input is linear but output volume is logarithmic rather), there should be no problem.
Back to top
View user's profile Send private message
cslammy



Joined: Apr 27, 2018
Posts: 206
Location: USA
Audio files: 1

PostPosted: Thu Dec 20, 2018 1:39 pm    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

ixtern wrote:

As usual volume control is in dB and 2164 control is also in dB (Gain Constant = –33 mV/dB from datasheet) means control input is linear but output volume is logarithmic rather), there should be no problem.


That's how I am reading it as well

One thing about the 2164: more volts = more attenuation, with 0V equals unity gain. So I'd need the Arduino to supply negative CV at -.33mV per DB, otherwise each VCA in the 2164 will only attenuate. the D to A can't easily produce neg CV relative to ground. I must use an op amp w DC offset to get that.

THAT VCA's ameliorate by allowing negative CV = more gain as well as positive CV = more gain. So in spite of having a whole tube of NOS 2164's I am probably going that route instead.

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
ixtern



Joined: Jun 25, 2018
Posts: 145
Location: Poland

PostPosted: Thu Dec 20, 2018 1:53 pm    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

cslammy wrote:
ixtern wrote:

As usual volume control is in dB and 2164 control is also in dB (Gain Constant = –33 mV/dB from datasheet) means control input is linear but output volume is logarithmic rather), there should be no problem.


That's how I am reading it as well

One thing about the 2164: more volts = more attenuation, with 0V equals unity gain. So I'd need the Arduino to supply negative CV at -.33mV per DB, otherwise each VCA in the 2164 will only attenuate. the D to A can't easily produce neg CV relative to ground. I must use an op amp w DC offset to get that.

THAT VCA's ameliorate by allowing negative CV = more gain as well as positive CV = more gain. So in spite of having a whole tube of NOS 2164's I am probably going that route instead.

You must use op amp at the output so adding another at input should be no problem. If you don't like negatives there is a single-supply example in datasheet also but op amp for voltage level shifting is needed also.
Back to top
View user's profile Send private message
cslammy



Joined: Apr 27, 2018
Posts: 206
Location: USA
Audio files: 1

PostPosted: Thu Dec 20, 2018 2:01 pm    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

ixtern wrote:

You must use op amp at the output so adding another at input should be no problem.


Sorry not sure what you mean by "at the output" At the audio output of the 2164 right?

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
ixtern



Joined: Jun 25, 2018
Posts: 145
Location: Poland

PostPosted: Fri Dec 21, 2018 12:29 am    Post subject: Re: Arduino to control linear VCA (2164 for instance) Reply with quote  Mark this post and the followings unread

cslammy wrote:
ixtern wrote:

You must use op amp at the output so adding another at input should be no problem.


Sorry not sure what you mean by "at the output" At the audio output of the 2164 right?

Yes, as 2164 has current output you must use op amp to convert it to output voltage. Of course, single resistor is also current to voltage converter but op amp for buffering is still needed.
Back to top
View user's profile Send private message
Grumble



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

PostPosted: Sat Dec 22, 2018 4:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

You might want to use the Analog Devices AD5754 a quad 16 bit DAC where the nominal full-scale output range is software-selectable from +5 V, +10 V, +10.8 V, ±5 V, ±10 V, or ±10.8 V.
10.8 volt is very handy because it covers the full 128 midi notes being 10 octave + 8 notes at 1 volt/oct.

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
ixtern



Joined: Jun 25, 2018
Posts: 145
Location: Poland

PostPosted: Sun Dec 23, 2018 3:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Grumble wrote:
You might want to use the Analog Devices AD5754 a quad 16 bit DAC where the nominal full-scale output range is software-selectable from +5 V, +10 V, +10.8 V, ±5 V, ±10 V, or ±10.8 V.
10.8 volt is very handy because it covers the full 128 midi notes being 10 octave + 8 notes at 1 volt/oct.

Yes, it's very handy DAC but try to recomment something little cheaper like MCP4725 Smile.
Back to top
View user's profile Send private message
Grumble



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

PostPosted: Sun Dec 23, 2018 8:57 am    Post subject: Reply with quote  Mark this post and the followings unread

I wouldn’t know about prices because I am in the sample program of Analog Devices and get samples for free Very Happy
_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
cslammy



Joined: Apr 27, 2018
Posts: 206
Location: USA
Audio files: 1

PostPosted: Wed Dec 26, 2018 4:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

Grumble wrote:

You might want to use the Analog Devices AD5754




Thanks grumble, great Grumblechip as always, but perhaps overkill for this one Very Happy

Some day soon I am going to start bugging you about all your C programming kung fu…still have a few more projects on the bench trying to get finished but REAL soon....

And yes I get samples from AD as well. It's a good learning experience. I hope someday I will sell some of their goods (acquired wholesale of course!) in products I design.

ixtern wrote:

Yes, it's very handy DAC but try to recomment something little cheaper like MCP4725 Smile.


ixtern: I know MCP4725, but breakout boards for it (adafruit, no name clones) generally only allow 1 to 2 addresses without surgery? We need 4 here.

So--Looking at MCP4728: http://microchipdeveloper.com/dac:mcp4728-quad-channel-12-bit-digital-to-analog-converter

I see some libraries online for arduino and this. I2C so pretty easy to get going i figure. Also pretty inexpensive at $1.45 a chip USD.

From the datasheet, easy to set up hardware wise....A chance for me to work with MSOP for the first time.

So maybe I'll go with that. Man, too little time, too many projects.

Thanks all.

_________________
Visit my AUDIODIWHY blog and website

Last edited by cslammy on Thu Dec 27, 2018 6:49 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Grumble



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

PostPosted: Thu Dec 27, 2018 5:39 am    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
And yes I get samples from AD as well. Maybe some day I will sell some of their stuff? Wink

Hope they don’t read this or they never send you a sample again, you placed an autogram for this telling you will never resell samples Rolling Eyes

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
cslammy



Joined: Apr 27, 2018
Posts: 206
Location: USA
Audio files: 1

PostPosted: Thu Dec 27, 2018 6:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Grumble wrote:
Quote:
And yes I get samples from AD as well. Maybe some day I will sell some of their stuff? Wink

Hope they don’t read this or they never send you a sample again, you placed an autogram for this telling you will never resell samples Rolling Eyes


No not at all what I meant. I mean, someday, I will learn enough about their products and engineering that I will design something using their goods that I can sell through an engineering firm in bulk with goods acquired wholesale. Like, create a product that everyone can benefit from. But I can see how this statement can be misunderstood. I will edit my statement. Thanks.

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1 [14 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 » Arduino
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