strset
Prev | Orchestra Opcodes and Operators | Next

## strset

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

## Description

Allows a string to be linked with a numeric value.

## Syntax

    strset iarg, istring

## Initialization

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.

## Examples

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"

## Examples

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

Example 1051. Example of the strset opcode.

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

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

    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
    endin

    </CsInstruments>
    <CsScore>
    ;        p4 is used to select string
    i 1 0 1  1
    i 1 3 1  2
    </CsScore>
    </CsoundSynthesizer>

## See Also

String Manipulation Opcodes

Orchestra Header Statements

Prev | Up | Next
strrindexk | Home | strstrip