5 isNoteOn :: Message -> Bool
6 isNoteOn (NoteOn _ _ _) = True
9 isNoteOff :: Message -> Bool
10 isNoteOff (NoteOff _ _ _) = True
13 changePitch :: (Pitch -> Pitch) -> Message-> Message
14 changePitch f (NoteOn c p v) = NoteOn c (f p) v
15 changePitch f (NoteOff c p v) = NoteOff c (f p) v
17 changeVelocity :: (Velocity -> Velocity) -> Message-> Message
18 changeVelocity f (NoteOn c p v) = NoteOn c p (f v)
19 changeVelocity f (NoteOff c p v) = NoteOff c p (f v)
21 switchOnOff :: Message-> Message
22 switchOnOff (NoteOn c p v) = NoteOff c p v
23 switchOnOff (NoteOff c p v) = NoteOn c p v
25 perfectFifth :: Message-> Message
26 perfectFifth = changePitch (toPitch . (+7) . fromPitch)
28 majorThird :: Message-> Message
29 majorThird = changePitch (toPitch . (+4) . fromPitch)
31 minorThird :: Message-> Message
32 minorThird = changePitch (toPitch . (+3) . fromPitch)