Step index whose frequency is Tuning.refFreq.
Frequency in Hz of Tuning.refStep.
Equal divisions of the octave; 12 is the standard temperament.
A copy of the underlying plain tuning table.
StaticofWrap a plain tuning table.
Every field is read off the table, so a deserialized or hand-written one cannot enter carrying a division count or a reference frequency no frequency follows from. None of the three has a default here, unlike Tuning.edo: a table that lost its reference frequency on the way through storage is refused rather than quietly retuned to A=440.
The plain tuning table.
The wrapped tuning.
StaticedoBuild an equal temperament with divisions divisions of the octave.
Divisions of the octave (e.g. 19, 24, 31).
OptionalrefFreq: number
Reference frequency in Hz; 440 by default.
OptionalrefStep: number
Step index of the reference; 69 by default, the MIDI number of A4.
The tuning.
StatictwelveStandard twelve-tone equal temperament, A4 (MIDI 69) = 440 Hz.
The tuning in which a step index is an ordinary MIDI number.
StaticfromRebuild a tuning from the plain table Tuning.data hands out.
The plain tuning table.
The wrapped tuning.
If the table describes no temperament; see Tuning.of.
StaticfromRebuild a tuning from its Tuning.toJSON output.
The serialized tuning table.
The wrapped tuning.
If the table describes no temperament; see Tuning.of.
StaticratioCents of a frequency ratio, e.g. 3:2 for the just perfect fifth.
A ratio is a relation between two frequencies rather than a place in a temperament, so this is the same figure under every tuning.
Ratio numerator.
Ratio denominator.
The interval in cents.
StaticcentsThe frequency ratio an interval in cents spans, the inverse of Tuning.ratioToCents. Multiply a frequency by it to move the pitch by that many cents.
The interval in cents.
The frequency ratio.
StaticcentsInterval in cents between two frequencies.
Lower/first frequency in Hz.
Upper/second frequency in Hz.
Cents from a to b, negative when b is lower.
StaticjustCents by which a five-limit just interval departs from its 12-TET tempering; positive means the just interval is the wider one.
Semitone class in [0, 12].
The deviation in cents.
Frequency in Hz of a note.
The note's MIDI number is read as a step index, which is how the tuning module numbers steps: under twelve divisions the two coincide, and under any other the step index keeps counting from the same reference.
A note name, a MIDI number, plain note data, or a Note; it
must carry an octave, since a bare pitch class has no frequency.
A temperament to read the note under instead of this one.
The frequency in Hz.
Frequency in Hz of a step index.
The step-numbered form of Tuning.frequencyOf, for the steps of a temperament that no twelve-tone note names.
Step index; a MIDI number under twelve divisions.
A temperament to read the step under instead of this one.
The frequency in Hz.
Nearest step index to a frequency, the rounded inverse of Tuning.frequencyOfStep.
Frequency in Hz.
A temperament to read the frequency under instead of this one.
The nearest step index.
Step index of a frequency, unrounded.
The exact inverse of Tuning.frequencyOfStep, keeping how far off the pitch sits — the figure a tuner display or a pitch-bend amount is built on, which Tuning.nearestStep rounds away.
Frequency in Hz.
A temperament to read the frequency under instead of this one.
The fractional step index.
How far a frequency sits from its nearest step, in cents; positive means sharp of the step, negative flat.
Frequency in Hz.
A temperament to read the frequency under instead of this one.
The signed deviation in cents.
Cents spanned by a number of steps.
Number of steps.
A temperament to measure the steps in instead of this one.
The cents.
Steps spanned by an interval in cents, unrounded — the inverse of Tuning.centsOfSteps.
The interval in cents.
A temperament to measure the interval in instead of this one.
The fractional step count.
Whether another tuning divides the octave the same way from the same reference pitch.
The tuning to compare with.
True when reference step, reference frequency, and divisions all match.
The plain tuning table, for JSON serialization.
Private class fields do not serialize, so an explicit toJSON keeps
JSON.stringify(tuning) from collapsing to {}.
A copy of the reference step, reference frequency, and divisions.
An immutable equal temperament: a reference pitch and a number of equal divisions of the octave, with the conversions of the tuning module bound to it. A thin convenience wrapper over a plain TuningTable.
Every conversion still takes a temperament of its own, defaulting to this one, so nothing the tuning functions offer is out of reach from the class — two temperaments can be read from a single object.
Example