Difference between revisions of "Decay curve shape"

From Jeskola Buzz Wiki
Jump to: navigation, search
(Created page with '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 an…')
 
Line 1: Line 1:
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 tend to follow a more rapid slope (x^2). Here are a few examples of what the shapes look like:
+
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:
  
 
[[Image:Decay_curves_long.gif]]
 
[[Image:Decay_curves_long.gif]]
Line 8: Line 8:
  
 
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.
 
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 ===
 +
 +
<pre name="cpp">
 +
output = pow(1.0001-min(1, time*decaylength), pow(1.3/(curveshape+0.5), 3))
 +
</pre>
 +
 +
* '''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.

Revision as of 21:08, 10 October 2009

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.