Audio to MIDI for a Melody With an Accidental Click

Convert the clip and check the notes on both sides of the click. In our WAV test, one click in a silent rest yielded the same three MIDI notes with the same timing as the clean take. This result covers one isolated pulse and one melody. A longer pop or a click on a note attack may behave differently.

One changed sample between two notes

We started with a mono PCM16 WAV programmed to play A3, D4 and E4. The first rest extends from 0.360 to 0.500 seconds. Its samples are all zero in the control. We kept the same file header and changed the sample at zero-based frame 9250 from zero to 8192 in the test take.

At 22050 samples per second, that places the click about 419.5 milliseconds from the start. The pulse occupies one stored sample, about 45 microseconds. Reading both files back confirmed that the other 33074 samples agreed and that both files kept a peak absolute sample of 8192. The time axis below uses the programmed tone windows.

Both 1.5-second WAVs have the same three programmed note windows. The test WAV has a pulse at 0.420 seconds.
The input diagram marks the only changed sample in the rest.

The two native MIDI downloads were identical

We selected each WAV separately in Chrome. The converter used a 120 BPM export grid and the final-release estimate. Each run saved a 74-byte MIDI file. An independent file parser found the same keys and start and end ticks in both downloads. At 480 ticks per quarter and 120 BPM, dividing the absolute tick by 960 gives its timestamp in seconds.

Programmed starts and measured events in both files
NoteWAV start (s)MIDI start (s)MIDI tick span
A30.0000.0000–379
D40.5000.395379–847
E41.0000.905869–1337

The click lies inside the estimated D4 in the test export. The clean export places D4 there too. Its start is about 105 milliseconds early in each run, compared with the programmed source start at 0.500 seconds. Listening with the two timelines aligned helps distinguish the audible click from the timing shift that was already present.

Both MIDI drafts have A3, D4 and E4. The D4 starts at 0.395 seconds in the MIDI and 0.500 seconds in the WAV program.
The MIDI row shows the measured start and end events common to the two downloads.

Watch the single-click experiment

Watch on YouTube

Listen and download

Download file hashes and exact note events

Questions about clicks and MIDI

Should I remove a click before converting?

Editorial question. If you hear a click on a note attack or see an unexpected extra note, save a cleaned copy and convert the same excerpt again. Keep the original. Compare the note count, pitch and event boundaries with the two recordings aligned. The Audacity manual describes when to try Click Removal or Repair. Audacity Click Removal manual

Why does a MIDI note cross the point where I hear the click?

Editorial question. MIDI marks an estimated note interval. In our clean and test files that interval started ahead of the programmed D4, so it crossed the click position in both. Check the source attack before moving or deleting the note.

What if the sound lasts through the rest?

Hear the same melody over a sustained low tone and compare the resulting MIDI notes.

A G2 line extends across the same three melody notes and their rests.
This follow-up adds a tone that continues through the rests.
See the bass drone experiment