Skip to content

Commit 0fb7f18

Browse files
authored
Fix tempo change events in ALSA backend (#83)
1 parent 44f1eec commit 0fb7f18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/mididevices/music_alsa_mididevice.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ EventType AlsaMIDIDevice::PullEvent(EventState & state) {
258258
int tempo = MEVENT_EVENTPARM(event[2]);
259259
if(Tempo != tempo) {
260260
Tempo = tempo;
261-
snd_seq_change_queue_tempo(sequencer.handle, QueueId, Tempo, &state.data);
261+
snd_seq_ev_set_queue_tempo(&state.data, QueueId, Tempo);
262262
return EventType::Action;
263263
}
264264
}
@@ -394,6 +394,10 @@ void AlsaMIDIDevice::PumpEvents() {
394394
// We found an event worthy of sending to the sequencer
395395
snd_seq_ev_set_source(&event.data, PortId);
396396
snd_seq_ev_set_subs(&event.data);
397+
if (event.data.type == SND_SEQ_EVENT_TEMPO) {
398+
event.data.dest.client = SND_SEQ_CLIENT_SYSTEM;
399+
event.data.dest.port = SND_SEQ_PORT_SYSTEM_TIMER;
400+
}
397401
snd_seq_ev_schedule_tick(&event.data, QueueId, false, buffer_ticks + event.ticks);
398402
int result = snd_seq_event_output(sequencer.handle, &event.data);
399403
if(result < 0) {

0 commit comments

Comments
 (0)