sonic-weave
    Preparing search index...

    Class ValBasis

    A basis of a fractional just intonation subgroup.

    Index

    Constructors

    • Construct a basis for a fractional just intonation subgroup.

      Parameters

      • basis: number | TimeMonzo[]

        Array of basis elements or number of primes starting from 2.

      • Optionalnode: ValBasisLiteral

        Virtual AST node associated with this basis.

      Returns ValBasis

    Properties

    value: TimeMonzo[]

    Accessors

    • get dual(): TimeMonzo[]

      The geometric duals of the unnormalized Gram-Schmidt orthogonalized basis.

      Returns TimeMonzo[]

    • get nonPrimes(): TimeMonzo[]

      Basis elements that are not true prime numbers.

      Returns TimeMonzo[]

    • get numberOfComponents(): number

      Prime limit of the basis as a 0-based ordinal.

      Returns number

    • get ortho(): TimeMonzo[]

      The unnormalized Gram-Schmidt orthogonalized basis.

      Returns TimeMonzo[]

    • get size(): number

      Number of basis elements / number of dimensions

      Returns number

    • get tenneyGram(): GramResult

      The unnormalized Gram-Schmidt process applied to tenney-weighted coordinates.

      Returns GramResult

    • get tenneyValue(): number[][]

      The value of this basis weighted with the logarithms of the primes.

      Returns number[][]

    Methods

    • Convert a subgroup monzo in this basis to the standard basis.

      Parameters

      • subgroupMonzo: ProtoFractionalMonzo

        Subgroup monzo in this basis.

      Returns TimeMonzo

      Time monzo in the standard basis.

    • Check if this basis is the same as another.

      Parameters

      Returns boolean

      true if this basis is the same as the other.

    • Create a (2*n + 1)^d hypercube.

      Parameters

      • n: number

        Radius (max metric).

      • puncture: boolean = false

        Remove center.

      Returns TimeMonzo[]

    • Rebase intervals from the standard basis to this basis. Rebase vals from a foreign subgroup basis to this basis.

      Parameters

      Returns Interval

      The rebased value.

    • Rebase intervals from the standard basis to this basis. Rebase vals from a foreign subgroup basis to this basis.

      Parameters

      Returns Val

      The rebased value.

    • Check if this basis is only "pointing" along prime axis.

      Returns boolean

      true if all basis elements are powers of primes. false otherwise.

    • Check if this basis is the standard prime basis.

      Parameters

      • soft: boolean = false

        Only check for primality, not length of basis.

      Returns boolean

      true if the basis consists of prime numbers in order.

    • Perform Lenstra-Lenstra-Lovász basis reduction.

      Parameters

      • weighting: "none" | "tenney"

        Weighting to use when judging basis angles and lengths.

      Returns ValBasis

      A reduced ValBasis instance.

    • Respell an interval to a simpler comma-equivalent one using a variant of Babai's nearest plane algorithm for approximate CVP.

      Parameters

      • monzo: TimeMonzo

        The rational interval to reduce.

      • weighting: "none" | "tenney"

      Returns TimeMonzo

      The reduced interval.

    • Fix a map in this basis to the standard basis.

      Parameters

      • map: TuningMap

        Tuning map of this basis' elements to cents.

      Returns TuningMap

      Tuning map of primes to cents.

    • Check if this basis is strictly the same as another.

      Parameters

      Returns boolean

      true if this basis is strictly the same as the other.

    • Obtain the minimal prime basis this basis is embedded in.

      Returns ValBasis

      The super-basis.

    • Convert this basis to an array of linear intervals.

      Returns Interval[]

      The basis elements as Interval instances.

    • Convert a time monzo in the standard basis to this basis and leave a residual of the unconverted tail.

      Parameters

      Returns [FractionalMonzo, TimeMonzo]

      Subgroup monzo and a standard residual outside of this basis.

    • Convert this basis to a string that faithfully represents it.

      Returns string

      String that has the same value as this basis if evaluated as a SonicWeave expression.

    • Convert a time monzo in the standard basis to this basis.

      Parameters

      Returns Monzo

      Subgroup monzo with integer coefficients.

      An error if the standard monzo is not integral in this basis.

    • Convert this basis to a virtual AST fragment compatible with wart notation.

      Returns WartBasisElement[]

      Array of wart basis elements.