Click tracks

Audio to MIDI and a metronome click: the click only becomes a note if it rings long enough.

A 1 kHz click at −6 dBFS with a 20 ms decay comes back as eight MIDI 83 notes. The same click 3 dB quieter comes back as nothing at all.

Select an audio file to create a MIDI draft locally.

The selected audio is decoded in your browser; it is not uploaded to a server.

Length and level are one variable here, not two. If you record with a click track, the question is not whether the click is audible in the file — it is. The question is whether it survives the two gates the converter applies before it writes anything.

It survives on a threshold you can measure and predict. The click has to keep a single analysis window above the loudness gate for enough consecutive windows that the resulting segment reaches the minimum note length. Below that, the click is in the file, in the recording, and in your ears, and it produces no MIDI at all.

Measured

One click, one level, one variable: how long the click rings.

The signal is eight identical clicks at 120 BPM with nothing else in the file: 1 kHz sine, exponential decay, peak 0.5 (−6 dBFS), 44.1 kHz mono, 0.40 s of digital silence in front. Down the table only the decay time changes — the frequency, the peak level and the spacing are identical in every row.

Eight clicks at 0.5 s spacing, 1 kHz, peak 0.5, 44.1 kHz mono, 0.40 s of silence in front. Note sensitivity Balanced (0.015 frame gate, 75 ms minimum note). Detector 77a9dd6b. Reproduction: node run-metronome.js, table 1.

Decay timeFrames above gateNotes returnedNote length
5 ms50—
10 ms80—
15 ms100—
18 ms120—
19 ms12475.5 ms
20 ms13875.5 ms
30 ms188104.5 ms
50 ms298168.3 ms

Read the fourth and fifth rows together. Twelve frames above the gate is 69.7 ms of signal, and 69.7 ms is less than the 75 ms minimum: the segment is discarded and the file comes back empty. Thirteen frames is 75.5 ms, one hop over the line, and every click becomes a note. Nothing about the audio changes between those two rows except how long the tail takes to fall below 0.015.

The threshold is a frame count, not a duration. That distinction matters because the frame is 23.2 ms wide and the hop is 5.8 ms, so four consecutive frames share 75% of their samples. A click that rings for 60 ms is not measured as 60 ms of audio: it is measured as the number of window positions that still read above the gate, and at 12 frames the answer is short of the gate by 5.3 ms.

Level

Turning the click down works, but only on a short click.

Because the gate is a level, the decay time and the peak multiply into the same thing: the number of frames that clear 0.015. That gives a practical table. Both edges below were found by bisection at 22 iterations, not by scanning.

Decay timeAll eight gone belowAll eight back aboveGap between them
19 ms0.435 (−1.2 dB)0.566 (+1.1 dB)2.3 dB
20 ms0.376 (−2.5 dB)0.483 (−0.3 dB)2.2 dB
30 ms0.147 (−10.6 dB)0.174 (−9.2 dB)1.5 dB
50 ms0.070 (−17.1 dB)0.078 (−16.2 dB)0.9 dB
80 ms0.047 (−20.6 dB)0.049 (−20.1 dB)0.5 dB

Two things fall out of those two columns. First, the switch is close to a step — between "no notes at all" and "a note on every click" there is a band 0.5 to 2.3 dB wide, so a click never fades out of the MIDI gradually. A quiet note elsewhere in the recording drops out over tens of dB; a click drops out inside three.

Second, the direction of the advice inverts as the click gets longer. A 20 ms click is removed by a 2.5 dB trim, which you can do after the fact on a finished take. A 50 ms click needs 17 dB, and an 80 ms click needs 20.6 dB — by which point the click is barely audible and useless as a reference. A short click is easy to get out of the MIDI; a long one is not. That is the opposite of the usual assumption, which is that a quieter click is an easier click.

The 19 ms row explains the four-note result in the first table. At 19 ms and peak 0.5 the click sits inside that 2.3 dB band, so the frame count lands on 12 or 13 depending on where each hit falls relative to the hop: four of the eight clicks clear the gate and four do not. Move the peak by 1.2 dB in either direction and you get none or all eight.

Pitch

When the click does convert, the pitch it writes is often wrong — in two opposite directions.

A click is not a musical pitch, so there is no correct answer for what MIDI note it should become. There is a correct answer for what the detector will write, and it is not monotonic in frequency.

Click frequencyExpected MIDINotes returnedPitch written
100 Hz43889
150 Hz50889
200 Hz550—
300 Hz62562
1,000 Hz83883
1,500 Hz900—
2,000 Hz95883
3,000 Hz102783

Below about 200 Hz the period search runs into its own lower bound: the shortest lag it is allowed to test is 31 samples, and a lag of 31 at 44.1 kHz is 1,422.6 Hz, reported as MIDI 89. A 100 Hz click is therefore written two and a half octaves above where it sounds, and a 150 Hz click is written more than three octaves high. This is the same floor documented on the low-notes page, reached here by a different route: a short burst has no period to find, so the search returns its limit.

Above about 1,500 Hz the search folds the other way. A 2 kHz and a 3 kHz click both come back as MIDI 83 — the same note as the 1 kHz click — because the lag that wins is the one that completes the most periods inside the 23.2 ms window, and at those frequencies that is a sub-multiple, not the fundamental. The accuracy page measures the same folding at the top of the musical range.

Between roughly 300 Hz and 1,400 Hz the pitch is exactly right. That is the whole useful band: if your click lives there, the note it writes is the note you can identify by ear and delete.

Sustained notes

A click over a sustained note splits it, and the cut lands on the click.

Recording with a click usually means the click is not in silence — it is over the note you are playing, because you are playing to it. A 2.0 s A3 with three 1 kHz clicks over it, at 20 ms decay and peak 0.5, comes back as four notes of 517, 493, 488 and 493 ms. The three boundaries fall at 0.906, 1.411 and 1.904 s, which are the click positions, not the beat grid and not any musical boundary.

Decay / peakA3 segmentsTotal A3 lengthLost
no click12,014 ms0 ms
20 ms / 0.5041,991 ms23 ms
50 ms / 0.5041,910 ms104 ms
50 ms / 0.4041,968 ms46 ms
80 ms / 0.5041,852 ms163 ms

The lost time is not random. It is the length of the gap the click punches in the frame sequence, and it grows with decay time: 23 ms at 20 ms decay, 104 ms at 50 ms, 163 ms at 80 ms. If you are converting a sustained part and the note comes back short in three places, this is the shape to look for — three equal losses, evenly spaced, at the tempo you recorded to.

Below the click threshold the note is whole. At 20 ms decay, peak 0.35 leaves the 2,014 ms note intact while still being an audible click in the file. That is the practical target: quiet enough not to punch holes, loud enough to play to.

Limits

What these numbers do not cover.

The limit of this test. Every click here is a 1 kHz sine with an exponential envelope, synthesised in code. A real metronome is a broadband transient — a woodblock, a beep, a sample of a cowbell — and a broadband transient has no stable period for the search to lock onto. When I replaced the sine with a noise burst of the same envelope, every decay time from 5 ms to 50 ms returned zero notes, including the ones that convert with the sine. So the numbers on this page are an upper bound: a real click is harder to convert than a sine click, not easier.

Three conditions are also fixed and would move the boundary. The peak is normalised per test, so a click that is quiet in absolute terms but sits 20 dB above the music would behave like the loud rows, not the quiet ones. The note under the click is a five-harmonic synthetic tone with no vibrato and no decay; a real piano note decays, and a decaying note plus a click is two envelopes interacting, which was not measured. The 1 kHz click frequency was chosen because it is the middle of the band where the pitch is written correctly; the tables above show that a click outside 300–1,400 Hz is written at the wrong pitch, and the segment lengths in those rows were not separately verified.

Finally, the count is what the detector returns, not what survives in a DAW. A four-note file from a two-note phrase is still a file; the three extra segments are real events with real start and end times, and deleting them is manual work. This page measures how many events that work costs you, not whether the tool is usable with a click on — it is, at the settings above.

Questions

Click tracks and this converter

My MIDI file has extra notes on every beat. Is that the click track?

Almost certainly. Check the pitch: a click written by this detector lands wherever the period search settles, and for a click between 300 Hz and 1,400 Hz that is the click's own frequency. A 1 kHz click becomes MIDI 83 on every beat. If the extra note is MIDI 89 instead, the click is below 200 Hz and hit the search floor; if it is MIDI 83 but your click is 2 kHz, it is the fold described above.

Why does the click convert on one take and disappear on the next?

Because the gate is a frame count and the boundary is one hop wide. At 20 ms decay, a peak of 0.5 returns eight notes and 0.4 returns two; at 0.35 it returns none. A 1.4 dB change between takes is enough to cross that line, and 1.4 dB is well inside normal variation in how hard you set the click level.

Can I just lower the click so it never converts?

Only if the click is short. At 20 ms decay a 1.4 dB trim is enough. At 50 ms it takes 16.7 dB, which is a click you can barely hear. At 80 ms it takes 20.5 dB and the click is no longer usable as a reference. A short click is easier to get out of the MIDI than a long one, which is the opposite of what most people assume.

Does the click also cut the notes I play?

Yes, when it is loud enough to convert. A 2.0 s A3 came back as four segments totalling 1,991 ms at 20 ms decay, losing 23 ms at each of three click positions. At 80 ms decay it loses 163 ms. The losses are equal and evenly spaced, so they are easy to spot: three equal gaps in a sustained note, at the tempo you recorded to.

Is a noise-based click easier or harder to remove?

Harder, and by a lot. Replacing the sine with a noise burst of the same envelope returned zero notes at every decay time from 5 ms to 50 ms — including decay times where the sine version converts on every hit. A broadband transient gives the period search no consistent answer, so it never assembles a segment long enough to keep. If your click is a sampled woodblock, this page's numbers do not apply to it and the click is probably not what is in your MIDI.

What if the extra notes are not on the beat?

Then it is not the click. Check the trill page if the notes alternate fast, the missing-notes page if notes are disappearing instead of appearing, and the chords page if two pitches sound at once. A click produces events on a fixed grid at a fixed pitch; anything else has a different cause.

Related readings

Short notes that never arrive is the same gate seen from the other side: one note played once, too short to survive, where this page has eight short bursts in a row. The recording-prep page measures what a noise gate does to a six-note phrase, which is the processing step people usually reach for before they reach for a click track. The clipping page shows the other half of the level story — loudness that goes past the top of the range instead of the bottom. For material where the transients are the music rather than an artefact, the drum workflow approaches onset detection from a different angle entirely.

Reproduction: node run-metronome.js regenerates every table on this page and prints the detector's sha256 on its first line (77a9dd6b, 8,069 B). The detector is read directly out of the production converter.js by detector-from-live.js rather than re-implemented, so these numbers move if the shipped detector moves. The smoke fixture is smoke/fixtures/click-bleed.wav (264,644 B, sha256 243d9ce4c6a0160e), four notes with three clicks in the rests; it returns seven events, three of them MIDI 83.