I have a simple Littlefoot script I’m using with the ROLI Lightpad block that maps the playing surface to an 8x8 grid of notes. On touch start, the X-Y position is mapped to a note, and the note is mapped to the touch index (also used for the channel) using the heap, and a sendnoteon is called. On touch end, the note is pulled from the heap using the touch index and a note off is sent. All the notes values are correct, but more often then not for the touch start event, a note off message is sent instead of a note on. If I switch the sendnoteon/off functions to any other MIDI message they work perfectly.
Can anyone think why this is happening?
void touchStart (int index, float x, float y, float z, float vz)
setHeapByte(index + 200, int ((x * 4) + ((2 - y) * 28)));
sendNoteOn(index - 1, getHeapByte(index + 200), int (vz * 127));
void touchEnd (int index, float x, float y, float z, float vz)
sendNoteOff(index - 1, getHeapByte(index + 200), int (vz * 127));