summaryrefslogtreecommitdiff
path: root/midi-dump.hs
diff options
context:
space:
mode:
Diffstat (limited to 'midi-dump.hs')
-rw-r--r--midi-dump.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/midi-dump.hs b/midi-dump.hs
index 56a1d50..5084258 100644
--- a/midi-dump.hs
+++ b/midi-dump.hs
@@ -240,7 +240,6 @@ processCommand "save" = do
240 recording <- gets _replay 240 recording <- gets _replay
241 filename <- chooseFileName recording 241 filename <- chooseFileName recording
242 saveRecording filename recording 242 saveRecording filename recording
243 liftIO $ putStrLn $ "Saved to " ++ filename
244processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat 243processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat
245processCommand "C" = do 244processCommand "C" = do
246 let notes = (Event.NoteEv Event.NoteOn . mkNote) <$> [60, 64, 67] 245 let notes = (Event.NoteEv Event.NoteOn . mkNote) <$> [60, 64, 67]
@@ -280,7 +279,9 @@ backgroundWithWait fn = do
280 modify $ \s -> s { _waitThreads = wait:_waitThreads s } 279 modify $ \s -> s { _waitThreads = wait:_waitThreads s }
281 280
282saveEvents :: FilePath -> [RecordedEvent] -> MidiController () 281saveEvents :: FilePath -> [RecordedEvent] -> MidiController ()
283saveEvents file evts@(_:_) = backgroundWithWait $ Codec.Midi.exportFile file (toSingleTrackMidi evts) 282saveEvents file evts@(_:_) = backgroundWithWait $ do
283 Codec.Midi.exportFile file (toSingleTrackMidi evts)
284 liftIO $ putStrLn $ "Saved to " ++ file
284saveEvents _ _ = return () 285saveEvents _ _ = return ()
285 286
286-- NOTE: The list must be in ascending order for this to work 287-- NOTE: The list must be in ascending order for this to work