Musical scale consisting of Interval instances repeated at octaves or generic equaves.

Constructors

  • Construct a new musical scale.

    Parameters

    • intervals: Interval[]

      Intervals of the scale including 1/1, but not the interval of equivalence.

    • equave: Interval

      The interval of equivalence.

    • baseFrequency: number

      Base frequency of plain 1/1.

    Returns Scale

Properties

baseFrequency: number
equave: Interval
intervals: Interval[]

Accessors

  • get numberOfComponents(): number
  • Number of components in the monzo vector part of the scale's intervals.

    Returns number

  • get size(): number
  • Number of intervals in the scale.

    Returns number

Methods

  • Create a new scale where every interval is replace with the closest approximation in the given EDO/EDJI.

    Parameters

    • divisions: number

      Number of divisions per equave.

    Returns Scale

    A new scale of approximations in equal temperament.

  • Create a new scale where every interval is replace with the closest approximation in a harmonic series.

    Parameters

    • denominator: number

      Denominator/root of the harmonic series slice.

    Returns Scale

    A new scale of harmonic approximations.

  • Create a new scale where every interval is replace with the closest approximation in a subharmonic series.

    Parameters

    • numerator: number

      Numerator/root of the subharmonic series slice.

    Returns Scale

    A new scale of subharmonic approximations.

  • Convert the intervals in the scale to another type.

    Parameters

    Returns Scale

    A new scale of intervals with the new formatting type and options.

  • Create a new scale by concatenating this one with another. Duplicates unison and other scale degrees if present.

    Parameters

    • other: Scale

      Another scale with the same equave and base frequency.

    • deep: boolean = false

      Create new copies of the Interval instances.

    Returns Scale

    A new scale that includes all the intervals from both scales.

  • Remove intervals that do not fit between the unison and the equave.

    Returns Scale

    A variant of the scale where all intervals fit inside the equave.

  • Obtain the total cents of an interval in the scale (repeats at equaves).

    Parameters

    • index: number

      Zero-based index of the interval.

    Returns number

    Cents associated with the given index.

  • Obtain the frequency of an interval in the scale (repeats at equaves).

    Parameters

    • index: number

      Zero-based index of the interval.

    Returns number

    The frequency of an interval in the scale with equaves factored in as necessary.

  • Obtain a range of frequencies in the scale. More efficient to compute than getting individual frequencies.

    Parameters

    • start: number

      The smallest index to include.

    • end: number

      The end point end itself not included.

    Returns number[]

    An array of frequencies corresponding to the specified range.

  • Obtain an Interval of the scale (repeats at equaves).

    Parameters

    • index: number

      Zero-based index of the interval.

    Returns Interval

    An interval of the scale with equaves added as necessary.

  • Obtain the ExtendedMonzo of an interval in the scale (repeats at equaves).

    Parameters

    • index: number

      Zero-based index of the interval.

    Returns ExtendedMonzo

    An ExtendedMonzo of the scale with equaves added as necessary.

  • Obtain the name of an interval in the scale.

    Parameters

    • index: number

      Zero-based index of the interval.

    Returns string

    Name of an on interval in the scale without equaves factored in. The unison is named after the equave.

  • Obtain the ratio of an interval in the scale (repeats at equaves).

    Parameters

    • index: number

      Zero-based index of the interval.

    Returns number

    Ratio associated with the given index.

  • Obtain a subset of the scale up to the given index.

    Parameters

    • end: number

      Last index to include.

    Returns Scale

    A new scale with only the specified subset included.

  • Create a new scale with a new interval inserted.

    Parameters

    • degree: number

      Degree to insert after.

    • interval: Interval

      Interval to insert.

    • deep: boolean = false

      Create new copies of the Interval instances.

    Returns Scale

    A new scale with the new interval inserted.

  • Merge this scale with another, removing duplicates and sorting the result.

    Parameters

    • other: Scale

      Another scale.

    Returns Scale

    A new scale with intervals from both without duplicates.

  • Merge existing formatting options with new ones.

    Parameters

    Returns Scale

    A new scale of intervals with the new formatting options.

  • Reduce intervals in the scale by the equave.

    Returns Scale

    A variant of the scale where all intervals fit inside the equave.

  • Remove duplicate intervals in-place.

    Returns Scale

    This scale.

  • Repeat the scale at the equave and replace the old equave. Produces the same frequencies as the old scale.

    Parameters

    • numRepeats: number = 2

      Number of repeats.

    • deep: boolean = false

      Create new copies of the Interval instances.

    Returns Scale

    A new scale repeated numRepeats times.

  • Create a new scale with a degree of the scale replaced by another.

    Parameters

    • degree: number

      Index of the interval to replace.

    • replacement: Interval

      The interval to replace with.

    • deep: boolean = false

      Create new copies of the Interval instances.

    Returns Scale

    A new scale with the given interval spliced in.

  • Rotate the scale to a new mode.

    Parameters

    • numSteps: number = 1

      Number of steps to rotate by.

    Returns Scale

    Another mode of the scale.

  • Sort the scale in-place.

    Returns Scale

    The scale with intervals sorted from smallest to largest without touching the equave.

  • Construct a sorted copy of the scale. scale in-place.

    Parameters

    • deep: boolean = false

      Create new copies of the intervals instead just a new array with the old instances.

    Returns Scale

    The scale with intervals sorted from smallest to largest without touching the equave.

  • Stretch the scale using the given scaling factor.

    Parameters

    • scalar: number

      The scaling factor in pitch-space.

    Returns Scale

    A new streched scale.

  • Obtain a subset of the scale.

    Parameters

    • indices: number[]

      Indices of the intervals to include.

    • deep: boolean = false

      Create new copies of the Interval instances.

    Returns Scale

    A new scale with only the specified subset included.

  • Convert scale intervals to strings. Also known as reverse parsing.

    Returns string[]

    An array of textual scale lines.

  • Transpose the scale. WARNING: Moves the unison as well and doesn't reduce by the equave.

    Parameters

    • offset: Interval

      Interval to transpose by.

    Returns Scale

    A new transposed scale.

  • Create a new scale where a single degree has been transposed.

    Parameters

    • degree: number

      Degree to transpose.

    • offset: Interval

      Amount to transpose by.

    • deep: boolean = false

      Create new copies of the Interval instances.

    Returns Scale

    A new scale with a transposed degree.

  • Construct a variant of the scale with new intervals, but the same equave and base frequency.

    Parameters

    • intervals: Interval[]

      New intervals for the scale.

    Returns Scale

    A new scale with new intervals.

  • Add random variation to the intervals in the scale.

    Parameters

    • maxCents: number

      Maximum deviation in cents.

    • varyEquave: boolean = false

      Apply variation the the interval of equivalence.

    Returns Scale

    A new scale with variance added.

  • Construct a musical scale from a chord in (assumed) root position.

    Parameters

    • chord: Interval[]

      Array of intervals in the chord not neccessarily starting from 1/1.

    • baseFrequency: number = 440

      Base frequency of unison/root note of the chord.

    Returns Scale

    New musical scale transposed to start from 1/1.

  • Construct a musical scale from a combination product set.

    Parameters

    • factors: Interval[] | Set<Interval>

      Factors in the original set.

    • numElements: number

      Number of elements to multiply together in frequency-space in each combination.

    • addUnity: boolean

      Add 1/1 into the scale along with the combinations. If false the scale will be transposed to include a combination at unison.

    • equave: Interval

      Interval of equivalence.

    • baseFrequency: number = 440

      Base frequency of unison or the least product before reduction by the equave.

    Returns Scale

    A new combination product set reduced to fit inside the equave and sorted by size.

  • Construct a new musical scale from an array of intervals and their inverses.

    Parameters

    • basis: Interval[] | Set<Interval>

      Basis intervals of the cross polytope.

    • addUnity: boolean

      Include the center of the polytope.

    • equave: Interval

      Interval of equivalence.

    • baseFrequency: number = 440

      Base frequency of 1/1 or the least of interval of the polytope before reduction by the equave.

    Returns Scale

    A new musical in the form of a generalized octahedron in monzo space.

  • Construct a new Dwarf scale.

    Parameters

    • val: number

      Patent val.

    • equave: number

      Interval of equivalence. Anything other than 2 results in a generalized scale.

    • numberOfComponents: number

      Number of components in monzo vector parts.

    • baseFrequency: number = 440

      Base frequency of 1/1.

    Returns Scale

    A new Dwarf scale.

  • Construct a new musical scale that equally divides an interval in pitch-space.

    Parameters

    • divisions: number

      Number of notes per equave.

    • equave: Fraction

      Equave to divide.

    • numberOfComponents: number

      Number of components in monzo vector parts.

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale that equally divides the given equave.

    Throws

    An error if divisions is not an integer.

  • Construct a new musical scale from a subset of an equal temperament.

    Parameters

    • steps: number[]

      Intervals to include in the scale. The last step determines the EDO / ED of EDJI.

    • equave: Interval

      Interval to equally divide.

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale consisting of s1\N<equave>, s2\N<equave>, ..., N\N<equave>.

  • Construct a new Euler-Fokker genus.

    Parameters

    • guideTone: number

      Positive integer whose positive factors make up the scale.

    • equave: number

      Interval of equivalence. Anything other than 2 results in a generalized genus.

    • numberOfComponents: number

      Number of components in monzo vector parts.

    • baseFrequency: number = 440

      Base frequency of 1/1.

    Returns Scale

    A new Euler-Fokker scale.

  • Construct a new musical scale that equally divides an interval in pitch-space.

    Parameters

    • divisions: number

      Number of notes per equave. Doesn't have to be an integer.

    • equaveCents: number

      Size of the equave to divide in cents.

    • numberOfComponents: number

      Number of components in monzo vector parts.

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale that equally divides the given equave.

  • Construct a new musical scale from a slice of the harmonic series.

    Parameters

    • denominator: number

      Denominator of every interval in the scale.

    • greatestNumerator: number

      The largest numerator of an interval to include in the scale.

    • numberOfComponents: number

      Number of components in monzo vector parts.

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale of the form denominator / denominator, (denominator + 1) / denominator, ..., greatestNumerator / denominator.

  • Construct a new musical scale from an array of intervals.

    Parameters

    • intervals: Interval[]

      Intervals of the scale including the interval of equivalence, but not 1/1.

    • baseFrequency: number = 440

      Base frequency of plain 1/1.

    Returns Scale

    A new musical scale with the given intervals.

  • Construct a new musical scale from finite slice of a multi-dimensional interval lattice.

    Parameters

    • basis: Interval[]

      Basis intervals of the lattice.

    • dimensions: number[]

      Dimensions of the slice. Each integer determines how many times to stack a basis vector.

    • equave: Interval

      Interval of equivalence.

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale of the lattice slice reduced by the equave and sorted by sice.

  • Construct a new musical scale in the shape of a 4D octaplex/24-cell.

    Parameters

    • basis: Interval[] | Set<Interval>

      The four basis intervals of the octaplex.

    • addUnity: boolean

      Include the center of the octaplex.

    • equave: Interval

      Interval of equivalence.

    • baseFrequency: number = 440

      Base frequency of 1/1 or the least of interval of the octaplex before reduction by the equave.

    Returns Scale

    A new musical scale in the form of an octaplex in monzo space.

  • Construct a new musical scale by stacking a generating interval against a period.

    Parameters

    • generator: Interval

      The generating interval such as a fifth.

    • period: Interval

      The period of repetition such as a tritone.

    • size: number

      Size of the scale. Must be a multiple of the number of periods per equave.

    • down: number

      Number of steps to stack down. Stacking is distributed among the periods so down must be a multiple of the number of periods per equave.

    • numPeriods: number = 1

      Number of periods per equave. (Equave = period * numPeriods, in pitch-space)

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale resulting from stacking the generator, reducing by the period and stacking the result to fill the equave.

  • Construct a new musical scale from a slice of the subharmonic series.

    Parameters

    • numerator: number

      Numerator of every interval in the scale.

    • leastDenominator: number

      The smallest denominator of an interval to include in the scale.

    • numberOfComponents: number

      Number of components in monzo vector parts.

    • baseFrequency: number = 440

      Base frequency of unison.

    Returns Scale

    A new musical scale of the form numerator / numerator, numerator / (numerator - 1), ..., numerator / leastDenominator.

Generated using TypeDoc