RPA Maybe it's possible to use some parts of libpd outside pd ?
I am not suggesting that you use libpd, and there is no need to use some parts of libpd outside pd (which is doable, actually that's exactly what libpd does, but it's also overkill for your application). I was just pointing you to that source file to see an example implementation of how to handle MIDI realtime messages within Bela.
In the faust/midi/bela_midi.h
you already have a switch(message.getType())
statement. You can add the following code (obtained combining your code above and the one at the lines highlighted above in libpd_default_render.cpp
) :
switch(message.getType()){
..... // insert here existing code and add the below
case kmmSystem:
// currently Bela only handles sysrealtime, and it does
// so pretending it is a channel message with no data bytes,
// so we have to re-assemble the status byte
{
int channel = message.getChannel();
int status = message.getStatusByte();
int systemRealtimeByte = channel | status;
// the following is your code from above
switch (systemRealtimeByte)
{
case 248:// MIDI CLK
rt_printf("CLK\n");
break;
case 250:
rt_printf("START\n");
break;
case 251:
rt_printf("CONTINUE\n");
break;
case 252:
rt_printf("STOP\n");
break;
case 254:
rt_printf("Active Sensing\n");
break;
case 255:
rt_printf("RESET\n");
break;
default:
break;
}
break;
}
case kmmNone:
case kmmAny:
break;
}
RPA With FAUST, it's possible to use MIDI messages with sample accuracy timing. In this case it need a timestamp with the MIDI message. It exist for some others plateforms. Do you plane to add themĀ ?
Is that supported by Linux? If it is, then that would require a re-writing of the Bela Midi internals.