mezzo-0.2.0.2: Typesafe music composition

Copyright(c) Dima Szamozvancev
LicenseMIT
Maintainerds709@cam.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Mezzo.Model.Harmony.Functional

Description

Types and type functions modelling principles of functional harmony.

Synopsis

Documentation

data Quality Source #

The quality of a scale degree chord.

Constructors

MajQ 
MinQ 
DomQ 
DimQ 

data Degree d q k i where Source #

A scale degree chord in given key, on the given scale, with the given quality.

Constructors

DegChord :: Degree d q k i 

data Piece k l where Source #

A functionally described piece of music, built from multiple phrases.

Constructors

Cad :: Cadence k l -> Piece k l 
(:=) :: Phrase k l -> Piece k (n - l) -> Piece k n 

data Phrase k l where Source #

A phrase matching a specific functional progression.

Constructors

PhraseIVI :: Tonic k (l2 - l1) -> Dominant k l1 -> Tonic k (l - l2) -> Phrase k l

A tonic-dominant-tonic progression.

PhraseVI :: Dominant k l1 -> Tonic k (l - l1) -> Phrase k l

A dominant-tonic progression.

data Cadence k l where Source #

A cadence in a specific key with a specific length.

Constructors

AuthCad :: Degree V MajQ k Inv1 -> Degree I q k Inv0 -> Cadence k 2

Authentic cadence with major fifth chord.

AuthCad7 :: Degree V DomQ k Inv2 -> Degree I q k Inv0 -> Cadence k 2

Authentic cadence with dominant seventh fifth chord.

AuthCadVii :: Degree VII DimQ k Inv0 -> Degree I q k Inv0 -> Cadence k 2

Authentic cadence with diminished seventh chord.

AuthCad64 :: Degree I MajQ k Inv2 -> Degree V DomQ k Inv3 -> Degree I MajQ k Inv1 -> Cadence k 3

Authentic cadence with a cadential 6-4 chord

HalfCad :: Degree d q k i -> Degree V MajQ k Inv0 -> Cadence k 2

Half cadence ending with a major fifth chord.

DeceptCad :: Degree V DomQ k Inv0 -> Degree VI q k Inv2 -> Cadence k 2

Deceptive cadence from a dominant fifth to a sixth.

data Tonic k l where Source #

A tonic chord.

Constructors

TonMaj :: Degree I MajQ k Inv0 -> Tonic k 1

A major tonic chord.

TonMin :: Degree I MinQ k Inv0 -> Tonic k 1

A minor tonic chord.

data Dominant k l where Source #

A dominant chord progression.

Constructors

DomVM :: Degree V MajQ k i -> Dominant k 1

Major fifth dominant.

DomV7 :: Degree V DomQ k i -> Dominant k 1

Seventh chord fifth degree dominant.

DomVii0 :: Degree VII DimQ k i -> Dominant k 1

Diminished seventh degree dominant.

DomSD :: Subdominant k l1 -> Dominant k (l - l1) -> Dominant k l

Subdominant followed by dominant.

DomSecD :: Degree II DomQ k Inv0 -> Degree V DomQ k Inv2 -> Dominant k 2

Secondary dominant followed by dominant.

data Subdominant k l where Source #

A subdominant chord progression.

Constructors

SubIIm :: Degree II MinQ k i -> Subdominant k 1

Minor second subdominant.

SubIVM :: Degree IV MajQ k i -> Subdominant k 1

Major fourth subdominant.

SubIIImIVM :: Degree III MinQ k i1 -> Degree IV MajQ k i2 -> Subdominant k 2

Minor third followed by major fourth subdominant

SubIVm :: Degree IV MinQ k i -> Subdominant k 1

Minor fourth dominant.

type family PieceToChords (l :: Nat) (p :: Piece k l) :: Vector (ChordType 4) l where ... Source #

Convert a piece to chords.

Equations

PieceToChords l (Cad (c :: Cadence k l)) = CadToChords c 
PieceToChords l ((p :: Phrase k l1) := ps) = PhraseToChords l1 p ++. PieceToChords (l - l1) ps