Portability | non-portable (TF,GNTD) |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
Provides pitch spellings.
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 sharps tritone == _A4 spell flats tritone == d5 spell modal tone == _M2
spell :: HasSemitones a => Spelling -> a -> IntervalSource
Spell an interval using the given Spelling
.
spelledWith :: HasSemitones a => a -> Spelling -> IntervalSource
Flipped version of spell
. To be used infix, as in:
d5 `spelledWith` sharps
Standard spellings
Spell using the most the most common accidentals. Double sharps and flats are not preserved.
This spelling is particularly useful for modal music with C or F as tonic.
c cs d eb e f fs g gs a bb b
Spell using sharps. Double sharps and flats are not preserved.
c cs d ds e f fs g gs a as b