[Fpga-synth] Envelope - linear attack & expo decay/release?

Scott Gravenhorst music.maker at gte.net
Sat Apr 4 22:32:56 CEST 2009


"The making of synthesizers in FPGAs." wrote:
>Scott Gravenhorst skrev:
>> Eric B. wrote:
>>> Here's a philosophical question:
>>>
>>> Last weekend I built an ADSR for my ARM/FPGA synth and it seems to work 
>>> fine. The thing that's bugging me is that I used linear calculations for 
>>> the gain, so when doing a long release that last little tail seems to 
>>> cut off rather abruptly.
>>>
>>> The obvious solution is to use exponential decay for the release. I know 
>>> how I'd implement that in hardware (scale the difference between where 
>>> you are and where you're going by some constant related to the rate & 
>>> add to current state). Question is, is the exponential curve also 
>>> appropriate for the attack & decay phases?
>>>
>>> The ultimate envelope would seem to be one with the option for 
>>> log/lin/expo curve on each segment, along with variable rate & target. 
>>> You'd need three parameters to define every segment. Probably too 
>>> complex, but certainly flexible.
>>>
>>> Thoughts? What have you tried in the past?
>>>
>>> Eric
>> 
>> I went back to my GateMan synths and they are linear only ADSRs.  They have the same
>> "problem" that Eric describes.
>> 
>> My question is: What envelope shapes are most useful?
>> 
>> How much does it matter that A and D are expo?
>> 
>> Would the most useful modification to an ADSR be simply selectable lin/expo for R?
>
>For quick A, D and R it is not so important, but if you reach for longer 
>  stretches, the end-result needs to be more expo at least.

Agreed, because linear is a fairly close approximation of fast expo transitions anyway.

>Rolling back to the 80thies, the highly digital SID-chip was fairly easy 
>to design except for the ADSR for this particular reason. It took some 
>engineering time to get the envelopes right.
>
>An exponential decay is not too hard to cook up correctly if one pulls 
>in a multiplier block or performs multiplications using a shift-add 
>approach, which can easilly be used for the full calculations with some 
>additional thought put into it. If you think about it, it should not be 
>too hard to achieve lin/exp as needed.
>
>I think I would need to spend some quality time with paper and pen to 
>bring it all together, but I am confident that it will not be all that 
>complex in the end.

Ah, paper and pen...  I'm more of a dabbler, y'know, fartin' around and hear what happens sorta
guy.  I know I should probably learn to use paper and pen more, but I have to figure out which end
of the pen is the business end.  (you're supposed to laugh)...  

I figured that I could use a modified single pole IIR lowpass.  Pre-initialize the Z^-1 memory with
the sustain value (or wherever it was when the key was released) and present a constant zero as
input (which eliminates the a0 term).  That might be the same thing Eric said...  Regardless, only
one multiplier is needed.

So I'll probably see what happens if I just modify the ADSR to allow selectable linear or expo
release and leave A and D linear for now.  It's a matter of whether there's a significant
difference or not and with long release times I think it is.  Long decay times are usually coupled
with long release and really amount to more of an AR than an ADSR envelope (for something like a
bell).  In this case though the decay phase can still be linear I think.

-- ScottG
________________________________________________________________________
-- Scott Gravenhorst
-- FPGA MIDI Synthesizer Information: home1.gte.net/res0658s/FPGA_synth/
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.



More information about the Fpga-synth mailing list