UNPKG

12tet

Version:

Music theory library for generating and working with chords, modes, intervals, etc.

37 lines (36 loc) 3.71 kB
import { Note } from "../note"; declare const INTERVAL_NAMES: readonly ["Perfect Unison", "Minor Second", "Major Second", "Minor Third", "Major Third", "Perfect Fourth", "Tritone", "Perfect Fifth", "Minor Sixth", "Major Sixth", "Minor Seventh", "Major Seventh", "Perfect Octave"]; export type IntervalName = typeof INTERVAL_NAMES[number]; export declare function isIntervalName(interval: any): interval is IntervalName; export declare const intervalNames: IntervalName[]; declare const ALTERNATE_INTERVAL_NAMES: readonly ["Semitone", "Tone", "Trisemitone", "Tritone", "Tritave", "Double Octave", "Diminished Second", "Augmented Unison", "Diminished Third", "Augmented Second", "Diminished Fourth", "Augmented Third", "Diminished Fifth", "Augmented Fourth", "Diminished Sixth", "Augmented Fifth", "Diminished Seventh", "Augmented Sixth", "Diminished Octave", "Augmented Seventh", "Minor Ninth", "Major Ninth", "Minor Tenth", "Major Tenth", "Perfect Eleventh", "Perfect Twelfth", "Minor Thirteenth", "Major Thirteenth", "Minor Fourteenth", "Major Fourteenth", "Perfect Fifteenth", "Diminished Ninth", "Augmented Octave", "Diminished Tenth", "Augmented Ninth", "Diminished Eleventh", "Augmented Tenth", "Diminished Twelfth", "Augmented Eleventh", "Diminished Thirteenth", "Augmented Twelfth", "Diminished Fourteenth", "Augmented Thirteenth", "Diminished Fifteenth", "Augmented Fourteenth", "Augmented Fifteenth", "Half Tone", "Half Step", "Whole Step"]; export type AlternateIntervalName = typeof ALTERNATE_INTERVAL_NAMES[number]; export declare function isAlternateIntervalName(interval: any): interval is AlternateIntervalName; export declare const alternateIntervalNames: AlternateIntervalName[]; declare const SHORT_INTERVAL_NAMES: readonly ["P1", "m2", "M2", "m3", "M3", "P4", "TT", "P5", "m6", "M6", "m7", "M7", "P8"]; export type ShortIntervalName = typeof SHORT_INTERVAL_NAMES[number]; export declare function isShortIntervalName(interval: any): interval is ShortIntervalName; export declare const shortIntervalNames: ShortIntervalName[]; declare const STANDARD_INTERVAL_DISTANCES: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; export type StandardIntervalDistance = typeof STANDARD_INTERVAL_DISTANCES[number]; export declare function isStandardIntervalDistance(intervalDistance: any): intervalDistance is StandardIntervalDistance; export declare const standardIntervalDistances: StandardIntervalDistance[]; export type ComplexIntervalDistance = number; export declare function isComplexIntervalDistance(intervalDistance: any): intervalDistance is ComplexIntervalDistance; export type IntervalDistance = StandardIntervalDistance | ComplexIntervalDistance; export declare function isIntervalDistance(intervalDistance: any): intervalDistance is IntervalDistance; export interface Interval { readonly length: IntervalDistance; readonly name: IntervalName; readonly shortName: ShortIntervalName; readonly alternateNames: AlternateIntervalName[]; readonly tension: number; } export declare function isInterval(interval: any): interval is Interval; export type IntervalIdentifier = IntervalName | ShortIntervalName | IntervalDistance | ComplexIntervalDistance | Interval; export declare function isIntervalIdentifier(intervalIdentifier: any): intervalIdentifier is IntervalIdentifier; export declare const intervalByShortIntervalName: Record<ShortIntervalName, Interval>; export declare function getIntervalBetweenIntervals(first: IntervalIdentifier, second: IntervalIdentifier): IntervalDistance; export declare function getIntervalBetweenNotes(first: Note, second: Note): Interval; export declare function interval(intervalIdentifier: IntervalIdentifier): Interval; export {};