Musical interval with preferred text formatting. Used for scale lines in format-aware scale generation. Note that the line type and formatting options are preferences and cannot always be enforced.

Constructors

  • Construct a new interval.

    Parameters

    • monzo: ExtendedMonzo

      Extended monzo representing the pitch information.

    • type: IntervalType

      Formatting type.

    • Optional name: string

      Arbitrary name for the interval, usually a short-form without a cents offset.

    • Optional options: IntervalOptions

      Formatting options.

    Returns Interval

Properties

name: string

Methods

  • Combine the interval with another in pitch-space.

    Parameters

    Returns Interval

    The product of the intervals in frequency-space.

  • Find the closest approximation of the interval in a harmonic series.

    Parameters

    • denominator: number

      Denominator of the harmonic series.

    Returns Interval

    The closest approximant in the series.

  • Find the closest approximation of the interval in a subharmonic series.

    Parameters

    • numerator: number

      Numerator of the subharmonic series.

    Returns Interval

    The closest approximant in the series.

  • Cents representation the interval. Example: '700.0'

    Parameters

    • offset: boolean = false

      Only represent the cents offset.

    Returns string

    The interval formatted as a decimal cents string.

  • Compare this interval with another.

    Parameters

    Returns number

    Result < 0 if other is larger than this. Result > 0 if other is smaller than this. Result == 0 if other is equal to this in size.

  • Frequency-space ratio representation of the interval. Example: '1,5'

    Returns string

    The interval formatted as a decimal ratio in frequency-space.

  • Inverse rescale the interval in pitch-space.

    Parameters

    • scalar: number | Fraction

      Inverse scaling factor.

    Returns Interval

    The rescaled interval.

  • Equal temperament representation of the interval. Example: '7\12'

    Returns string

    The interval formatted as an N-of-EDO or a generic EDJI.

  • Check if this interval has the same size as another.

    Parameters

    Returns boolean

    true if the intervals are of equal size.

  • Check if the interval is combination of fractional, equal temperament or cents parts.

    Returns boolean

    true if the interval is not simply fractional, equal temperament or pure cents.

  • Merge existing formatting options with new ones.

    Parameters

    Returns Interval

    The interval with the new formatting options.

  • Monzo representation of the interval. Example: '[-4, 4, -1>'

    Returns string

    The interval formatted as a monzo.

  • Rescale the interval in pitch-space.

    Parameters

    • scalar: number | Fraction

      Scaling factor.

    Returns Interval

    The rescaled interval.

  • Rescale the interval in pitch-space and store the offset as cents.

    Parameters

    • scalar: number

      Scaling factor.

    Returns Interval

    The rescaled interval where only the cents offset differs from the original.

  • Check for strict equality between this and another interval.

    Parameters

    Returns boolean

    true if the intervals share the same type, options, name, monzo vector, residual and cents offset.

  • Subtract another interval from this one in pitch-space.

    Parameters

    Returns Interval

    This interval divided by the other in frequency-space.

  • Format the interval according the interval type and formatting options. Also known as reverse parsing. May produce composite lines if there is no other option. May fall back to cents if composites are not allowed.

    Returns string

    The interval formatted as a string.

    Warns

    Prints warnings if fallback formats are triggered.

  • Convert the interval to cents.

    Returns number

    Size of the interval in cents.

  • Add a random cents offset to the interval.

    Parameters

    • maxCents: number

      Maximum possible offset.

    Returns Interval

    The interval with a random cents offset.

  • Unison that is compatible with the interval.

    Returns Interval

    The interval multiplied by zero in pitch-space.

Generated using TypeDoc