diff options
Diffstat (limited to 'midi-dump.hs')
-rw-r--r-- | midi-dump.hs | 5 |
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 | ||
244 | processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat | 243 | processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat |
245 | processCommand "C" = do | 244 | processCommand "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 | ||
282 | saveEvents :: FilePath -> [RecordedEvent] -> MidiController () | 281 | saveEvents :: FilePath -> [RecordedEvent] -> MidiController () |
283 | saveEvents file evts@(_:_) = backgroundWithWait $ Codec.Midi.exportFile file (toSingleTrackMidi evts) | 282 | saveEvents file evts@(_:_) = backgroundWithWait $ do |
283 | Codec.Midi.exportFile file (toSingleTrackMidi evts) | ||
284 | liftIO $ putStrLn $ "Saved to " ++ file | ||
284 | saveEvents _ _ = return () | 285 | saveEvents _ _ = 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 |