| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Harmonic.Rules.Types.Scale
Description
Vocabulary for the octatripentatonic framework: pentatonic families, the 28-mode taxonomy, the eleven canonical strata, and the twelve curated tristrata. E-minor-base chroma throughout.
Synopsis
- data PentaFamily
- = MajorPenta
- | Okinawan
- | Iwato
- | Kumoi
- familyChroma :: PentaFamily -> [PitchClass]
- data Pentatonic = Pentatonic {}
- pentaChroma :: Pentatonic -> [PitchClass]
- pentaFromChroma :: [PitchClass] -> Maybe Pentatonic
- data ModeQuality
- data Mode = Mode {}
- modeChroma :: Mode -> [PitchClass]
- classifyMode :: [PitchClass] -> Maybe Mode
- classifyModeAt :: Int -> [PitchClass] -> Maybe Mode
- data ScaleFamily
- modeFamily :: ModeQuality -> ScaleFamily
- modeDegree :: ModeQuality -> Int
- parentKey :: Mode -> (PitchClass, ScaleFamily)
- showScaleFamily :: ScaleFamily -> String
- showModeQuality :: ModeQuality -> String
- data ModeResult
- = ModeOk Mode
- | ModeInvalid [PitchClass]
- data StrataLabel
- strataChroma :: StrataLabel -> [PitchClass]
- strataDissonance :: StrataLabel -> Int
- allStrataLabels :: [StrataLabel]
- data Tristrata = Tristrata {
- ts1 :: StrataLabel
- ts2 :: StrataLabel
- ts3 :: StrataLabel
- validTristrata :: [Tristrata]
- tristrataIndex :: Int -> Tristrata
- tristrataStrataAt :: Tristrata -> Int -> StrataLabel
- tristrataDissonance :: Tristrata -> Int
- tristrataOf :: StrataLabel -> [(Tristrata, Int)]
- tristrataModes :: Tristrata -> (Maybe Mode, Maybe Mode, Maybe Mode)
- parseTristrataList :: String -> [Int]
- parseRelStrata :: String -> [Int]
- parseAbsStrata :: String -> [StrataLabel]
Pentatonic families
data PentaFamily Source #
Pentatonic family: the four ancestral pentatonic shapes recognised throughout the legacy theory (major, Okinawan, Iwato, Kumoi).
Constructors
| MajorPenta | |
| Okinawan | |
| Iwato | |
| Kumoi |
Instances
familyChroma :: PentaFamily -> [PitchClass] Source #
Chroma (pitch-class set) for a pentatonic family, rooted at 0.
data Pentatonic Source #
A pentatonic scale is a family + a root pitch class.
Constructors
| Pentatonic | |
Fields | |
Instances
| Show Pentatonic Source # | |
Defined in Harmonic.Rules.Types.Scale Methods showsPrec :: Int -> Pentatonic -> ShowS # show :: Pentatonic -> String # showList :: [Pentatonic] -> ShowS # | |
| Eq Pentatonic Source # | |
Defined in Harmonic.Rules.Types.Scale | |
| Ord Pentatonic Source # | |
Defined in Harmonic.Rules.Types.Scale Methods compare :: Pentatonic -> Pentatonic -> Ordering # (<) :: Pentatonic -> Pentatonic -> Bool # (<=) :: Pentatonic -> Pentatonic -> Bool # (>) :: Pentatonic -> Pentatonic -> Bool # (>=) :: Pentatonic -> Pentatonic -> Bool # max :: Pentatonic -> Pentatonic -> Pentatonic # min :: Pentatonic -> Pentatonic -> Pentatonic # | |
pentaChroma :: Pentatonic -> [PitchClass] Source #
Concrete chroma of a rooted pentatonic.
pentaFromChroma :: [PitchClass] -> Maybe Pentatonic Source #
Reverse lookup: given a 5-PC set, identify its family+root if any.
Mode taxonomy
data ModeQuality Source #
28-mode taxonomy ported from the legacy toMode function.
Constructors
Instances
A mode is a quality rooted at a pitch class.
Constructors
| Mode | |
Fields | |
modeChroma :: Mode -> [PitchClass] Source #
Concrete chroma of a rooted mode.
classifyMode :: [PitchClass] -> Maybe Mode Source #
Identify a 7-PC set as a mode by trying each element as root and pattern-matching against the 28 templates.
classifyModeAt :: Int -> [PitchClass] -> Maybe Mode Source #
Pinned-root classifier: identify a 7-PC set as a mode rooted on the
given pitch class, exhaustively checking the 28 mode quality patterns.
Mirrors legacy toMode semantics (root explicit, not inferred).
Returns Nothing when the set isn't 7 unique PCs or when no quality
matches the shifted interval pattern.
data ScaleFamily Source #
Each of the 28 ModeQuality constructors belongs to exactly one of four
parent scale families.
Constructors
| Major | |
| MelodicMinor | |
| HarmonicMinor | |
| HarmonicMajor |
Instances
modeFamily :: ModeQuality -> ScaleFamily Source #
Map a ModeQuality to its parent scale family.
modeDegree :: ModeQuality -> Int Source #
Semitone offset of each mode's tonic from its parent scale's root.
E.g. Aeolian sits on the 6th degree of major → 9 semitones above the
parent root → modeDegree Aeolian = 9.
parentKey :: Mode -> (PitchClass, ScaleFamily) Source #
Parent (root pitch class, family) for any mode. E.g.
parentKey (Mode Aeolian (P 1)) == (P 4, Major) — C# Aeolian is a mode
of E Major.
showScaleFamily :: ScaleFamily -> String Source #
Render a scale family as a human-readable string.
showModeQuality :: ModeQuality -> String Source #
data ModeResult Source #
Result of a triad-anchored mode classification. ModeOk carries a
normally classified mode; ModeInvalid carries the offending
pair-union pitch classes when the union doesn't have exactly 7 unique
PCs (only reachable under absStrata overrides that violate
tristrata adjacency).
Constructors
| ModeOk Mode | |
| ModeInvalid [PitchClass] |
Instances
| Show ModeResult Source # | |
Defined in Harmonic.Rules.Types.Scale Methods showsPrec :: Int -> ModeResult -> ShowS # show :: ModeResult -> String # showList :: [ModeResult] -> ShowS # | |
| Eq ModeResult Source # | |
Defined in Harmonic.Rules.Types.Scale | |
Strata
data StrataLabel Source #
The eleven canonical strata labels (Roman I–XI).
Instances
strataChroma :: StrataLabel -> [PitchClass] Source #
Chroma (E-minor base) of each strata.
strataDissonance :: StrataLabel -> Int Source #
Prime-form dissonance of each strata (from the octatripentatonic spec).
allStrataLabels :: [StrataLabel] Source #
All strata labels in order.
Tristrata
A tristrata is three strata whose pair-unions are diatonic 7-note sets
and whose three-way union is the canonical 8-note set [1,2,4,6,7,9,10,11].
Constructors
| Tristrata | |
Fields
| |
Instances
| Show Tristrata Source # | |
| Eq Tristrata Source # | |
| Ord Tristrata Source # | |
validTristrata :: [Tristrata] Source #
Twelve canonical tristrata (records 1..12 of the octatripentatonic corpus).
tristrataIndex :: Int -> Tristrata Source #
Index into validTristrata using a 1-based ordinal.
tristrataStrataAt :: Tristrata -> Int -> StrataLabel Source #
Project a tristrata to its strata at position 1, 2, or 3.
tristrataDissonance :: Tristrata -> Int Source #
Sum of prime-form dissonances of the tristrata's three strata.
tristrataOf :: StrataLabel -> [(Tristrata, Int)] Source #
All (tristrata, position) pairs that contain a given strata.
tristrataModes :: Tristrata -> (Maybe Mode, Maybe Mode, Maybe Mode) Source #
Classify the three pair-unions of a tristrata as diatonic modes.
Returns (mode(ts1∪ts2), mode(ts1∪ts3), mode(ts2∪ts3)).
Parsers
parseTristrataList :: String -> [Int] Source #
Parse a tristrata allow-list string to a list of 1-based indices.
"" → empty (meaning "all allowed"); "5" → [5]; "1 2 5" → [1,2,5].
parseRelStrata :: String -> [Int] Source #
Parse a per-bar position sequence (elements ∈ {1,2,3}).
parseAbsStrata :: String -> [StrataLabel] Source #
Parse a per-bar absolute strata sequence. Accepts "I V X" or "[I V X]".