AUDIO TO MIDI / DIGITAL HARD CLIPPING

Audio to MIDI for a clipped melody

Matching note names can hide changed endings.

Measured answer. Our digitally clipped melody kept the same six MIDI keys and start ticks as the clean control, but E4, G4 and A4 ended later. Both downloads are 101 bytes; their complete contents differ. This is one constructed hard-limit setting, not a microphone-clipping test or proof that damaged audio was restored.

20 November 2026 · Original saved sample pair · Actual native MIDI downloads.

The same melody, with a lower digital ceiling

We reuse our exact saved original six-note melody, whose programmed keys are 60, 62, 64, 65, 67 and 69: C4, D4, E4, F4, G4 and A4 in this tool. Starts are 0, 0.5, 1, 1.5, 2 and 2.5 seconds. Each separately synthesized sine tone has a 0.36-second window, including a 0.01-second attack and a 0.06-second release, with a 0.25 amplitude coefficient before PCM16 rounding. The remaining samples are zero.

Both mono WAVs have 77,175 samples at 22,050 samples per second: duration = 77,175 ÷ 22,050 = 3.5 seconds. Each complete file has 154,394 bytes. The second file does not regenerate the melody. It applies limited[i] = min(4096, max(−4096, clean[i])) to each already saved integer sample. We do not add noise, delay, new note windows or periodic gain.

An independent reader checked every saved pair with separate conditional logic: values above 4096 become 4096, values below −4096 become −4096, and all other values stay unchanged. All 77,175 pairs match. Exactly 27,867 samples change. The first changed zero-based frame is 139 and the last is 62,380. Absolute peaks are 8,192 in the clean file and 4,096 in the limited file. This is our chosen digital operation, not a measured microphone or preamp model.

Exact saved clean and hard-limited samples at the same positions and vertical scale. The limited signal has flat tops at its positive and negative 4096 PCM bounds.
Actual saved PCM, zero-based frames 2205 through 2645, on the same vertical scale. These are not detector frames or recovered audio.

Hear the exact input pair

These players use the saved original WAVs, not audio rendered from the MIDI. They start only when you choose play. The second recording is digitally limited; it has not passed through a restoration process.

Original clean melody

The exact saved original six-tone signal.

Hard-limited melody

The same saved samples, bounded at ±4096 PCM units.

Same starts and keys, three different endings

C4End unchangedStart unchanged
D4End unchangedStart unchanged
E4End +22 ticksStart unchanged
F4End unchangedStart unchanged
G4End +22 ticksStart unchanged
A4End +73 ticksStart unchanged

On 20 November 2026 we separately selected both originals in the production converter in Chrome, with export BPM 120 and the clear-final-release estimate enabled. Choosing the limited input cleared the earlier download before its conversion. We clicked each native Download .mid link, checked the fresh saved files and independently parsed the complete events.

Each actual output is a 101-byte, format-zero Standard MIDI File with one track, 480 ticks per quarter note and one tempo event of 500,000 microseconds per quarter note. Both contain the ordered keys 60, 62, 64, 65, 67 and 69. Every note velocity is 88. Both actual start lists are 0, 379, 869, 1337, 1828 and 2296 ticks. Neither file contains controller or Pitch Bend events.

Actual independently parsed ticks. End difference means limited minus clean, not difference from the source intention.
Key Clean start Limited start Clean end Limited end End difference
60 0 0 357 357 +0
62 379 379 847 847 +0
64 869 869 1315 1337 +22
65 1337 1337 1806 1806 +0
67 1828 1828 2274 2296 +22
69 2296 2296 2691 2764 +73

C4, D4 and F4 have unchanged endings. E4 changes from 1315 to 1337 ticks, G4 from 2274 to 2296, and A4 from 2691 to 2764. The differences are 22, 22 and 73 ticks. Seconds = tick ÷ 480 × 500,000 ÷ 1,000,000 = tick ÷ 960, so those shifts are 22 ÷ 960 ≈ 0.022917 seconds and 73 ÷ 960 ≈ 0.076042 seconds. Equal file sizes therefore do not establish equal saved note instructions.

Actual MIDI note end differences are zero for C4, D4 and F4; plus 22 ticks for E4 and G4, and plus 73 ticks for A4. All starts are unchanged.
Actual paired exports. A longer returned note is not, by itself, a better match to the original note window.

Use the original windows as a separate reference

We pair by source order because both exports contain those same six distinct keys in order. Programmed source starts correspond to ticks 0, 480, 960, 1440, 1920 and 2400 at the exported tempo. Absolute onset differences are 0, 101, 91, 103, 92 and 104 ticks. Their sum is 491; mean absolute onset difference = 491 ÷ (6 × 960) ≈ 0.085243 seconds for both outputs. The matching start lists do not mean the intended attacks were recovered exactly.

The clean final note ends at 2691 ÷ 960 = 2.803125 seconds; the limited final note ends at 2764 ÷ 960 ≈ 2.879167 seconds. Its programmed source window ends at 2.5 + 0.36 = 2.86 seconds. The two actual boundaries lie on different sides of that reference. The source window includes its fade; it is not a measured musician's key release. We do not turn this pair into a general clipping accuracy percentage.

Changing the samples is different from repairing them

The sample check establishes exactly what was limited. The MIDI check establishes which key and time instructions were saved. Neither demonstrates recovery of the original audio above the imposed ceiling. We did not run a declipping algorithm, capture intermediate detector frames or isolate the internal cause of the changed endings.

The Mido message reference separates note messages and their velocity fields from other channel messages. We inspected those actual file events rather than relying only on the preview's rounded note lengths. The current implementation is available, but reading source code is separate from measuring an internal analysis stage.

For a real recording, compare note names, starts and ends against the original before editing. That is an editing recommendation, not a tested repair workflow here. Use the conversion tutorial for selecting and saving a file. Additive noise and periodic positive gain are different saved-sample operations from this hard limit. No result for another converter or another limiter follows from this single pair.

Watch the clipping check

Compare the exact saved sample shapes with the three changed MIDI endings. Original inputs and complete calculation records remain available below.

Watch this check on YouTube.

Download the originals and actual exports

Original clean melody

Original input and its actual native note export.

Clean melody WAV Actual clean MIDI

Hard-limited melody

Original input and its actual native note export.

Limited melody WAV Actual limited MIDI

Read every actual MIDI event, sample-check input, hash and timing pair · Rebuild the limited file from the clean original.

Questions before accepting the note draft

Do six matching keys prove that the clipped input converted identically?

Editorial question. No. The starts and keys match here, but three note endings differ, and the complete file hashes differ. Inspect the full instructions instead of treating a note-name list or file size as an equality check.

Does keeping the melody mean the original clipped sound was restored?

Editorial question. No. These are note instructions from a deliberately limited synthetic input. We did not reconstruct the clipped-away samples or test a physical recording chain. The public clean source is a reference we already possessed, not audio recovered by the converter.