Create a control specification for a parameter (if building via generic parameter constructor)
my_control:map(value)
Transform an incoming value between 0 and 1 through this controlspec
my_control:unmap(value)
Un-transform a transformed value into its original value
my_new_control = my_control:copy()
Copy a controlspec’s definitions to another controlspec
my_control:print()
Print out the configuration of this controlspec
presets
Syntax
Description
controlspec.UNIPOLAR
converts values to a unipolar range
controlspec.BIPOLAR
converts values to bipolar range
controlspec.FREQ
converts to a frequency range
controlspec.LOFREQ
converts to a low frequency range
controlspec.MIDFREQ
converts to a mid frequency range
controlspec.WIDEFREQ
converts to an exponential frequency range from 0.1 to 20khz
controlspec.PHASE
maps into pi for controlling phase values
controlspec.RQ
converts to an exponential RQ range
controlspec.MIDI
converts to a MIDI range (default 64)
controlspec.MIDINOTE
converts to a range for MIDI notes (default 60)
controlspec.MIDIVELOCITY
converts to a range for MIDI velocity (default 64)
controlspec.DB
converts to a dB range
controlspec.AMP
converts to a linear amplitude range (0-1)
controlspec.PAN
converts to a panning range (-1 - 1)
controlspec.DETUNE
converts to a detune range
controlspec.RATE
converts to a sensible range for playback rate
controlspec.BEATS
convert to a good range for beats
controlspec.DELAY
converts to a good range for delay
example
-- nb. no on-screen script interaction!-- open PARAMETERS > EDIT to see the result of this codefunctioninit()amp=controlspec.AMPparams:add_control("amplitude","amplitude",amp)pan=controlspec.PANparams:add_control("panning","panning",pan)del=controlspec.DELAYparams:add_control("delay_time","delay time",del)freq_L=controlspec.def{min=0.00,-- the minimum valuemax=5.0,-- the maximum valuewarp='lin',-- a shaping option for the raw valuestep=0.01,-- output value quantizationdefault=2.5,-- default valueunits='khz',-- displayed on PARAMS UIquantum=0.01,-- each delta will change raw value by this muchwrap=false-- wrap around on overflow (true) or clamp (false)}params:add_control("filter_frequency_L","filter frequency L",freq_L)freq_R=freq_L:copy()freq_R.default=3params:add_control("filter_frequency_R","filter frequency R",freq_R)end
description
A class which helps defines the range of a parameter. You can either construct your own controls or use any of the supplied presets.