hmt-0.14: Haskell Music Theory

Safe HaskellSafe-Inferred

Music.Theory.Pitch.Spelling

Description

Spelling rules for common music notation.

Synopsis

Documentation

type Spelling_M i = i -> Maybe (Note_T, Alteration_T)Source

Variant of Spelling for incomplete functions.

pc_spell_natural_m :: Integral i => Spelling_M iSource

Spelling for natural (♮) notes only.

 map pc_spell_natural_m [0,1] == [Just (C,Natural),Nothing]

pc_spell_natural :: Integral i => Spelling iSource

Erroring variant of pc_spell_natural_m.

 map pc_spell_natural [0,5,7] == [(C,Natural),(F,Natural),(G,Natural)]

pc_spell_ks :: Integral i => Spelling iSource

Use spelling from simplest key-signature. Note that this is ambiguous for 8, which could be either G Sharp (♯) in A Major or A Flat (♭) in E Flat (♭) Major.

 map pc_spell_ks [6,8] == [(F,Sharp),(A,Flat)]

pc_spell_sharp :: Integral i => Spelling iSource

Use always sharp (♯) spelling.

 map pc_spell_sharp [6,8] == [(F,Sharp),(G,Sharp)]
 Data.List.nub (map (snd . pc_spell_sharp) [1,3,6,8,10]) == [Sharp]
 octpc_to_pitch pc_spell_sharp (4,6) == Pitch F Sharp 4

pc_spell_flat :: Integral i => Spelling iSource

Use always flat (♭) spelling.

  map pc_spell_flat [6,8] == [(G,Flat),(A,Flat)]
  Data.List.nub (map (snd . pc_spell_flat) [1,3,6,8,10]) == [Flat]