[sdiy] Soft ADSR ways?

Tom Wiltshire tom at electricdruid.net
Mon Feb 14 12:17:20 CET 2011


On 14 Feb 2011, at 05:04, David G. Dixon wrote:

>> I'm suprised nobody is using a hybid approach to this..
>> after all, the micro has output pins that are begging to be toggled to
>> charge & discharge caps -
>> and one could monitor these with an AtoD input.
>> I think you could keep the digital in & out, but pass the heavy
>> calculating
>> to the 'analog' side.
>> Depending how you want to throw it into the rest of the system.
> 
> I was thinking exactly the same thing.  Use an RC network to make the
> envelope sections (with optional switching between linear and exponential).
> One could use digital PWM to determine the effective resistance of the RC
> resistor (see pg. 178 et seq. and Fig. 4-23 of the TTL Cookbook by Don
> Lancaster for inspiration).  If the resistor is switched in and out of the
> circuit by a clock, and the time it spends in the circuit is dictated by the
> variable PW of the clock signal, then the effective resistance (and hence
> the delay time) will be proportional to the PW of the gate.  Eight bits of
> PWM would give 256 different delay times, and the exponential character of
> the delay would be achieved naturally, in analog.
> 

One good reason not to is that you finish up with an analogue output...No, seriously, hear me out!
If you're building a polysynth voice with a couple of ADSRs and an LFO or two, plus CVs for velocity, pitch, pitch bend, mod wheel etc coming from MIDI, it makes much more sense to keep all the modulations in the digital domain and do the mod matrix there. You can output the final CVs (typically filter freq, resonance, pan and VCA level) to analogue once they're all mixed. Otherwise you finish up with many more analogue signals, and you need switching and probably VCAs for them too. It makes a *lot* more circuit. Jürgen Michaelis reckoned that fully half the voice board of the Jomox Sunsyn was given over to the modulation routing.

Otherwise, it _is_ something I've wondered about. Some of the dsPICs include comparators that will generate an interrupt. These would be ideal for detecting when the Attack stage had finished and the envelope needed to switch stage. But it makes more hardware, which isn't usually the direction I'm trying to go in.

Finally, if the reason for wanting to do it is to avoid doing two additions and two multiplies in code, you'd be *much* better off either writing it in C where the maths is easier, or precalculating the results in Excel/Octave/Perl/PHP/Whatever and sticking a lookup table in. Honestly. Don't do maths on a 8-bit processor, its not what they're for. ;)

T.






More information about the Synth-diy mailing list