Stopping a specific note from Lua

Hey. Let’s say a note is triggered with a note_on 1 1 48 127 event on OSC. The instrument is not set to mono and the sound is looping, so the note keeps playing until a note_off 1 1 48 event arrives.

Now, if my external source sends the same note_on 1 1 48 127 message N times, the same note will play N times. Then a note_off 1 1 48 event will stop all notes playing.

Is there a way to differenciate between the notes playing and target one specifically?

note_on 1 2 48 127

note_off 1 2 48

  • note off = stop the sound of the note for:
    • 1 = instrument index
    • 2 = track index
    • 48 = note value

The only way to achieve this behavior is to vary the value index of the track (or instrument). That is, playing the same note on a different track. In this way, you will stop each note specifically, depending on the track where it is played.

Possible cases for the same note:

  1. The same track with different instruments.
  2. The same instrument on different tracks.
1 Like

@Raul thanks for the reply, I’ll see if I can use the multiple tracks trick you described.