mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fix for handling MIDI channels in the bidirectional converter example (#586)
This commit is contained in:
parent
b4bbfecd09
commit
66b03d99d6
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Legacy Serial MIDI and USB Host bidirectional converter
|
* Legacy Serial MIDI and USB Host bidirectional converter
|
||||||
* Copyright (C) 2013-2020 Yuuichi Akagawa
|
* Copyright (C) 2013-2021 Yuuichi Akagawa
|
||||||
*
|
*
|
||||||
* for use with Arduino MIDI library
|
* for use with Arduino MIDI library
|
||||||
* https://github.com/FortySevenEffects/arduino_midi_library/
|
* https://github.com/FortySevenEffects/arduino_midi_library/
|
||||||
|
@ -44,6 +44,7 @@ MIDI_CREATE_DEFAULT_INSTANCE();
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|
||||||
USB Usb;
|
USB Usb;
|
||||||
|
USBHub Hub1(&Usb);
|
||||||
USBH_MIDI Midi(&Usb);
|
USBH_MIDI Midi(&Usb);
|
||||||
|
|
||||||
void MIDI_poll();
|
void MIDI_poll();
|
||||||
|
@ -87,6 +88,9 @@ void loop()
|
||||||
//SysEx is handled by event.
|
//SysEx is handled by event.
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
|
if( msg[0] < 0xf0 ){
|
||||||
|
msg[0] |= MIDI.getChannel() - 1;
|
||||||
|
}
|
||||||
msg[1] = MIDI.getData1();
|
msg[1] = MIDI.getData1();
|
||||||
msg[2] = MIDI.getData2();
|
msg[2] = MIDI.getData2();
|
||||||
Midi.SendData(msg, 0);
|
Midi.SendData(msg, 0);
|
||||||
|
|
Loading…
Reference in a new issue