[sdiy] Modulated ADSR Generator

Tom Wiltshire tom at electricdruid.net
Sun Jul 10 19:12:00 CEST 2011


On 10 Jul 2011, at 02:17, Matthew Smith wrote:

> Quoth Dave Manley at 10/07/11 02:44...
>> This is what I intended for the CV input - scale all times together.
>> One obvious use: keyboard CV affects overall envelope time, which
>> mimic many instruments - high notes decay faster.  You don't have to
>> sample the CV often, only at the trigger event, or only at each segment
>> start.
> 
> Aha! That's good news. The lower the sample rate, the better. Not that I'm really worried about jitter in an application like this, even when in LFO mode, but the less that's going on at any given time, the better.

That's true, but sampling the CV more frequently allows you to 'bend' the curves with modulation. The Modcan AHDBDSR that I worked on does this - but it uses a 16-bit processor to generate *one* envelope! The sample rate is 48KHz or so IIRC, and the CV inputs can accept signals nearly that high too - it'll do some crazy stuff, even looping envelopes fast enough to become audio, with shape modulation. With careful tuning you can get about two octaves of pitch out of it and play a bassline!
The PIC ADSRs I did sample the CV inputs at about 6KHz, which is fast enough for even pretty fast modulation to be usable. I've backed off on what I think is a required rate for this in recent times. Even 1KHz is good enough for most things.

Sampling only at the trigger event and at segment starts is a damn good way to save a lot of messing about though. You mostly won't miss what you lose, and the time gains might more than make up for it if you can squeeze other stuff in instead. It's a judgement call ultimately. I've tried both ends of the spectrum (cheap and cheerful 16F PICs and full-tilt, all bells and whistles 16-bit dsPIC AHDBDSRs) and they both have their place.

>> Will you support inverted envelopes?
> 
> If it would be useful.

Dead easy to do in software, if you can cope with the offset. If you invert with an op-amp, a 0 to 5V envelope become a 0 to -5V envelope. If you do it in software, it becomes a 5V to 0V envelope. Which is sometimes good too.

> 
> At this stage, the important thing is to make sure all the hardware that might be needed will be there.  Think I'll be going for two pots and two CVs - possibly with switchable pull-up resistors on the CV inputs so that they can also be used as footswitch inputs. (I'd do this by routing the analogue inputs back to spare IO pins, via a 10k resistor. In "normal" mode, the IO pins would be configured as inputs (high Z,) then switchable to outputs at logic 1 for when a switch is required.)
> 
> Trigger and gate signals to be opto-isolated with socketed DIP isolators for easy replacement when they get fried. (Will probably be the only non-SMD components, barring connectors.)

This seems like overkill. I've always just used a transistor to buffer the input (resistor pulls input high, transistor switches input low, resistor on base protects transistor). This works very well. I was worried that it might need a significant voltage to make it switch on, but it'll trigger correctly down to 1V with a 2N3906 and 10K. I've tested it with voltages up to 15V or so and it's fine. I think there's headroom up to 25V or so before you reach the limit of what the transistor can handle - I can't remember exactly, it was a while ago. And if it *did* fail, you killed one transistor worth pennies.

> Get the hardware right, and the rest is all a matter of firmware.

That's the dream!

> With the DCO I'm working on producing three simultaneous outputs (fundamental, -1 8ve, -2 8ve,) I'd like to be able to have them with their own envelopes.

Now *that* sounds cool!

Good luck with it,
Tom




More information about the Synth-diy mailing list