-- | Spelling rules for common music notation.
module Music.Theory.Pitch.Spelling where

import qualified Music.Theory.Pitch as T {- hmt -}
import qualified Music.Theory.Pitch.Spelling.Cluster as T {- hmt -}
import qualified Music.Theory.Pitch.Spelling.Key as T {- hmt -}
import qualified Music.Theory.Pitch.Spelling.Table as T {- hmt -}

spell_octpc_set :: [T.OctPc] -> [T.Pitch]
spell_octpc_set :: [OctPc] -> [Pitch]
spell_octpc_set [OctPc]
o =
  case [OctPc] -> Maybe [Pitch]
T.octpc_spell_implied_key [OctPc]
o of
    Just [Pitch]
r -> [Pitch]
r
    Maybe [Pitch]
Nothing ->
      case [OctPc] -> Maybe [Pitch]
T.spell_cluster_octpc [OctPc]
o of
        Just [Pitch]
r -> [Pitch]
r
        Maybe [Pitch]
Nothing -> forall a b. (a -> b) -> [a] -> [b]
map forall i. Integral i => Octave_PitchClass i -> Pitch
T.octpc_to_pitch_ks [OctPc]
o

spell_midi_set :: Integral i => [i] -> [T.Pitch]
spell_midi_set :: forall i. Integral i => [i] -> [Pitch]
spell_midi_set = [OctPc] -> [Pitch]
spell_octpc_set forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall m i. (Integral m, Integral i) => m -> Octave_PitchClass i
T.midi_to_octave_pitchclass