]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - Reactogon/Note.hs
Moved to directory Reactogon
[tmp/julm/arpeggigon.git] / Reactogon / Note.hs
1 module Note where
2
3 import MIDI
4
5 changePitch :: (Pitch -> Pitch) -> Note -> Note
6 changePitch f (NoteOn p v) = NoteOn (f p) v
7 changePitch f (NoteOff p v) = NoteOff (f p) v
8
9 changeVelocity :: (Velocity -> Velocity) -> Note -> Note
10 changeVelocity f (NoteOn p v) = NoteOn p (f v)
11 changeVelocity f (NoteOff p v) = NoteOff p (f v)
12
13 perfectFifth :: Note -> Note
14 perfectFifth = changePitch (toPitch . (+7) . fromPitch)
15
16 majorThird :: Note -> Note
17 majorThird = changePitch (toPitch . (+4) . fromPitch)
18
19 minorThird :: Note -> Note
20 minorThird = changePitch (toPitch . (+3) . fromPitch)