setctrlInstrument Control:Sensing and Controlsetctrlsetctrl
Configurable slider controls for realtime user input.
DescriptionPlugin opcode in control.
Configurable slider controls for realtime user input. Requires Winsound or TCL/TK. setctrl sets a slider to a specific value, or sets a minimum or maximum range.
Syntaxsetctrl inum, ival, itypeInitialization
Note that this opcode is not available on Windows due to the implimentation of pipes on that system
inum -- number of the slider to set
ival -- value to be sent to the slider
itype -- type of value sent to the slider as follows:
1 -- set the current value. Initial value is 0.2 -- set the minimum value. Default is 0.3 -- set the maximum value. Default is 127.4 -- set the label. (New in Csound version 4.09)Performance
Calling setctrl will create a new slider on the screen. There is no theoretical limit to the number of sliders. Windows and TCL/TK use only integers for slider values, so the values may need rescaling. GUIs usually pass values at a fairly slow rate, so it may be advisable to pass the output of control through port.
Examples
Here is an example of the setctrl opcode. It uses the file setctrl.csd.
Example of the setctrl opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
Its output should include lines like this:
i1 38.00000
i1 40.00000
i1 43.00000
See alsoSensing and Control: TCL/TK widgetsCreditsAuthor: &namejohn;University of Bath, Codemist. Ltd.Bath, UKMay 2000Example written by &namekevin;.New in Csound version 4.06