1 module MIDI ( SampleRate
12 import Sound.MIDI.Message.Channel.Voice ( fromPitch
15 import qualified Sound.MIDI.Message.Channel.Voice as Voice
19 type Pitch = Voice.Pitch
20 type Velocity = Voice.Velocity
23 fromVoice :: Voice.T -> Maybe a
24 toVoice :: a -> Voice.T
26 data Note = NoteOn Pitch Velocity
27 | NoteOff Pitch Velocity
30 instance Voice Note where
31 fromVoice (Voice.NoteOn p v) = Just $ NoteOn p v
32 fromVoice (Voice.NoteOff p v) = Just $ NoteOff p v
34 toVoice (NoteOn p v) = Voice.NoteOn p v
35 toVoice (NoteOff p v) = Voice.NoteOff p v