- [Function]
(amplitudeamp [softest] [loudest] [power])
Converts a logical amplitude amp to an amplitude value according to its optional arguments. A logical amplitude is a value from 0.0 to 1.0 inclusive, or one of the following symbols:
niente pppp ppp pp p mp mf f ff fff ffff
amplitude supports the following optional arguments:
- softest
-
The value to return when amp is 0
or
niente. The default value is*softest*. - loudest
-
The value to return when amp is 1 or
ffff. The default value is*loudest*. - power
- If power is 1 then the amplitude returned is calculated
linearly, otherwise the value lies on an exponential
curve amppower. The
default value is
*power*.
Examples:
Example 1. Calculating amplitude values.
(amplitude 'mp) ⇒ .5 (amplitude 'mp 0 127) ⇒ 63.5 (amplitude .5 0 1 4) ⇒ 0.0625