Copyright | (c) Dima Szamozvancev |
---|---|
License | MIT |
Maintainer | ds709@cam.ac.uk |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Types and type functions modelling harmonic chords.
- data TriadType
- data SeventhType
- data Inversion
- data TriType t = TriType
- data SevType t = SevType
- data Inv t = Inv
- type family InvertChord (c :: ChordType n) :: ChordType n where ...
- data ChordType :: Nat -> Type where
- Triad :: RootType -> TriadType -> Inversion -> ChordType 3
- SeventhChord :: RootType -> SeventhType -> Inversion -> ChordType 4
- data Cho c = Cho
- type family FromChord (c :: ChordType n) (l :: Nat) :: Partiture n l where ...
- type family ChordsToPartiture (v :: Vector (ChordType n) l) (d :: Nat) :: Partiture n (l * d) where ...
Chords
The type of a triad.
data SeventhType Source #
The type of a seventh chord.
The inversion of a chord.
type family InvertChord (c :: ChordType n) :: ChordType n where ... Source #
InvertChord (Triad r t Inv2) = Triad r t Inv0 | |
InvertChord (Triad r t i) = Triad r t (InvSucc i) | |
InvertChord (SeventhChord r t i) = SeventhChord r t (InvSucc i) |
data ChordType :: Nat -> Type where Source #
A chord type, indexed by the number of notes.
Triad :: RootType -> TriadType -> Inversion -> ChordType 3 | |
SeventhChord :: RootType -> SeventhType -> Inversion -> ChordType 4 |
(IntRep RootType r, FunRep TriadType Int [Int] t, FunRep Inversion [Int] [Int] i) => Primitive (ChordType 3) (Triad r t i) Source # | |
(IntRep RootType r, FunRep SeventhType Int [Int] t, FunRep Inversion [Int] [Int] i) => Primitive (ChordType 4) (SeventhChord r t i) Source # | |
(IntRep RootType r, FunRep TriadType Int [Int] tt, FunRep Inversion [Int] [Int] i) => Primitive (ChordType 4) (SeventhChord r (Doubled tt) i) Source # | |
type Rep (ChordType 3) (Triad r t i) Source # | |
type Rep (ChordType 4) (SeventhChord r t i) Source # | |
type Rep (ChordType 4) (SeventhChord r (Doubled tt) i) Source # | |
type family FromChord (c :: ChordType n) (l :: Nat) :: Partiture n l where ... Source #
Convert a chord to a partiture with the given length (one voice for each pitch).
FromChord c l = VectorToColMatrix (ChordToPitchList c) l |
type family ChordsToPartiture (v :: Vector (ChordType n) l) (d :: Nat) :: Partiture n (l * d) where ... Source #
ChordsToPartiture None l = None | |
ChordsToPartiture (c :-- cs) d = FromChord c d +|+ ChordsToPartiture cs d |