str
Returns the name of an instrument definition.
Syntax
Initialization
definition is an InstrDef for a named instrument. Sname receives its name as a string. The conversion runs once at initialization.
Use this when you have a typed definition and need its name for a message or another opcode that takes a string. For example, str(Tone) returns "Tone".
Use str with named definitions. An unnamed definition, such as one compiled from an instrument body with create, has no name to return. Use instrnum to obtain its number instead. To look up a name from a number, use instrstr.
Examples
The example prints the name from an InstrDef, then looks up the same name from its instrument number. It uses instrument-names.csd.
See also
instrnum, instrstr, create, Instrument definitions, instances and opcode objects
Credits
Author Victor Lazzarini.
New in Csound 7.