diff --git a/src/sequencer_alsa/sequencer.py b/src/sequencer_alsa/sequencer.py index 9a9c3ef..5e9f3e7 100644 --- a/src/sequencer_alsa/sequencer.py +++ b/src/sequencer_alsa/sequencer.py @@ -280,7 +280,7 @@ def event_write(self, event, direct=False, relative=False, tick=False): def event_read(self): ev = S.event_input(self.client) if ev and (ev < 0): self._error(ev) - if ev and ev.type in (S.SND_SEQ_EVENT_NOTEON, S.SND_SEQ_EVENT_NOTEOFF): + if ev and ev.type in (S.SND_SEQ_EVENT_NOTEON, S.SND_SEQ_EVENT_NOTEOFF, S.SND_SEQ_EVENT_CONTROLLER): if ev.type == S.SND_SEQ_EVENT_NOTEON: mev = midi.NoteOnEvent() mev.channel = ev.data.note.channel @@ -291,6 +291,11 @@ def event_read(self): mev.channel = ev.data.note.channel mev.pitch = ev.data.note.note mev.velocity = ev.data.note.velocity + elif ev.type == S.SND_SEQ_EVENT_CONTROLLER: + mev = midi.ControlChangeEvent() + mev.channel = ev.data.control.channel + mev.control = ev.data.control.param + mev.value = ev.data.control.value if ev.time.time.tv_nsec: # convert to ms mev.msdeay = \