Decay curve shape

From Jeskola Buzz Wiki
Jump to: navigation, search

The Decay curve shape is not the same as the decay length, even though it might sound this way. The decay curve shape dictates in what way fades fade out. Many software synths and samplers fade things out in a linear way (x^1) whereas analog synthesizers, being based on capacitors being discharged, tend to follow a more rapid slope resembling x^2. Here are a few examples of what the shapes look like:

Decay curves long.gif

Adjusting the decay curve shape parameter produces various logaritmic slopes. When the decay length is set to something long, the various curve shapes look as the above.

Decay curves short.gif

Adjusting the decay curve shape parameter produces various logaritmic slopes. When the decay length is set to something short, the various curve shapes look as the above.

Implementation

output = pow(1.0001-min(1, time*decaylength), pow(1.3/(curveshape+0.5), 3))
  • time is playback time from 0 to N seconds.
  • decaylength is how long the decay should be.
  • curveshape is anything from 0 to 1, where 0 is "fast logaritmic decay" and 1 is "odd slow then sudden decay". Recommended default value is 0.5 which will resemble analog synthesizers.