setctrl

Description

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.

Syntax

setctrl inum, ival, itype

Initialization

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.