Construct a musical interval.
A time monzo representing the size and echelon (frequency vs. frequency ratio) of the interval.
Domain determining what addition means.
A steps offset used in tempering.
Optionalnode: IntervalLiteralNode in the abstract syntax tree used for string representation.
Optionalconvert: IntervalAnother Interval instance to obtain CSS color, note label and tracking information from.
OptionalcolorOptionalnodeCalculate the absolute value of a linear interval or obtain a logarithmic intervals distance to unison.
Absolute value of this interval.
Convert the interval to a virtual AST node representing the universal type.
Boolean flag to format everything explicitly.
A virtual monzo literal.
Remove stored context-dependent formatting information. (Triggered by a context shift.)
Return a number suitable for Array.sort() to indicate the size of this interval w.r.t. the other.
Another interval.
A number that's less than zero if this is less than other, zero if equal and greater than zero otherwise.
Divide two linear intervals or take the root of the underlying value of a logarithmic interval with respect to a linear one. The ratio of two logarithmic intervals is a linear scalar equal to the logdivision of the underlying values.
Another interval.
The ratio of the intervals.
Apply a down arrow to this interval.
Current root context with the value of "down" to apply.
How many down arrows to apply.
A new interval with size decreased by the current "up" value.
Apply a drop to this interval.
Current root context with the value of "drop" to apply.
A new interval with size decreased by the current "lift" value.
Check if this interval has the same size as another.
Another interval.
true if this has the same size as the other.
Return true if the interval could be interpreted as a frequency.
Return true if this interval is only composed of abstract edosteps.
true if the interval is a unit scalar, possibly with edosteps, false otherwise.
Return true if the interval represents a ratio of frequencies.
Apply a lift to this interval.
Current root context with the value of "lift" to apply.
A new interval with size increased by the current "lift" value.
Calculate the modulus of a linear interval with respect to another or reduce (repeatedly divide) the underlying value of a logarithmic interval by another.
Another interval.
If true x.mmod(x) evaluates to x.
This interval modulo other.
Negate the frequency/value of a linear interval or reflect a logarithmic interval about the unison.
Negative counterpart of this interval.
(This method is an optimization detail.) Convert aspiring nodes to true AST nodes for formatting.
Current root context with information about root pitch and size of ups and lifts.
A true AST node suitable for string conversion or undefined realization is impossible in the given context.
Convert this interval to a string that faithfully represents it ignoring formatting, colors and labels. Doesn't depend on the current root context.
String that has the same value and domain as this interval if evaluated as a SonicWeave expression.
Calculate the square root of the underlying value regardless of domain.
The square root.
Convert this interval to a string that faithfully represents it ignoring colors and labels.
Optionalcontext: RootContextCurrent root context with information about root pitch and size of ups and lifts.
String that has the same value and domain as this interval if evaluated as a SonicWeave expression.
Check for strict equality between this and another interval.
Another interval.
true if the values share the same time exponent, prime exponents, residual and cents offset and the domains match.
Convert the interval to a fraction in linear space.
Convert the interval to an integer.
Serialize the time monzo to a JSON compatible object.
The serialized object with property type set to 'Interval'.
Convert this interval to a string that faithfully represents it including color and label.
Optionalcontext: RootContextCurrent root context with information about root pitch and size of ups and lifts.
Boolean flag to always include label and color.
String that has the same value and domain as this interval if evaluated as a SonicWeave expression.
Return the size of the interval in cents.
Compute the size of the absolute value.
Apply an up arrow to this interval.
Current root context with the value of "up" to apply.
A new interval with size increased by the current "up" value.
Convert a relative interval to a real number representing a ratio of frequencies. Convert an absolute interval to the scalar of its time unit.
A real number.
StaticfromStaticfromStaticfromConstruct a linear domain interval from a real number.
Musical interval representing a (possibly irrational) frequency ratio.
StaticreviverRevive an Interval instance produced by Interval.toJSON(). Return everything else as is.
Intended usage:
const data = JSON.parse(serializedData, Interval.reviver);
Property name.
Property value.
Deserialized Interval instance or other data without modifications.
A musical interval associated with a domain, an AST node, CSS color, note label and tracking identifiers.