snails.fm/ docs voice tuner

Deciding

Control path: once per 64-sample chunk, on the mono sum——— audio   – – – controlx(n)per channelmono sumshift ratios: per chunk, per voiceequal-power pan → stereo busy(n)MCSMono control sumPDPitch detectionpYIN / YINRGTReliability gatesonset · floor · corridorSMFf₀ smoothingTSLTarget selectionScale / MIDIGLDRetune glideMIDISHFLead pitch shifterTD-PSOLA / phase vocoderHarmony voices ×15HVHVHVADT doubles ×4DVDVLatency alignmentALNDry / wet mixMIXz−LDelay-matched dry pathdry (bypass rides this path)

By this point the tuner has heard you. The listening stage delivers a fresh pitch estimate every few milliseconds, each with a confidence score and a voiced-or-not flag. This page is the middle of the machine: the part between hearing a pitch and singing one. It answers three questions, in order: can this estimate be trusted? Where should the note go? How fast should it get there?

Everything downstream acts only on the answers. The shifter and the harmony voices never see keys, scales, or MIDI, only the numbers that leave the bottom of this page.

Trust: the gates

Pitch detectors are good, not perfect, and their mistakes cluster in predictable places: the starts of notes, the edges of breaths, the bottom of a range. Three gates stand between the detector and the correction, and together they are the reason the tuner doesn't click, scoop, or stutter between octaves.

The onset gate. The tuner doesn't correct the very first millisecond of a note. It waits (about 15 ms) until the pitch detector's estimate has stopped moving. Detectors guess badly at note onsets, often a full octave flat, and correcting a bad guess sounds like a scoop up into every phrase. So until the estimate settles, your voice passes through untouched; once a note is locked, bends and vibrato inside it never re-trigger the wait. 15 ms is shorter than any note you can sing. You will never hear the gate. You would definitely hear its absence.

The floor, and the 40 ms ride-through. The shifter promises to handle pitches down to a floor set by the Range control. A pitch below it repeats too slowly for the audio the shifter has buffered, so genuinely below-floor input is handed to the dry path instead of being mis-shifted. (Why the floor exists, and what it costs, is the latency page.) But detectors also throw single wild low guesses mid-phrase (typically an octave error at a transient), and letting go the instant one appears sounds like a click. So a solitary below-floor estimate is ridden through on the last locked pitch for up to 40 ms. If the low reading was real, the handoff happens; if it was a glitch, the pitch doesn't move.

The corridor. On breathy material, a detector given full freedom likes to flicker between a note and its octave. With Track set to Follow, once a note is locked the detector narrows its search to a corridor around the locked pitch: wide enough that even a deliberate octave leap stays reachable, but closed to the far-off guesses a breathy note invites. The moment a frame is unvoiced (a breath, a consonant, silence) the corridor snaps back to full width, so a new phrase anywhere in your range is picked up exactly as if Track were set to Wide.

Last, the trusted estimate is lightly smoothed, removing frame-to-frame jitter so the engine downstream isn't chasing noise on an ambiguous pitch.

Aim: choosing the target

A trusted pitch needs a destination. There are two ways to give it one.

Scale mode. Key and Scale define a grid of allowed notes: major, minor, the church modes. The tuner aims at the nearest allowed note, with one deliberate reluctance: a pitch hovering exactly at the boundary between two notes would otherwise flip-flop between targets, and you'd hear the correction stutter. So the snapper has a dead band of about 40 cents; once it has chosen a note, it takes a real move toward the neighbour to change its mind.

Master Tune moves the reference pitch anywhere from 415 to 466 Hz, and the entire grid rescales with it. Snapping behaves identically at any reference: A = 432 works exactly like A = 440.

MIDI mode. You play the target notes. The tuner reads held keys as a chord, not as a stream of key events. Raw key states have a flaw: in the finger-gap between one chord and the next, no keys are down, and correction would drop out on every change. So chords are committed: a change takes 30 ms to commit, and a released chord stays latched for 250 ms. Play naturally; the correction holds.

The lead target is drawn from the committed chord by the Lead control: the root, the nearest chord tone, or nearest with octave steering. The remaining chord notes are handed to the harmony voices (their story is on the crowd page).

One more decision hides here. A chord tone far outside your register would ask the shifter for more shift than it can honestly deliver. The result is a barely-moved copy of your voice, not the note you played. So every MIDI target is folded into the octave you are actually singing in, and a target below the Range floor folds up an octave, same pitch class. What you play chooses the harmony; what you sing chooses the register.

Two performance switches. Robot replaces the lead target with the key's tonic: every note you sing lands on one pitch. Hold freezes the current target for as long as it's held.

Motion: the retune glide

The tuner now knows where the note should go. The last decision is how fast to take it there. This single control is most of the difference between repair and effect.

The output pitch glides toward the target. Retune sets the speed: at 0 the glide takes 200 ms (slow enough to be transparent) and at 1 it is instantaneous, which is the hard-tune sound. Amount blends between your sung pitch and the glided target; at 0 there is no correction at all.

A consequence worth knowing: at slow Retune settings the glide follows your pitch contour, so vibrato and bends largely ride through untouched. At instant Retune, flattening them is the point.

The glide has three deliberate exceptions:

  1. It never sweeps in. When correction engages after a gate, the glide starts at the pitch you are singing, never from a stale or empty value. The audible defect this kills is the scoop: without it, every phrase would begin with the tuner sliding up from wherever it last was.
  2. Chord changes snap. In MIDI mode, a committed chord change moves the target instantly, with no glide. A played chord change is intent; drift within a note is drift. The glide is for drift.
  3. Loops don't smear. A transport jump while playing (a loop restart) resets the decision layer only: glide, smoothing, chord latch. The audio buffers are left alone. Without this, every loop restart would open with a portamento sweep across the jump. (Currently wired for VST3; AU transport plumbing is on the ledger.)

What leaves this page

One number per voice, per chunk: the shift ratio, target pitch divided by sung pitch. This is the boundary of the decision layer, and the clean split in the block diagram: everything above it thinks in notes; everything after it only moves audio. How that ratio becomes sound is the singing page.

last updated · Charlie