chnset
Writes data to a channel of the named software bus.
Implies declaring the channel with imod=2 (see also chn_k, chn_a, and chn_S).
Syntax
chnset ival, Sname
chnset kval, Sname
chnset aval, Sname
chnset Sval, Sname
chnsetks Sval, Sname
chnseti ival[], []Sname
chnsetk kval[], []Sname
chnseta aval[], []Sname
chnsets Sval[], []Sname
Initialization
Sname -- a string that indicates which named channel of the software bus to write.
Sname[] -- an array of string that indicates which named channels of the software bus to write to.
ival -- the control value to write at i-time.
ival[] -- an array of control values to write at i-time.
Sval -- the string value to write at i-time.
Sval[] -- an array of string values to write at i-time.
Performance
kval -- the control value to write at performance time.
aval -- the audio signal to write at performance time.
Sval -- the string value to write at perf-time. The opcode chnset with strings works at both i- and perf-time, whereas chnsetks works only a perf-time. Channel contents are only updated if the string variable is modified.
kval[] -- an array of control values to write at performance time.
aval[] -- an array of audio vectors to write at performance time.
Note
Although it is possible to loop through channel names from an array with chnget and chnset, using the array based channel opcodes is more efficient.
Example
The example shows the software bus being used to write pitch information to a controlling program.
Here is another example of the chnset opcode. It uses the file chnset.csd.
See also
Credits
Author: Istvan Varga
2005
Array based channel opcodes added in version 6.14 - Rory Walsh