music-pitch-1.6.2: Abstract representation of musical pitch.

Portabilitynon-portable (TF,GNTD)
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellNone

Music.Pitch.Common.Spell

Contents

Description

Provides pitch spellings.

Synopsis

Spelling

About

TODO document better

The semitones function retrieves the number of Semitones in a pitch, for example

 semitones :: Interval -> Semitones
 semitones major third = 4

Note that semitones is surjetive. We can define a non-deterministic function spellings

 spellings :: Semitones -> [Interval]
 spellings 4 = [majorThird, diminishedFourth]

Law

 map semitones (spellings a) = replicate n a    for all n > 0

Lemma

 map semitones (spellings a)

Spelling type

type Spelling = Semitones -> NumberSource

  A spelling provide a way of notating a semitone interval such as tritone.

Examples:

 spell usingSharps tritone   == _A4
 spell usingFlats  tritone   == d5
 spell modally     tone      == _M2

spell :: HasSemitones a => Spelling -> a -> IntervalSource

Spell an interval using the given Spelling.

spelled :: HasSemitones a => a -> Spelling -> IntervalSource

Flipped version of spell. To be used infix, as in:

 d5 `spelled` usingSharps

Standard spellings

modally :: SpellingSource

Spell using the most the most common accidentals. Double sharps and flats are not preserved.

This spelling is particularly useful for modal music where the tonic is C.

 c cs d eb e f fs g gs a bb b

usingSharps :: SpellingSource

Spell using sharps. Double sharps and flats are not preserved.

 c cs d ds e f fs g gs a as b

usingFlats :: SpellingSource

Spell using flats. Double sharps and flats are not preserved.

 c db d eb e f gb g ab a bb b