type Note = string; type NoteName = string; type Chord = string; type Scale = string; // example: "C major" type ScaleName = string; // example: "major" type Interval = string; type Chroma = string; type ChromaNumber = number; type ModeName = string; type ScaleProps = { name: Scale; names: Scale[]; intervals: Interval[]; chroma: Chroma; setnum: ChromaNumber; }; /** * Get scale properties. It returns an object with: * - name: the scale name * - names: a list with all possible names (includes the current) * - intervals: an array with the scale intervals * - chroma: scale croma (see pcset) * - setnum: scale chroma number * * @function * @param {string} name - the scale name (without tonic) * @return {Object} */ export declare const props: (name: string) => ScaleProps; /** * Return the available scale names * * @function * @param {boolean} aliases - true to include aliases * @return {Array} the scale names * * @example * Scale.names() // => ["maj7", ...] */ export declare const names: (aliases?: boolean) => string[]; /** * Given a scale name, return its intervals. The name can be the type and * optionally the tonic (which is ignored) * * It retruns an empty array when no scale found * * @function * @param {string} name - the scale name (tonic and type, tonic is optional) * @return {Array} the scale intervals if is a known scale or an empty * array if no scale found * @example * Scale.intervals("major") // => [ "1P", "2M", "3M", "4P", "5P", "6M", "7M" ] */ export declare const intervals: (name: ScaleName | Scale) => Interval[]; /** * Get the notes (pitch classes) of a scale. * * Note that it always returns an array, and the values are only pitch classes. * * @function * @param {string} nameOrTonic - the scale name or tonic (if 2nd param) * @param {string} [name] - the scale name without tonic * @return {Array} a pitch classes array * * @example * Scale.notes("C", "major") // => [ "C", "D", "E", "F", "G", "A", "B" ] * Scale.notes("C major") // => [ "C", "D", "E", "F", "G", "A", "B" ] * Scale.notes("C4", "major") // => [ "C", "D", "E", "F", "G", "A", "B" ] * Scale.notes("A4", "no-scale") // => [] * Scale.notes("blah", "major") // => [] */ export declare function notes( nameOrTonic: Note | ScaleName, name?: ScaleName ): string[]; /** * Check if the given name is a known scale from the scales dictionary * * @function * @param {string} name - the scale name * @return {Boolean} */ export declare function exists(name: ScaleName): boolean; /** * Given a string with a scale name and (optionally) a tonic, split * that components. * * It retuns an array with the form [ name, tonic ] where tonic can be a * note name or null and name can be any arbitrary string * (this function doesn"t check if that scale name exists) * * @function * @param {string} name - the scale name * @return {Array} an array [tonic, name] * @example * Scale.tokenize("C mixolydean") // => ["C", "mixolydean"] * Scale.tokenize("anything is valid") // => ["", "anything is valid"] * Scale.tokenize() // => ["", ""] */ export declare function tokenize(name: ScaleName): [NoteName, ScaleName]; /** * Find mode names of a scale * * @function * @param {string} name - scale name */ export declare const modeNames: (name: ScaleName) => ModeName[]; /** * Get all chords that fits a given scale * * @function * @param {string} name */ export declare const chords: (name: Scale) => Chord[]; /** * Given an array of notes, return the scale: a pitch class set starting from * the first note of the array * * @function * @param {Array} notes * @return {Array} */ export declare const toScale: (notes: Note[]) => NoteName[]; /** * Get all scales names that are a superset of the given one * (has the same notes and at least one more) * * @function * @param {string} name * @return {Array} a list of scale names */ export declare const supersets: (name: ScaleName) => ScaleName[]; /** * Find all scales names that are a subset of the given one * (has less notes but all from the given scale) * * @function * @param {string} name * @return {Array} a list of scale names */ export declare const subsets: (name: ScaleName) => ScaleName[];