module HarmTrace.Matching.SimpleChord (SimChord, Sim, toSimChords) where
import HarmTrace.Base.MusicRep
import HarmTrace.Matching.Sim
data SimChord = SimChord !Int
!Mode
instance Sim SimChord where
sim (SimChord r sh) (SimChord r2 sh2)
| r == r2 && sh == sh2 = 4
| otherwise = 1
instance Show SimChord where
show (SimChord r sh) = show (toScaleDegree (Key (Note Nothing C) MajMode)
(toRoot r))
++ if sh == MajMode then "" else "m"
toSimChords :: ChordDegree -> [SimChord]
toSimChords c = replicate (duration c) (SimChord (toSemitone . chordRoot $ c) m)
where m = case toTriad c of
NoTriad -> MinMode
t -> toMode t