[Fpga-synth] Envelope - linear attack & expo decay/release?
Theo Verelst
theover at tiscali.nl
Mon Apr 6 01:11:07 CEST 2009
Magnus Danielson wrote:
> Scott Gravenhorst skrev:
>
>> "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.
>>>>>.
..
>>>>> 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)...
>
>
> Hahaha... (in an obvious theatrical manor)
>
> For me it is a way to concentrate on key aspects, dabble around on the
> paper, and then when I have a good solution I move to implementation.
> I also work with witeboards at work. If I had one at home I would work
> with it here too. But I need a large one... don't get far on a square
...
Well A lot of people have doodled on this subject a long time already!
I´ve taken some time to look at some sound waves, see here (
http://www.theover.org/wiki/index.php/FpgaSynth ) for some waveforms.
For instance http://www.theover.org/wiki/index.php/Image:Scrmopho1.jpg
is from a demo file from the famous MOPHO synthesizer by DSI, of course
an actual analog, probably attack and release are exponential.
Think about ´taking over´ notes, too, in my second (wiki page) example
this can be seen.
And of course for any digital implementation, it´s the sampling and the
accuracy matters which are probably more important than a lot of other
considerations, like a fast attack has a spectrum which gets added to
the waveform spectrum (gets shifted, even if that is somehow frequency
limited) and when a fast exponential spectrum get multiplied with a
waveform (especially when filtering hasn´t been applied yet) the
resulting spectrum can easily be far outside the niquist band.
This also applies to the point where the sections of the adsr or by note
repetition the release going into the next attack: the discontinuity can
couse a major spectrum outside the half-sampling rate bandwidth and
therefore cause serious aliasing, and signal ambiguity for following
processing stages (even for the filter). Transients (e.g. coupling
capacitors, averaging of detuned oscillator waves) are another matter to
think about, and how will the digital filter algorithm respond to
certain peaks generated by the ADSR, without sounding the same all the
time (happens a lot in digital simulations which are then soon boring)...
Also think about the accuracy: even for a CD quality sample, your
envelope computations will have to be in the neighbourhood of 16 bits
accurate, which a repeated 18 bits multiplication on a 18 bits or less
state is not going to give you for small volumes. Also, the accuracy of
setting the timing is important, most likely when doodling obvious
algorithms this can be overlooked, however this accuracy can be needed
for tuning sounds nicely (in the pure analog domain is of course is
never an issue).
Lechajiem,
Theo Verelst
http://www.theover.org/wiki
More information about the Fpga-synth
mailing list