Skip to content

Commit

Permalink
MidiCommon: merge SYSTEM_EXCLUSIVE into SYSEX
Browse files Browse the repository at this point in the history
After reading into both MIDI specs and doc as well as PortMidi api doc I came to the conclusion that the separate handling (and mere existance) of `SYSTEM_EXCLUSIVE` and `SYSEX` MIDI type must have been an accident.

This fix should enable MMC MIDI control using PortMidi (I have no hardware to test this).

Fixes hydrogen-music#1773
  • Loading branch information
theGreatWhiteShark committed May 17, 2023
1 parent 9e4df49 commit f52f899
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ XXXX-XX-XX the hydrogen team <hydrogen-devel@lists.sourceforge.net>
* Release 1.2.1
* Update French translation
* Bugfixes
- Fix MIDI Machine Control (MMC) event type handling on Windows
(#1773)
- Fix loading of legacy drumkits. All layers but the first one
were dropped during drumkit upgrade (#1759)
- Fix MIDI input handling with "Discard MIDI messages after action
Expand Down
4 changes: 0 additions & 4 deletions src/core/IO/MidiCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class MidiMessage
PROGRAM_CHANGE,
CHANNEL_PRESSURE,
PITCH_WHEEL,
SYSTEM_EXCLUSIVE,
START,
CONTINUE,
STOP,
Expand Down Expand Up @@ -96,9 +95,6 @@ inline QString MidiMessage::TypeToQString( MidiMessageType type ) {
case MidiMessageType::PITCH_WHEEL:
sType = "PITCH_WHEEL";
break;
case MidiMessageType::SYSTEM_EXCLUSIVE:
sType = "SYSTEM_EXCLUSIVE";
break;
case MidiMessageType::START:
sType = "START";
break;
Expand Down
2 changes: 0 additions & 2 deletions src/core/IO/MidiInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void MidiInput::handleMidiMessage( const MidiMessage& msg )
// exclude all midi channel filter independent messages
int type = msg.m_type;
if ( MidiMessage::SYSEX == type
|| MidiMessage::SYSTEM_EXCLUSIVE == type
|| MidiMessage::START == type
|| MidiMessage::CONTINUE == type
|| MidiMessage::STOP == type
Expand Down Expand Up @@ -138,7 +137,6 @@ void MidiInput::handleMidiMessage( const MidiMessage& msg )

case MidiMessage::CHANNEL_PRESSURE:
case MidiMessage::PITCH_WHEEL:
case MidiMessage::SYSTEM_EXCLUSIVE:
case MidiMessage::SONG_POS:
case MidiMessage::QUARTER_FRAME:
ERRORLOG( QString( "MIDI message of type [%1] is not supported by Hydrogen" )
Expand Down
2 changes: 1 addition & 1 deletion src/core/IO/PortMidiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void* PortMidiDriver_thread( void* param )
msg.m_type = MidiMessage::PITCH_WHEEL;
} else if ( ( nEventType >= 240 ) && ( nEventType < 256 ) ) { // System Exclusive
msg.m_nChannel = nEventType - 240;
msg.m_type = MidiMessage::SYSTEM_EXCLUSIVE;
msg.m_type = MidiMessage::SYSEX;
} else {
__ERRORLOG( "Unhandled midi message type: " + QString::number( nEventType ) );
__INFOLOG( "MIDI msg: " );
Expand Down

0 comments on commit f52f899

Please sign in to comment.