ampmidicurve
Maps an input MIDI velocity number to an output gain factor with a maximum value of 1, modifying the output gain by a dynamic range and a shaping exponent.
Plugin opcode in ampmidid.
The minimum output gain is 1 minus the dynamic range. A shaping exponent of 1 gives a linear response; increasing the exponent produces an increasingly depressed knee in the gain response curve.
Syntax
igain ampmidicurve ivelocity, idynamicrange, iexponent
kgain ampmidicurve kvelocity, kdynamicrange, kexponent
Initialization
_imidivelocity _ -- MIDI velocity number, ranging from 0 through 127.
idynamicrange -- Intended dynamic range of gain, from 0 through 1.
iexponent -- Exponent applied to shape the gain response curve, 1 or greater.
Performance
_kmidivelocity _ -- MIDI velocity number, ranging from 0 through 127.
kdynamicrange -- Intended dynamic range of gain, from 0 through 1.
kexponent -- Exponent applied to shape the gain response curve, 1 or greater.
Maps an input MIDI velocity number to an output gain factor with a maximum value of 1, modifying the output gain by a dynamic range and a shaping exponent. The minimum output gain is 1 minus the dynamic range. A shaping exponent of 1 gives a linear response; increasing the exponent produces an increasingly depressed knee in the gain response curve, according to the equation: \(y = d \; (x/127)^h + 1 - d\), where \(y\) = the gain, \(x\) = the input MIDI velocity (from 0 through 127), \(d\) = the dynamic range (from p through 1), and \(h\) = the shaping exponent (1 or greater). This opcode was suggested by Mauro Giubileo.
Examples
Here is an example of the ampmidicurve opcode. It uses the file ampmidicurve.csd.
See also
Credits
Author: Michael Gogins
2019