mezzo-0.3.1.0: Typesafe music composition

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

Mezzo.Model.Rules.Strict

Description

Types and constraints encoding the rules of classical music.

Synopsis

Documentation

class ValidMelConcatStrict ps1 ps2 Source #

Ensures that two partitures can be horizontally concatenated.

Two part lists can be horizontally concatenated if

  • both of them are empty or
  • all of the voices can be appended.

Instances

ValidMelConcatStrict l2 0 l1 (None (OptVector PitchType l1)) (None (OptVector PitchType l2)) Source # 
(ValidMelAppendStrict l2 l1 v1 v2, ValidMelConcatStrict l2 ((-) n 1) l1 vs1 vs2) => ValidMelConcatStrict l2 n l1 ((:--) (Voice l1) n v1 vs1) ((:--) (Voice l2) n v2 vs2) Source # 

class ValidMelIntervalStrict e i Source #

Ensures that melodic intervals are valid.

A melodic interval is invalid if it is

  • any augmented interval or
  • any diminished interval or
  • any seventh interval.

Instances

ValidMelIntervalStrict e i Source # 
PitchPairError Constraint "Compound intervals are not permitted in melody: " e => ValidMelIntervalStrict e Compound Source # 
PitchPairError Constraint "Seventh intervals are not permitted in melody: " e => ValidMelIntervalStrict e (Interval a Seventh) Source # 
PitchPairError Constraint "Diminished melodic intervals are not permitted: " e => ValidMelIntervalStrict e (Interval Dim a) Source # 
PitchPairError Constraint "Augmented melodic intervals are not permitted: " e => ValidMelIntervalStrict e (Interval Aug a) Source # 
ValidMelIntervalStrict e (Interval Aug Unison) Source # 

class ValidHarmConcat ps Source #

Ensures that two partitures can be vertically concatenated.

Two partitures can be vertically concatenated if

  • the top one is empty or
  • all but the first voice can be concatenated, and the first voice forms valid harmonic dyads with every other voice and follows the rules of valid harmonic motion.

Instances

(ValidHarmConcat ((-) n1 1) n2 l ((,) (Partiture ((-) n1 1) l) (Partiture n2 l) vs us), AllSatisfyAll n2 (Voice l) ((:) (Voice l -> Constraint) (ValidHarmDyadsInVectors l v) ((:) (Voice l -> Constraint) (ValidHarmMotionInVectors l l v) ([] (Voice l -> Constraint)))) us) => ValidHarmConcat n1 n2 l ((,) (Vector (Voice l) n1) (Partiture n2 l) ((:--) (Voice l) n1 v vs) us) Source # 
ValidHarmConcat 0 n2 l ((,) (Vector (OptVector PitchType l) 0) (Partiture n2 l) (None (OptVector PitchType l)) vs) Source # 

class ValidHomConcat ps Source #

Ensures that two partitures can be vertically concatenated.

Two partitures can be vertically concatenated if

  • the top one is empty or
  • all but the first voice can be concatenated, and the first voice forms valid harmonic dyads with every other voice and follows the rules of valid harmonic motion.

Instances

(ValidHomConcat ((-) n1 1) n2 l ((,) (Partiture ((-) n1 1) l) (Partiture n2 l) vs us), AllSatisfyAll n2 (Voice l) ((:) (Voice l -> Constraint) (ValidHarmDyadsInVectors l v) ([] (Voice l -> Constraint))) us) => ValidHomConcat n1 n2 l ((,) (Vector (Voice l) n1) (Partiture n2 l) ((:--) (Voice l) n1 v vs) us) Source # 
ValidHomConcat 0 n2 l ((,) (Vector (OptVector PitchType l) 0) (Partiture n2 l) (None (OptVector PitchType l)) vs) Source # 

class ValidMelMatrixMotion ps1 ps2 Source #

Ensures that two partitures follow the rules of motion when horizontally concatenated.

Two horizontally concatenated partitures follow the rules of harmonic motion if

  • both are empty or
  • their lower voices can be concatenated and the joining elements of the top voice form intervals with the joining elements of the other voices which follow the rules of harmonic motion.

Instances

ValidMelMatrixMotion l2 0 l1 (None (OptVector PitchType l1)) (None (OptVector PitchType l2)) Source # 
(ValidMelMatrixMotion l2 ((-) n 1) l1 vs1 vs2, AllPairsSatisfy' ((-) n 1) (Voice l2) (Voice l1) (ValidMelPitchVectorMotion l2 l1 (Last PitchType l1 v1) (Head PitchType l2 v2)) vs1 vs2) => ValidMelMatrixMotion l2 n l1 ((:--) (OptVector PitchType l1) n v1 vs1) ((:--) (OptVector PitchType l2) n v2 vs2) Source # 

class ValidChordType c Source #

Ensures that the chord is not a major seventh chord.

Instances

ValidChordType 2 (Dyad r t i) Source # 
ValidChordType 3 (Triad r t i) Source # 
ValidChordType 4 (Tetrad r t i) Source # 
ChordError Constraint "Major seventh chords are not permitted: " r " Maj7" => ValidChordType 4 (Tetrad r MajSeventh i) Source #