Actions
Actions run when an event is detected. Define them one line below the event.
For organization it is recommended to use indentation!
Examples
-
Immediate action
-
Tempo-relative delay
-
Absolute delay
-
Lua action
Reference Table
| Action | Syntax | Arguments | Example | Remarks |
|---|---|---|---|---|
sendto | sendto <DESTINATION> [<MESSAGE>] | receiver name, message list | sendto delay [1] | Host-specific delivery; see Platform Integrations. |
delay | delay <VALUE> <UNIT> <ACTION> | ms, sec, or tempo | delay 1 tempo sendto echo [1] | Schedules an action. tempo is performer beat-relative. |
luacall | luacall(<FUNCTION_CALL>) | Lua function call | luacall(cue("A")) | Useful for small logic before sending. |
Audio state changes
Declare a receiver once at score level to receive every followed audio-state change:
The forward model stores the best audio observation for every candidate event. After choosing the best event, it compares that event and its best observation with the previous result. A changed event always sends a notification; within the same event, a different best observation also sends one. Identical results do not send duplicates.
The receiver uses the same host-specific delivery mechanism as sendto. Each message contains the current score position followed by the selected observation: its MIDI pitch, ONNX label, silence, or onset. Chords are reported as chord followed by every MIDI pitch in score order; their notification remains stable when the spectral balance between constituent notes changes.
In Csound the listener is an instrument: notifications use p2 = 0 and p3 = 0, and the payload shown below starts at p4. Other hosts receive the payload as a normal list.
Remarks
Use tempo delays for performer-relative timing and ms or sec for fixed technical timing. See also: Core Language Concepts, Lua, Platform Integrations.