import { TimeMonzo, TimeReal } from './monzo'; import { Accidental, AugmentedQuality, IntervalQuality, VulgarFraction } from './pythagorean'; /** * Base degree for a mosstep in a 0-indexed array. */ export type MosDegree = { /** * The perfect or neutral central interval. */ center: TimeMonzo | TimeReal; /** * Flag to indicate if the degree has minor and major variants. */ imperfect: boolean; /** * The lopsided neutral variant of a bright or dark generator. */ mid?: TimeMonzo | TimeReal; }; /** * Configuration for a scale notated in Diamond mos. * May define a non-MOS scale as a result of accidental or intentional misconfiguration. */ export type MosConfig = { /** * Interval of equivalence. The distance between J4 and J5. */ equave: TimeMonzo | TimeReal; /** * Period of repetition. */ period: TimeMonzo | TimeReal; /** * Current value of the '&' accidental. */ am: TimeMonzo | TimeReal; /** * Current value of the 'e' accidental. */ semiam: TimeMonzo | TimeReal; /** * Relative scale from J onwards. Echelon depends on J. Use equave to reach higher octave numbers. */ scale: Map; /** * Intervals for relative notation. Use period to reach larger intervals. */ degrees: MosDegree[]; /** * Pattern for reconstructing the MOS declaration. */ pattern: string; /** * Value of the large step. */ large: TimeMonzo | TimeReal; /** * Value of the small step. */ small: TimeMonzo | TimeReal; }; /** * Generic 0-indexed mosstep. */ export type MosStep = { type: 'MosStep'; quality: IntervalQuality; augmentations?: AugmentedQuality[]; degree: number; }; /** * Accidental in Diamond-mos notation. * * & = Raises a note by a moschroma +(L-s) * e = Raises a note by half a moschroma +(L-s)/2 * a = Lowers a note by half a moschroma -(L-s)/2 * @ = Lowers a note by a moschroma -(L-s) */ export type MosAccidental = '&' | 'e' | 'a' | '@'; /** * Potentially fractional Diamond-mos accidental. */ export type SplitMosAccidental = { fraction: VulgarFraction; accidental: Accidental | MosAccidental; }; /** * Absolute Diamond-mos pitch. */ export type AbsoluteMosPitch = { type: 'AbsolutePitch'; nominal: string; accidentals: SplitMosAccidental[]; octave: number; }; /** * Obtain relative values for one equave-run of the given config of a MOS declaration with implicit unison. * @param config Result of a MOS declaration. * @returns An array of relative time monzos. */ export declare function scaleMonzos(config: MosConfig): (TimeReal | TimeMonzo)[]; /** * Convert a generic 0-indexed TAMNAMS mosstep to a relative time monzo. * @param node MosStep like P0ms. * @param config Result of a MOS declaration. * @returns A relative time monzo. */ export declare function mosMonzo(node: MosStep, config: MosConfig): TimeMonzo | TimeReal; /** * Convert a Diamond-mos note to a time monzo relative to J4 = C4. * @param node Absolute note like J@5. * @param config Result of a MOS declaration. * @returns A time monzo relative to J4. */ export declare function absoluteMosMonzo(node: AbsoluteMosPitch, config: MosConfig): TimeMonzo | TimeReal;