pub fn execute_trigger(
trigger_name: &str,
_body: &[Statement],
_context: &HashMap<String, Value>,
) -> Result<()>Expand description
Execute trigger statement
Triggers are used to conditionally execute a block of statements or emit events when specific conditions are met.
§Arguments
trigger_name- Name of the trigger to executebody- Statements to execute when triggeredcontext- Current execution context (variables, etc.)
§Examples
ⓘ
// Trigger on MIDI note
trigger "noteOn" {
kick play
}
// Trigger with condition
trigger when $velocity > 0.5 {
snare play
}