execute_trigger

Function execute_trigger 

Source
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 execute
  • body - Statements to execute when triggered
  • context - Current execution context (variables, etc.)

§Examples

// Trigger on MIDI note
trigger "noteOn" {
    kick play
}

// Trigger with condition
trigger when $velocity > 0.5 {
    snare play
}