|
|
@ -1670,4 +1670,31 @@ void check_midi_devices(void) |
|
|
|
midi_usb.read(); |
|
|
|
midi_usb.read(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void send_sysex_voice(uint8_t midi_channel, uint8_t* data) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t checksum = 0; |
|
|
|
|
|
|
|
uint8_t voice_data[161]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send SYSEX data also via MIDI
|
|
|
|
|
|
|
|
//voice_data[0] = 0xF0; // SysEx start
|
|
|
|
|
|
|
|
voice_data[0] = 0x43; // ID=Yamaha
|
|
|
|
|
|
|
|
voice_data[1] = midi_channel; // Sub-status and MIDI channel
|
|
|
|
|
|
|
|
voice_data[2] = 0x00; // Format number (0=1 voice)
|
|
|
|
|
|
|
|
voice_data[3] = 0x01; // Byte count MSB
|
|
|
|
|
|
|
|
voice_data[4] = 0x1B; // Byte count LSB
|
|
|
|
|
|
|
|
for (uint8_t n = 0; n < 155; n++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
checksum -= data[n]; |
|
|
|
|
|
|
|
voice_data[5 + n] = data[n]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
checksum &= 0x7f; |
|
|
|
|
|
|
|
voice_data[160] = checksum; // Checksum
|
|
|
|
|
|
|
|
//voice_data[162] = 0xF7; // SysEx end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
midi_serial.sendSysEx(161, voice_data); // Send to DIN MIDI
|
|
|
|
|
|
|
|
midi_usb.sendSysEx(161, voice_data); // Send to USB MIDI
|
|
|
|
|
|
|
|
usbMIDI.sendSysEx(161, voice_data); // Send to USB-HOST MIDI
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // MIDI_DEVICES_H
|
|
|
|
#endif // MIDI_DEVICES_H
|
|
|
|