6 isOn (NoteOn _ _) = True
12 changePitch :: (Pitch -> Pitch) -> Note -> Note
13 changePitch f (NoteOn p v) = NoteOn (f p) v
14 changePitch f (NoteOff p v) = NoteOff (f p) v
16 changeVelocity :: (Velocity -> Velocity) -> Note -> Note
17 changeVelocity f (NoteOn p v) = NoteOn p (f v)
18 changeVelocity f (NoteOff p v) = NoteOff p (f v)
20 switchOnOff :: Note -> Note
21 switchOnOff (NoteOn p v) = NoteOff p v
22 switchOnOff (NoteOff p v) = NoteOn p v
24 perfectFifth :: Note -> Note
25 perfectFifth = changePitch (toPitch . (+7) . fromPitch)
27 majorThird :: Note -> Note
28 majorThird = changePitch (toPitch . (+4) . fromPitch)
30 minorThird :: Note -> Note
31 minorThird = changePitch (toPitch . (+3) . fromPitch)