summaryrefslogtreecommitdiff
path: root/Midi.hs
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2015-12-07 01:31:21 -0500
committerAndrew Cady <d@jerkface.net>2015-12-07 01:31:21 -0500
commit990bae4f495b80e38a2ca1c3f2fbe6482c2e6cc8 (patch)
tree2ba344f3f1265dcfe30e4cdf08c43da85039c9d1 /Midi.hs
parent9adf1aff92e1921203feeedf361deee1984fe2c6 (diff)
Implement playing MIDI from the database
Currently, the "dump" command plays the entire database. Only the SQL SELECT statement needs to be changed in order to play a specific time-range.
Diffstat (limited to 'Midi.hs')
-rw-r--r--Midi.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Midi.hs b/Midi.hs
index 402f683..cc14eb6 100644
--- a/Midi.hs
+++ b/Midi.hs
@@ -59,6 +59,11 @@ instance ToRow CompleteRecording where
59 where 59 where
60 (CompleteRecording (TimeSpec s ns) (TimeSpec s' ns') (TimeSpec s'' ns'') (TimeSpec s''' ns''') midi) = reco 60 (CompleteRecording (TimeSpec s ns) (TimeSpec s' ns') (TimeSpec s'' ns'') (TimeSpec s''' ns''') midi) = reco
61 61
62instance Monoid CompleteRecording where
63 mempty = CompleteRecording 0 0 0 0 []
64 (CompleteRecording s _e f _l evts) `mappend` (CompleteRecording _s' e' _f' l' evts') =
65 CompleteRecording s e' f l' (evts' ++ evts)
66
62maybesnd :: forall t t1. (t, Maybe t1) -> Maybe (t, t1) 67maybesnd :: forall t t1. (t, Maybe t1) -> Maybe (t, t1)
63maybesnd (_, Nothing) = Nothing 68maybesnd (_, Nothing) = Nothing
64maybesnd (x, Just y) = Just (x, y) 69maybesnd (x, Just y) = Just (x, y)