///////////////////////////////////////////////////////////////////////////// // This hook is called when a MIDI package has been received ///////////////////////////////////////////////////////////////////////////// void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package) { if((port & 0xf0) == MCAN0){ // receive the voice messages from MCANx and forward it to the USBx MIOS32_MIDI_SendPackage(USB0 + (port & 0x0f), midi_package); }else if((port & 0xf0) == USB0){ // filter for voice messages from USBx if(midi_package.type >= 0x8 && midi_package.type <= 0xe){ // forward the voice messages to MCANx MIOS32_MIDI_SendPackage(MCAN0 + (port & 0x0f), midi_package); } } }