strset — Allows a string to be linked with a numeric value.


Allows a string to be linked with a numeric value.


strset iarg, istring


iarg -- the numeric value.

istring -- the alphanumeric string (in double-quotes).

strset (optional) allows a string, such as a filename, to be linked with a numeric value. Its use is optional.


The following statement, used in the orchestra header, will allow the numeric value 10 to be substituted anywhere the soundfile asound.wav is called for.

strset 10, "asound.wav"


Here is an example of the strset opcode. It uses the file strset.csd.

Example 957. Example of the strset opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; Select audio/midi flags here according to platform
; Audio out   Audio in    No messages
-odac           -iadc     -d     ;;;RT audio I/O

sr = 44100
ksmps = 1
nchnls = 1

;Example by Andres Cabrera 2008

; \\n is used to denote "new line" 
strset 1, "String 1\\n"
strset 2, "String 2\\n"

instr 1
Str strget p4
prints Str

;        p4 is used to select string
i 1 0 1  1
i 1 3 1  2

See Also

pset and strget