Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 1.04 KB

2.3 Parameter mapping.md

File metadata and controls

9 lines (8 loc) · 1.04 KB

In many cases, a variable in an application needs to be transformed to make sense for an audio parameter. E.g. the frequency value would benefit from an exponential increase rather than a linear and a MIDI note number (values between 0 and 127) needs to be converted to the frequency domain to make musical sense. On the way, the value might need to be snapped to a value in a list of steps to map interpolated values to an asymmetric pattern of values. All this can be done using the mapin, mapout, curve, steps and convert attributes similar to the example below. Please read more about the different attributes for the <var>-element

<!-- The variable "f", stores a transformed value from variable "slider_val". 
The slider is supposed to vary between 0 and 1 which is transformed to a 
frequency value matching a key in C major by first snapping the float value 
to a . -->
<var name="f" default="60" value="$slider_val" mapin="0,1" mapout="60,62,64,65,67,69,71,72" curve="step" convert="MIDI->frequency" />
<OscillatorNode frequency="$f" />