Safe Haskell | None |
---|---|
Language | Haskell2010 |
Common pitch.
- data Accidental
- natural :: Accidental
- flat :: Accidental
- sharp :: Accidental
- doubleFlat :: Accidental
- doubleSharp :: Accidental
- isNatural :: Accidental -> Bool
- isFlattened :: Accidental -> Bool
- isSharpened :: Accidental -> Bool
- isStandardAccidental :: Accidental -> Bool
- data Name
- data Pitch
- mkPitch :: Name -> Accidental -> Pitch
- name :: Pitch -> Name
- accidental :: Pitch -> Accidental
- upDiatonicP :: Pitch -> DiatonicSteps -> Pitch -> Pitch
- downDiatonicP :: Pitch -> DiatonicSteps -> Pitch -> Pitch
- upChromaticP :: Pitch -> ChromaticSteps -> Pitch -> Pitch
- downChromaticP :: Pitch -> ChromaticSteps -> Pitch -> Pitch
- invertDiatonicallyP :: Pitch -> Pitch -> Pitch
- invertChromaticallyP :: Pitch -> Pitch -> Pitch
Accidentals
data Accidental Source
Accidental, represented as number of alterations. Generalized from natural and single/double sharp/flat to any number of steps.
Enum Accidental | |
Eq Accidental | |
Integral Accidental | |
Num Accidental | |
Ord Accidental | |
Real Accidental | |
Show Accidental | |
Alterable Accidental | |
(IsPitch a, Alterable a) => IsPitch (Accidental -> a) | Magic instance that allow us to write |
The natural accidental.
flat :: Accidental Source
The flat accidental.
The sharp accidental.
doubleFlat :: Accidental Source
The double flat accidental.
doubleSharp :: Accidental Source
The double sharp accidental.
Inspecting accidentals
isNatural :: Accidental -> Bool Source
Returns whether this is a natural accidental.
isFlattened :: Accidental -> Bool Source
Returns whether this is a flat, double flat etc.
isSharpened :: Accidental -> Bool Source
Returns whether this is a sharp, double sharp etc.
isStandardAccidental :: Accidental -> Bool Source
Returns whether this is a standard accidental, i.e. either a double flat, flat, natural, sharp or double sharp.
Name
Pitch
Pitch type.
mkPitch :: Name -> Accidental -> Pitch Source
Creates a pitch from name accidental.
accidental :: Pitch -> Accidental Source
Diatonic and chromatic pitch
upDiatonicP :: Pitch -> DiatonicSteps -> Pitch -> Pitch Source
downDiatonicP :: Pitch -> DiatonicSteps -> Pitch -> Pitch Source
upChromaticP :: Pitch -> ChromaticSteps -> Pitch -> Pitch Source
downChromaticP :: Pitch -> ChromaticSteps -> Pitch -> Pitch Source
invertDiatonicallyP :: Pitch -> Pitch -> Pitch Source
invertChromaticallyP :: Pitch -> Pitch -> Pitch Source