I am a bit confused, it seems that the board is not sending "note off" messages? Or maybe it is sending real "note off" messages instead of the usual way (that is : sending "note on" messages with velocity = 0).
In the second case, here is a fix. If you are using just the code from the example, can you update the function midiMessageCallback() so that it looks like this?
void midiMessageCallback(MidiChannelMessage message, void* arg){
if(arg != NULL){
rt_printf("Message from midi port %s ", (const char*) arg);
}
message.prettyPrint();
bool isOff = (message.getType() == kmmNoteOff);
if(message.getType() == kmmNoteOn || isOff){
gFreq = powf(2, (message.getDataByte(0) - 69) / 12.f) * 440.f;
gVelocity = message.getDataByte(1) * !isOff;
gPhaseIncrement = 2.f * (float)M_PI * gFreq * gSamplingPeriod;
gIsNoteOn = gVelocity > 0;
rt_printf("v0:%f, ph: %6.5f, gVelocity: %d\n", gFreq, gPhaseIncrement, gVelocity);
}
}
If this doesn't work, can you please send the output generated on the Bela console?