From 272b838807ed437542fd8209bbe195ce2a5da9eb Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 21 Jan 2014 11:21:14 -0500 Subject: Pass through unknown MIDI events This makes certain MIDI files sound billions of times better. It also ensures that program changes work (i.e., the right instrument plays). (I thought this was already being done, but it wasn't.) --- AlsaSeq.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/AlsaSeq.hs b/AlsaSeq.hs index 99e7c80..8fb5bd2 100644 --- a/AlsaSeq.hs +++ b/AlsaSeq.hs @@ -139,15 +139,14 @@ parseAlsaEvents h keysDown immediate = loop keysDown return keysDown else do ev <- Event.input h + immediate ev case Event.body ev of - Event.NoteEv Event.NoteOn n -> do - immediate ev + Event.NoteEv Event.NoteOn n -> if (Event.unVelocity (Event.noteVelocity n) == 0) then loop (Set.delete (Event.noteChannel n, Event.noteNote n) keysDown) else loop (Set.insert (Event.noteChannel n, Event.noteNote n) keysDown) - Event.NoteEv Event.NoteOff n -> do - immediate ev + Event.NoteEv Event.NoteOff n -> loop (Set.delete (Event.noteChannel n, Event.noteNote n) keysDown) _ -> loop keysDown -- cgit v1.2.3