# Tuner

> Passes audio through unchanged and shows the nearest degree of a microtonal tuning on its face. Mute silences it like a tuner pedal.

Source: https://docs.tune.toys/nodes/std.tuner/

A Tuner sits in an audio chain and shows how far the sound is from the nearest note, or degree, of a tuning. By default it measures against the **Toy's tuning**, the one the Toy's instruments play. It can also use its own: ordinary 12-tone equal temperament, five finer equal divisions, just intonation, Pythagorean tuning, Bohlen–Pierce or any scale you import from a Scala `.scl` file.

## What it does

Audio passes through bit for bit; the Tuner never changes the sound. Mute fades the output to silence over 5 ms and back, so you can tune on stage without the audience hearing it.

The Tuner estimates a single pitch from its **input** on the UI thread, away from the audio callback. It keeps reading while Mute silences the output. Choose a **View**:

- **Meter** shows a large note and octave (or scale degree), measured hertz, signed cents, a needle and a strip of every degree across one period. Right of centre is sharp; left is flat. The ruler spans ±50 cents, or half the smallest step for tunings finer than 24-EDO, such as ±19.4 cents in 31-EDO.
- **Wheel** places one tuning period around a circle, with degrees at their actual cents positions. Unequal scales have unequal gaps; Bohlen–Pierce fills a tritave rather than an octave. The needle shows measured pitch, the highlighted dot marks its nearest degree, and an arc shows the error. The outer strobe moves with measured frequency error, reverses for flat versus sharp, and stops at exact tuning.

Green means the measured pitch is within **In tune ±**; amber means flat or sharp. The cents readout always shows the measured error. **Needle damping** steadies the needle without changing that readout. **Level gate** rejects quiet input by RMS dBFS. **Hold** briefly preserves the last reading, dimmed and labelled Held, after pitch disappears; then the needle, arc and strobe clear. Uncertain estimates dim and show Unclear. These are monophonic displays: chords and noise may not give a reliable pitch.

Both views use the same tuning, controls and input measurement in Patch cards, the inspector and Frame widgets. Display settings never retune the audio.

## When to use it

Use it after a source to check its tuning: an [Oscillator](https://docs.tune.toys/nodes/std.oscillator/) or a [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/) voice. To hear or check a microtonal scale, choose its tuning and play notes near its degrees. One Tuner measures one pitch at a time; it does not transcribe chords.

## Ports

<!-- ports:start -->

| Port    | Direction | Signal | Lanes                   |
| ------- | --------- | ------ | ----------------------- |
| `audio` | Input     | Audio  | Inferred from the cable |
| `audio` | Output    | Audio  | Inferred from the cable |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter   | Label          | Range       | Default | Unit | Scale  | Notes                                                                                                                                                                                                                                                                                                                                          |
| ----------- | -------------- | ----------- | ------- | ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `reference` | Reference      | 400 to 480  | 440     | Hz   | linear | Frequency of A4 for the Tuner's own tunings. Equal divisions keep A4 on a degree; just, Pythagorean, Bohlen–Pierce and custom scales start at Root. Toy tuning uses the Toy's reference instead. Shown when `tuning` is 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9.                                                                        |
| `mute`      | Mute           | 0 to 1      | 0       |      | linear | On fades the output to silence over 5 ms, like a tuner pedal; Off fades back to an exact pass-through. Choices: 0 Off, 1 On.                                                                                                                                                                                                                   |
| `tuning`    | Tuning         | 0 to 10     | 10      |      | linear | The degrees the face measures against. Toy tuning follows the Toy's own tuning, the one its instruments play; Custom uses the node's cents table and period, such as an imported Scala scale. Choices: 0 12-TET, 1 19-EDO, 2 22-EDO, 3 24-EDO, 4 31-EDO, 5 53-EDO, 6 Just intonation, 7 Pythagorean, 8 Bohlen–Pierce, 9 Custom, 10 Toy tuning. |
| `root`      | Root           | 0 to 11     | 0       |      | linear | Tonic pitch class of the Tuner's own just, Pythagorean, Bohlen–Pierce and custom scales, at its 12-TET pitch from Reference. Choices: 0 C, 1 C♯, 2 D, 3 D♯, 4 E, 5 F, 6 F♯, 7 G, 8 G♯, 9 A, 10 A♯, 11 B. Shown when `tuning` is 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9.                                                                |
| `view`      | View           | 0 to 1      | 0       |      | linear | Meter shows signed cents; Wheel places every degree at its true cents position and adds a measured-error strobe. Choices: 0 Meter, 1 Wheel.                                                                                                                                                                                                    |
| `tolerance` | In tune ±      | 1 to 25     | 5       | ¢    | linear | Cents from a degree that count as in tune, capped at half the smallest scale step.                                                                                                                                                                                                                                                             |
| `damping`   | Needle damping | 0 to 0.95   | 0.75    |      | linear | Needle smoothing at a 60 Hz reference rate. Zero follows immediately; higher values settle more slowly. Raw note, Hz and cents stay measured.                                                                                                                                                                                                  |
| `hold_ms`   | Hold           | 100 to 3000 | 600     | ms   | linear | Retains a dimmed reading for this long after pitch is lost or falls below Level gate.                                                                                                                                                                                                                                                          |
| `gate_db`   | Level gate     | -70 to -20  | -46     | dBFS | linear | Minimum RMS level for a new pitch reading. Below this, the last reading is held, then cleared.                                                                                                                                                                                                                                                 |

<!-- parameters:end -->

<!-- data:start -->

- `cents`: floats.
- `period`: floats.

<!-- data:end -->

### Reference (`reference`)

The frequency of A4 for the Tuner's own tunings, from 400 to 480 Hz; 440 by default. With Tuning on Toy tuning it is hidden: the Toy's tuning sets the reference. In the equal divisions of the octave (12-TET to 53-EDO) A4 is always a degree, so the reference stays in tune. Drag the A4 point on the face sideways, or focus it and use the arrow keys or the wheel; Shift moves in tenths of a hertz.

### Mute (`mute`)

On fades the output to silence over 5 ms; Off fades back to an exact pass-through. A Toy that starts muted is silent from its first sample.

### Tuning (`tuning`)

The degrees the face measures against. **Toy tuning**, the default, follows the Toy's own `tuning`: the preset or custom table, Root and Reference its [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/) voices play, or 12-TET at 440 Hz when the Toy declares none. The face's caption then starts with "Toy", such as `Toy · 31-EDO · A = 440`, and it has no Reference point to drag. Any other choice uses the Tuner's own Reference and Root:

| Tuning          | Degrees per period        | Names                                   |
| --------------- | ------------------------- | --------------------------------------- |
| 12-TET          | 12 per octave             | C, C♯, D … B with an octave number, A4  |
| 19-EDO … 53-EDO | 19, 22, 24, 31 or 53      | `n\N` steps from C, such as `14\19` (A) |
| Just intonation | 12, five-limit ratios     | Note names from Root                    |
| Pythagorean     | 12, a chain of pure 3/2   | Note names from Root                    |
| Bohlen–Pierce   | 13 equal steps of 3:1     | `n\13` from Root                        |
| Custom          | Up to 128, from node data | Degree numbers from Root, 0 is the root |

Just intonation uses 1/1, 16/15, 9/8, 6/5, 5/4, 4/3, 45/32, 3/2, 8/5, 5/3, 9/5 and 15/8. Pythagorean uses 1/1, 256/243, 9/8, 32/27, 81/64, 4/3, 729/512, 3/2, 128/81, 27/16, 16/9 and 243/128.

Custom reads the node's `cents` data (degrees in cents above the root, ascending, from 0, each up to 9600) and `period` data (one value in cents, 1200 for an octave and about 1901.955 for a tritave). The **Import .scl…** button under the face fills both from a Scala file and selects Custom, as one edit that a single Undo reverts. Files are at most 64 KiB with at most 128 pitches; a malformed line, or pitches that are not positive and ascending, is refused with the line number.

### Root (`root`)

The tonic pitch class, C to B, of the Tuner's own just, Pythagorean, Bohlen–Pierce and custom scales; hidden on Toy tuning, which brings its own root. The root sits at its 12-TET pitch from Reference, and the other degrees are measured from it. Equal divisions of the octave ignore it.

### View (`view`), tolerance (`tolerance`), damping (`damping`), Hold (`hold_ms`) and Level gate (`gate_db`)

View selects Meter or Wheel. In tune ± defaults to 5 cents and is capped at half the smallest scale step, so the tolerance cannot span neighbouring degrees. Needle damping defaults to 0.75 and uses elapsed time, so display refresh rate does not change its response. Hold defaults to 600 ms; Level gate defaults to −46 dBFS. All five controls belong to the Tuner and can be bound on a Frame like its other parameters.

## Tips

- Keep Mute on while you tune a live instrument, then switch it off to play.
- A just major third sounds 13.7 cents flatter than the 12-TET third: set Tuning to Just intonation with Root on the key and watch the needle centre on the pure interval.
- 24-EDO adds quarter tones between the 12-TET notes; 31-EDO is close to quarter-comma meantone.
- Leave Tuning on Toy tuning after an instrument, and the needle centres on every key the instrument plays, whatever the Toy's tuning.

## See also

[Oscillator](https://docs.tune.toys/nodes/std.oscillator/), [Polyphonic instrument](https://docs.tune.toys/nodes/std.poly/), [Gain](https://docs.tune.toys/nodes/std.gain/).
