diff options
Diffstat (limited to 'AlsaSeq.hs')
-rw-r--r-- | AlsaSeq.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | {-# LANGUAGE NondecreasingIndentation #-} | 1 | {-# LANGUAGE NondecreasingIndentation #-} |
2 | module AlsaSeq (withAlsaInit, parseAlsaEvents, forwardNoteEvent, cmdlineAlsaConnect, printChordLn, showChord) where | 2 | module AlsaSeq (withAlsaInit, parseAlsaEvents, forwardNoteEvent, cmdlineAlsaConnect, printChordLn, showChord, pitchList, showPitch) where |
3 | import qualified Sound.ALSA.Exception as AlsaExc | 3 | import qualified Sound.ALSA.Exception as AlsaExc |
4 | import qualified Sound.ALSA.Sequencer.Address as Addr | 4 | import qualified Sound.ALSA.Sequencer.Address as Addr |
5 | import qualified Sound.ALSA.Sequencer as SndSeq | 5 | import qualified Sound.ALSA.Sequencer as SndSeq |
@@ -40,7 +40,8 @@ showPitch x = | |||
40 | let (octave, pitch) = Haskore.Basic.Pitch.fromInt $ fromIntegral x | 40 | let (octave, pitch) = Haskore.Basic.Pitch.fromInt $ fromIntegral x |
41 | in Haskore.Basic.Pitch.classFormat pitch (show octave) | 41 | in Haskore.Basic.Pitch.classFormat pitch (show octave) |
42 | 42 | ||
43 | pitchWords set = map (showPitch . Event.unPitch) $ Set.toList set | 43 | pitchWords set = map showPitch $ pitchList set |
44 | pitchList set = map Event.unPitch $ Set.toList set | ||
44 | 45 | ||
45 | prettyNote :: Event.Note -> String | 46 | prettyNote :: Event.Note -> String |
46 | prettyNote (Event.Note noteChannel noteNote noteVelocity noteOffVelocity noteDuration) = | 47 | prettyNote (Event.Note noteChannel noteNote noteVelocity noteOffVelocity noteDuration) = |