Class Temperament

Temperament of a fractional just intonation subgroup represented as an element of a Clifford algebra.

Hierarchy

  • BaseTemperament
    • Temperament

Constructors

  • Construct a new temperament of a fractional just intonation subgroup.

    Parameters

    • algebra: typeof AlgebraElement

      Clifford algebra of with an all-positive metric and integer components.

    • value: AlgebraElement

      Element of the Clifford algebra representing the temperament.

    • subgroup: SubgroupValue

      Fractional just intonation subgroup defining what vectors of the algebra mean.

    Returns Temperament

Properties

algebra: typeof AlgebraElement

The Clifford algebra where the temperament is interpreted in. All-positive metric with integer coefficients.

subgroup: Subgroup

Fractional just intonation subgroup defining what vectors of the algebra mean.

value: AlgebraElement

An element of the Clifford algebra representing the temperament.

Accessors

  • get dimensions(): number
  • The size of the temperament's subgroup.

    Returns number

Methods

  • Calculate the change of basis mapping from primes to the generators of the temperament.

    Parameters

    • generators: number[][]

      Period and generators used as the new basis.

    • threshold: number = 1e-5

      Zero threshold used during the calculation.

    Returns number[][]

    Change of basis matrix as an array of arrays of numbers.

  • Parameters

    Returns number[]

  • Parameters

    Returns number[]

  • Canonize the temperament in-place into wedgie form. Remove a common factor and make the lexicographically first non-zero element positive.

    Returns Temperament

  • Factorize the temperament into commas.

    Parameters

    • maxDivisions: number = 99

      Maximum divisions of the equave to consider.

    Returns number[][]

    An array of commas that recreates the original temperament when passed to .fromCommas.

    Throws

    An error if the search space doesn't contain the factors.

  • Check if two temperaments are the same and have the same subgroup. Only checks numerical equality, canonize your inputs beforehand.

    Parameters

    Returns boolean

    true if the temperament is equal to the other.

  • Just intonation point of the subgroup.

    Parameters

    Returns Mapping

    Array of logarithms of the basis factors or the factors themselves if 'ratio' was specified.

  • Obtain the mapping vector for the temperament's subgroup or for consecutive primes if options.primeMapping is true.

    Parameters

    • Optional options: TuningOptions

      Options determining how the temperament is interpreted as a tuning and the units of the result.

    Returns Mapping

    A vector mapping (formal) primes to tempered versions of their logarithms in cents (default) or the specified pitch units.

  • Get the rank of the temperament i.e. the number of inpendent intervals in the tuning.

    Returns number

    The rank of the temperament.

  • Returns true if the temperament value is zero representing the trivial temperament of a single pitch only.

    Returns boolean

  • Calculate the true kernel join of two temperaments.

    Parameters

    • other: Temperament

      Another temperament in the same subgroup.

    • persistence: number = 100

      Search range for normalizing the result.

    • threshold: number = 1e-4

      Rounding threshold.

    Returns Temperament

    A temperament tempering out commas tempered out by either temperament.

  • Calculate the true kernel meet of two temperaments.

    Parameters

    • other: Temperament

      Another temperament in the same subgroup.

    • persistence: number = 100

      Search range for normalizing the result.

    • threshold: number = 1e-4

      Rounding threshold.

    Returns Temperament

    A temperament tempering out only the commas tempered out by both temperaments.

  • Obtain the number of periods per octave (or equave) and the generators in monzo form. The procedure assumes that the temperament is canonized.

    Returns [number, Monzo[]]

    A pair representing the number of periods per equave and the generators as monzos of the temperament's subgroup.

  • Obtain the period and generator of a rank 2 temperament.

    Parameters

    • Optional options: TuningOptions

      Options determining how the temperament is interpreted as a tuning and the units of the result.

    Returns number[]

    An array of [period, generators...] in cents (default) or the specified units.

  • Get a prefix of the temperament's full wedgie that may be used to reconstruct it. Potentially lossy compression.

    Parameters

    • Optional rank: number

      The rank of the temperament.

    Returns number[]

    The first few components of the temperament's wedgie that can be used to reconstruct the temperament if it's regular enough.

  • Parameters

    • value: AlgebraElement
    • persistence: number = 100
    • threshold: number = 1e-4

    Returns AlgebraElement

  • Calculate how many steps of the rank 1 temperament represents the given interval.

    Parameters

    • interval: MonzoValue

      Rational number representing a musical interval.

    • primeMapped: boolean = false

      Set to true if the interval is in monzo form and given in terms of consecutive prime exponents.

    Returns number

    The number of steps that represents the interval.

  • Tune a musical interval according to the temperament.

    Parameters

    • interval: MonzoValue

      Rational number representing a musical interval.

    • Optional options: TuningOptions

      Options determining how the temperament is interpreted as a tuning and the units of the result. Set options.primeMapping to true if the interval is in monzo form and given in terms of consecutive prime exponents.

    Returns number

    The interval tuned according to the temperament in cents (default) or the specified units.

  • Factorize the temperament into vals.

    Parameters

    • minDivisions: number = 2
    • maxDivisions: number = 99

      Maximum divisions of the equave to consider.

    • wartRadius: number = 0

      Maximum deviations from closest tunings to consider.

    • strategy: FactorizationStrategy = 'patent'

      Factorization strategy.

    Returns Val[]

    An array of vals that recreates the original temperament when passed to .fromVals.

    Throws

    An error if the search space doesn't contain the factors.

  • Calculate the true val join of two temperaments.

    Parameters

    • other: Temperament

      Another temperament in the same subgroup.

    • persistence: number = 100

      Search range for normalizing the result.

    • threshold: number = 1e-4

      Rounding threshold.

    Returns Temperament

    A temperament supported by all the vals supporting either temperament.

  • Calculate the true val meet of two temperaments.

    Parameters

    • other: Temperament

      Another temperament in the same subgroup.

    • persistence: number = 100

      Search range for normalizing the result.

    • threshold: number = 1e-4

      Rounding threshold.

    Returns Temperament

    A temperament supported only by the vals shared by both temperaments.

  • Construct a temperament tempering out all of the given commas.

    Parameters

    • commas: (FractionValue | Comma)[]

      An array of small musical intervals you want to map to unison.

    • Optional subgroup: SubgroupValue

      Fractional just intonation subgroup. A prime subgroup is inferred from the commas if not given explicitly.

    • Optional primeMapping: boolean

      Should be set to true if the monzo is given in terms of prime exponents. Strips away excess components.

    Returns Temperament

    A Temperament instance mapping all of the given commas to unison.

  • Recover a temperament from its rank prefix.

    Parameters

    • rank: number

      Rank of the original temperament.

    • wedgiePrefix: number[]

      Array of integers obtained from Temperament.rankPrefix().

    • subgroup: SubgroupValue

      Subgroup of the original temperament.

    Returns Temperament

    The original temperament if reconstruction was possible.

  • Construct a temperament supported by all of the given vals.

    Parameters

    • vals: (string | number | Val)[]

      An array of step mappings for the subgroup's basis or strings in Wart Notation. In the warts the letters of the alphabet correspond to the subgroup's basis, not prime numbers.

    • subgroup: SubgroupValue

      Fractional just intonation subgroup such as '2.3.13/5'.

    Returns Temperament

    A Temperament instance supported by all of the given vals.

Generated using TypeDoc