stmaddcondedge
Adds edges from one node to several possible targets.
A conditional edge declares the set of nodes a node may branch to. The node chooses one of them at performance time with stmnext, and stmadvance checks the choice against that set. It is the same as calling stmaddedge once for each target.
Syntax
Initialization
ibuilder -- a builder handle, returned by stmcreate.
Sfrom -- the name of the source node.
Stargets[] -- a string array with the names of the target nodes, for example ["Calm", "Build"]. The array must be one-dimensional and not empty, otherwise an initialization error is reported. All nodes must already exist, otherwise an initialization error is reported. Targets that are already connected are skipped.
Calling it after stmcompile has frozen the builder causes an initialization error.
Examples
A texture moves through three nodes, Calm, Build and Burst. Each node is a UDO that writes a shared struct and asks for the next node with stmnext when its time is up. The runner is created inside the instrument, so it lasts as long as the note. It uses the file stm.csd.
See also
stmaddedge, stmnext, stmadvance
Credits
Author: Pasquale Mainolfi
Italy
New in Csound version 7.0
October 2026