diff --git a/src/drivers/fluid_alsa.c b/src/drivers/fluid_alsa.c index 6f930edf..f47b24cd 100644 --- a/src/drivers/fluid_alsa.c +++ b/src/drivers/fluid_alsa.c @@ -553,7 +553,7 @@ static fluid_thread_return_t fluid_alsa_audio_run_s16(void *d) { FLUID_MEMSET(left, 0, buffer_size * sizeof(*left)); FLUID_MEMSET(right, 0, buffer_size * sizeof(*right)); - + (*dev->callback)(dev->data, buffer_size, 0, NULL, 2, handle); /* convert floating point data to 16 bit (with dithering) */ @@ -1347,6 +1347,26 @@ fluid_alsa_seq_run(void *d) } break; + case SND_SEQ_EVENT_START: + evt.type = MIDI_START; + break; + + case SND_SEQ_EVENT_CONTINUE: + evt.type = MIDI_CONTINUE; + break; + + case SND_SEQ_EVENT_STOP: + evt.type = MIDI_STOP; + break; + + case SND_SEQ_EVENT_CLOCK: + evt.type = MIDI_SYNC; + break; + + case SND_SEQ_EVENT_RESET: + evt.type = MIDI_SYSTEM_RESET; + break; + default: continue; /* unhandled event, next loop iteration */ } diff --git a/src/drivers/fluid_winmidi.c b/src/drivers/fluid_winmidi.c index ed8bd84a..d99323b2 100644 --- a/src/drivers/fluid_winmidi.c +++ b/src/drivers/fluid_winmidi.c @@ -145,21 +145,28 @@ fluid_winmidi_callback(HMIDIIN hmi, UINT wMsg, DWORD_PTR dwInstance, break; case MIM_DATA: - event.type = msg_type(msg_param); - event.channel = msg_chan(msg_param) + dev_infos->channel_map; - - FLUID_LOG(FLUID_DBG, "\ndevice at index %d sending MIDI message on channel %d, forwarded on channel: %d", - dev_infos->dev_idx, msg_chan(msg_param), event.channel); - - if(event.type != PITCH_BEND) + if(msg_param < 0xF0) /* Voice category message */ { - event.param1 = msg_p1(msg_param); - event.param2 = msg_p2(msg_param); + event.type = msg_type(msg_param); + event.channel = msg_chan(msg_param) + dev_infos->channel_map; + + FLUID_LOG(FLUID_DBG, "\ndevice at index %d sending MIDI message on channel %d, forwarded on channel: %d", + dev_infos->dev_idx, msg_chan(msg_param), event.channel); + + if(event.type != PITCH_BEND) + { + event.param1 = msg_p1(msg_param); + event.param2 = msg_p2(msg_param); + } + else /* Pitch bend is a 14 bit value */ + { + event.param1 = (msg_p2(msg_param) << 7) | msg_p1(msg_param); + event.param2 = 0; + } } - else /* Pitch bend is a 14 bit value */ + else /* System message */ { - event.param1 = (msg_p2(msg_param) << 7) | msg_p1(msg_param); - event.param2 = 0; + event.type = msg_param; } (*dev->driver.handler)(dev->driver.data, &event); diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index 778a705b..7a27db63 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -2642,14 +2642,9 @@ fluid_midi_parser_parse(fluid_midi_parser_t *parser, unsigned char c) * of another message. */ if(c >= 0xF8) { - if(c == MIDI_SYSTEM_RESET) - { - parser->event.type = c; - parser->status = 0; /* clear the status */ - return &parser->event; - } - - return NULL; + parser->event.type = c; + parser->status = 0; /* clear the status */ + return &parser->event; } /* Status byte? - If previous message not yet complete, it is discarded (re-sync). */