Support suspended chords

I'm not sure how valuable it is to study all of the inversions of the suspended
chords. Maybe it is. I'll let the users decide.
This commit is contained in:
William Carroll 2020-04-12 23:32:00 +01:00
parent bf460fe5ac
commit 3ee1b1f670

View file

@ -169,6 +169,8 @@ may cause more problems than it solves.
-} -}
type ChordType type ChordType
= Major = Major
| Sus2
| Sus4
| Major7 | Major7
| MajorDominant7 | MajorDominant7
| Minor | Minor
@ -292,6 +294,12 @@ chordTypeName chordType =
Major -> Major ->
"major" "major"
Sus2 ->
"suspended 2"
Sus4 ->
"suspended 4"
Major7 -> Major7 ->
"major 7th" "major 7th"
@ -388,6 +396,26 @@ intervalsForChordType chordType chordInversion =
( Major, Second ) -> ( Major, Second ) ->
[ down (NHalves 5), up MajorThird ] [ down (NHalves 5), up MajorThird ]
-- Sus2
( Sus2, Root ) ->
[ up Whole, up PerfectFifth ]
( Sus2, First ) ->
[ down (NHalves 10), down (NHalves 5) ]
( Sus2, Second ) ->
[ down (NHalves 5), up Whole ]
-- Sus4
( Sus4, Root ) ->
[ up (NHalves 5), up PerfectFifth ]
( Sus4, First ) ->
[ down (NHalves 7), down (NHalves 5) ]
( Sus4, Second ) ->
[ down (NHalves 5), up (NHalves 5) ]
-- Major7 -- Major7
( Major7, Root ) -> ( Major7, Root ) ->
[ up MajorThird, up PerfectFifth, up MajorSeventh ] [ up MajorThird, up PerfectFifth, up MajorSeventh ]
@ -816,6 +844,8 @@ allInversions =
allChordTypes : List ChordType allChordTypes : List ChordType
allChordTypes = allChordTypes =
[ Major [ Major
, Sus2
, Sus4
, Major7 , Major7
, MajorDominant7 , MajorDominant7
, Minor , Minor