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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
A CMOS based ADSR
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [16 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Wed Jan 07, 2015 9:17 am    Post subject: A CMOS based ADSR Reply with quote  Mark this post and the followings unread

So I don't know if this is strictly Lunetta but it is entirely CMOS based so it seems like this would be the right place to ask.

I an a neophyte when it comes to all of this but I've been thinking about how to do a ADSR circuit without using Opamps or transistors or other things that I don't understand and I think I roughly have it and want to see what people think.

At it's most basic level you have an oscillator outputting at the audio frequency you want which will act as the gate/switch on a 4066, the signal being lat through the gate would be the output from the ADSR.

The ADSR would be created by using an up/down counter with an enable pin. 4 flip flops to store what state we are in, some magic to set the sustain level , a bunch of basic gates to wire them together, some oscillators to set the rate of the A,D&R phases, and a push button to trigger the envelope.

On pressing the button the Attack FlipFlop would set and all other FlipFlops would reset, and the counter would be enabled and start counting up using the Attack Oscillator as the clock source. When it hits max that resets the Attack Flip Flop and sets the Decay Flip Flop, which starts the counter counting down using the decay clock source. Once the counter hits the sustain value (which has been set by magic - maybe a set of switches, or a potentiometer fed into a ADC or something the magic is messy but not important) that resets the Decay Flip-Flop, sets the Sustain Flip-Flop which disables the counter keeping the output at the same level.

At anytime, when the switch is released that resets all flip-flops and sets the Release flip-flop to high which starts the counter counting down to zero using the Release oscillator as its clock.

Does this sound reasonable and non-stupid?

I was thinking the counter outputs (which is the output of the ADSR envelope) would be fed into a priority encoder to give a curve to the rise and fall so it wouldn't be strictly linear.
Back to top
View user's profile Send private message
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Wed Jan 07, 2015 11:18 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Alistair, if it is fun, makes sound, and contains CMOS it can be considered Lunetta Smile What you describe makes sense and probably could be done. But I don't think that it is the easiest approach.

First, you need some "vent" to control the output level. A 4066 analog switch is either on or off. You cannot control what goes through it easily. You could drive it with a high frequency in PWM mode, but you would need to filter the result later. See Figure 11 - Conceptual PWM VCA at http://sound.westhost.com/articles/vca-techniques.html

Second, the ADSR curves. Unless you are looking for ultimate precision, I believe that it will be much easier to generate the curves in an analog way rather than using digital counters. Typically you will see the load/unload process of a capacitor being used for that. Those curves aren't strictly linear by nature.

If you want a simple design, I suggest that you look for ADSR generators using a 555 timer in this forum and on the net. For example, this AD/AR envelope generator here http://electro-music.com/forum/topic-57015.html&postorder=asc&highlight=envelope&start=25

Don't let my opinion discourage you to try it your way. It can be done in a digital way, and I already did it using an FPGA, but only because I couldn't add analog parts. The "analog" way isn't that difficult and I guess much easier in this case.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 07, 2015 2:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome party!

One thing that's not fully clear is how it creates the ADSR voltage. Do you want to add a DAC/resistor network to the priority encoder ?

synaesthesia wrote:
First, you need some "vent" to control the output level. A 4066 analog switch is either on or off. You cannot control what goes through it easily.

I think the idea is to use it in reverse so to speak. Instead of having the audio level controlled by the switch you're controlling
the switch with the audio. a varying voltage on the input of the switch will create the audio signal with that voltage as amplitude at the output.
It's a similar approach to using a single diode and resistor to create a VCA.

_________________
"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
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Wed Jan 07, 2015 2:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

Right, didn't see the idea to run it in reverse. Wouldn't much of the signal be lost then? If you happen to have one, an example circuit for this concept would help.
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Wed Jan 07, 2015 3:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
welcome party!

One thing that's not fully clear is how it creates the ADSR voltage. Do you want to add a DAC/resistor network to the priority encoder ?


Not completely decided on that yet. I do have a DAC coming in my chip order which I could use (somehow that seems like cheating to me though) or a resistor network connected to a 4051 kind of like the envelope generator in the fun with sea moss page ( http://milkcrate.com.au/_other/sea-moss/#amp ). So I'd only be getting 8 volume levels but that is good enough for me.

PHOBoS wrote:

synaesthesia wrote:
First, you need some "vent" to control the output level. A 4066 analog switch is either on or off. You cannot control what goes through it easily.

I think the idea is to use it in reverse so to speak. Instead of having the audio level controlled by the switch you're controlling
the switch with the audio. a varying voltage on the input of the switch will create the audio signal with that voltage as amplitude at the output.
It's a similar approach to using a single diode and resistor to create a VCA.


Yeah, exactly the switch is controlled by the digital audio signal and the analogue output from the ADSR is what is being switched on and off which will give an amplitude to a square wave coming out of the 4066.

On another thought about ADC and DAC, what kind of tolerances do the cheap ADC/DAC chips have? would there be muchf play in feeding the result of a DAC into a ADC and then back to the DAC, would it cause the outputs to jump around in an intersting fashion?
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Wed Jan 07, 2015 3:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

synaesthesia wrote:
Right, didn't see the idea to run it in reverse. Wouldn't much of the signal be lost then?



Probably, as I said I am a total beginner when it comes to circuit design, I have forgotten all of my analogue electronic classes from 18 years ago.

synaesthesia wrote:

If you happen to have one, an example circuit for this concept would help.


First I'll need to buy the chips! What is the software that people use to draw he nice diagrams? I could at least lay out what I am thinking to make it clear.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 07, 2015 3:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

synaesthesia wrote:
Right, didn't see the idea to run it in reverse. Wouldn't much of the signal be lost then? If you happen to have one, an example circuit for this concept would help.

ok, drew one. (I'm using ExpressSCH btw)
I did see it before probably somewhere on this forum.


4066VCA.gif
 Description:
 Filesize:  13.65 KB
 Viewed:  405 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4066VCA.gif



_________________
"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
PHOBoS



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 07, 2015 3:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

AlistairJHutton wrote:
On another thought about ADC and DAC, what kind of tolerances do the cheap ADC/DAC chips have? would there be muchf play in feeding the result of a DAC into a ADC and then back to the DAC, would it cause the outputs to jump around in an intersting fashion?

just connecting them doesn't cause much interesting effects no idea about creating a feedback loop that might be fun.
But you can change the sample rate, the bit depth and randomize bits or insert random bits.
I was planning on doing something like that but I used the ADC I had for a random generator.

_________________
"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
commathe



Joined: Jul 26, 2013
Posts: 153
Location: Beijing
Audio files: 5

PostPosted: Wed Jan 07, 2015 9:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hey Alistair, I have nothing constructive to add except that I'm from Edinburgh too! Auld Reekie represent!
Back to top
View user's profile Send private message
brock



Joined: May 26, 2011
Posts: 112
Location: Canada

PostPosted: Wed Jan 07, 2015 10:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

There was a discussion about a similar EG/VCA solution a long time ago...http://electro-music.com/forum/topic-23960.html, 2 diode or cmos switch vca.
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Thu Jan 08, 2015 10:40 am    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
AlistairJHutton wrote:
On another thought about ADC and DAC, what kind of tolerances do the cheap ADC/DAC chips have? would there be muchf play in feeding the result of a DAC into a ADC and then back to the DAC, would it cause the outputs to jump around in an intersting fashion?

just connecting them doesn't cause much interesting effects no idea about creating a feedback loop that might be fun.
But you can change the sample rate, the bit depth and randomize bits or insert random bits.
I was planning on doing something like that but I used the ADC I had for a random generator.


Thinking about ADC a bit more, I've only been considering parallel output ADC chips - but the serial out chips - like this one http://www.farnell.com/datasheets/1836396.pdf - are considerably cheaper and it's output (for a given fixed analogue input) would be a nice stream of repeating 8 steps. All the fun of an 8 step sequencer with just 1 chip and a pot. Err and a clock for the ADC chip as well I suppose ut if you already have an oscillator to synch beats elsewhere it can go int the ADC anyways.
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Fri Jan 09, 2015 12:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, I've put in my order for the chips so hopefully we'll be able to hear how it sounds soon.
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Mon Jan 12, 2015 6:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Parcel has arrived.
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Tue Jan 13, 2015 4:39 am    Post subject: Reply with quote  Mark this post and the followings unread

I have made a LED blink at 0.83333 Hz. Nothing blew up. I think I've got the hang of this.
Back to top
View user's profile Send private message
AlistairJHutton



Joined: Jan 07, 2015
Posts: 8
Location: Edinburgh

PostPosted: Wed Jan 14, 2015 5:35 am    Post subject: Reply with quote  Mark this post and the followings unread

And now I have sound coming out of a speaker. This is fun. Although I need ot get a lot better at reading resistor values.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Wed Jan 14, 2015 6:01 am    Post subject: Reply with quote  Mark this post and the followings unread

Very Happy

Reading resistor values is a matter of doing it a lot. It's like reading text, at first you have to spell out the words
letter for letter but at some point you'll just recognize the whole word.

_________________
"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
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [16 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 » Lunettas - circuits inspired by Stanley Lunetta
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