AUDIO TO MIDI / KEYS, PEDAL AND SOUND

Audio to MIDI for a sustain-pedal recording

Review overlapping pitches and key releases separately. Midilot's melody estimate cannot be treated as the original piano fingering or pedal instructions.

Measured answer. Our pedal-held control returned C4, C2, C2, C2 instead of C4, E4, G4, C5. The download contains no sustain-controller events. A long exported note does not prove the original pedal release.

7 November 2026 · Original synthetic controls · Actual MIDI downloads.

The keys can be released while the sound is still held

We prepared two original MIDI controls with the same four pitches: C4, E4, G4 and C5, or MIDI numbers 60, 64, 67 and 72. Both use one track, channel zero, velocity 88, 480 ticks per quarter note and a 500,000-microsecond quarter note. Starts are ticks 0, 480, 960 and 1440. Each key is released 240 ticks after its start.

Time in seconds equals tick ÷ 480 × 500,000 ÷ 1,000,000, or tick ÷ 960. The key releases are therefore 0.25, 0.75, 1.25 and 1.75 seconds. The first control has no sustain controller. In the second, controller 64 is set to 127 at tick zero, then to zero at tick 2400: 2400 ÷ 960 = 2.5 seconds. The key releases stay unchanged.

In Midilot's current local renderer, the second control keeps each released tone active until that pedal-off event. Its four tone holds end together at 2.5 seconds, followed by the renderer's release envelope. This distinguishes the original key-off events from the sound holds in this constructed input.

Four keys end at 0.25, 0.75, 1.25 and 1.75 seconds; the pedal-held tone windows all continue to 2.5 seconds.
Programmed key events and renderer hold windows. The drawn bars exclude the short release envelope; they are not an acoustic piano waveform.

What we actually rendered, converted and saved

The exact production MIDI and audio helper rendered the controls locally in Node, using its Soft sine setting. This was an execution of that source, separate from the later browser conversion. It was not a recording of a piano or a test of a browser MIDI-rendering session. Both WAVs are mono, 16-bit PCM at 22,050 samples per second. The short-key file has 49,613 frames, while the pedal-held file has 66,150.

Full file duration is frame count divided by sample rate: 49,613 ÷ 22,050 ≈ 2.250023 seconds and 66,150 ÷ 22,050 = 3 seconds. These durations include the helper's allocated tail buffer; the three-second file does not imply a three-second key press.

On 7 November 2026, we selected each WAV in the live WAV-to-MIDI converter in Chrome. Export BPM was 120 and the final-release estimate was enabled. Choosing a new file cleared the previous result. We clicked each generated MIDI download, then independently parsed the saved bytes with Ruby. The short-key output is 83 bytes; the pedal-held output is 82. The values below come from those files, rather than the rounded display table.

The pedal control lost the intended pitch sequence

No pedalC4 · E4 · G4 · C5Pitch sequence matched; timing still differs.
Pedal heldC4 · C2 · C2 · C2The three later intended pitches did not return.

Both original controls have four keyed notes, but four output rows do not mean that the four source notes survived. The no-pedal output retains the pitch order. Its note endings are approximately 0.371875, 0.882292, 1.369792 and 1.756250 seconds, which differ from the programmed key releases. For example, the first ending is 357 ÷ 960 = 0.371875 seconds, a difference of 0.371875 − 0.25 = 0.121875 seconds from its key-off event.

The pedal-held output instead contains C4 followed by three C2 events, MIDI pitch 36. C2 is absent from the source instructions. We have not treated these rows as corresponding E4, G4 and C5 notes or calculated a release error for a pitch that was not recovered.

Actual pedal-held download. Ticks are exact; end times are rounded to six decimals.
RowReturned pitchStart tickEnd tickEnd, seconds
1C4 (60)04460.464583
2C2 (36)4465800.604167
3C2 (36)6467360.766667
4C2 (36)80225192.623958

All three actual downloads in this article have one track, 480 ticks per quarter note and a 500,000-microsecond tempo at zero. None contains a controller-64 event. The final C2 ends at tick 2519, or 2519 ÷ 960 ≈ 2.623958 seconds. That is a note ending, not a recovered pedal-off instruction. Its difference from the programmed 2.5-second pedal release is approximately 0.123958 seconds, and it belongs to the wrong pitch.

Different key releases can produce the exact same test audio

We added a third original MIDI to test a narrower question: can these audio bytes identify the original key releases? It starts the same four notes at the same times and velocities, has no controller 64, and holds every key until tick 2400. Its key-off events are therefore all at 2.5 seconds. That differs from the short keys plus pedal in the second control.

Running this long-key MIDI through the same helper produced a WAV that is byte-for-byte equal to the pedal-held WAV: all 132,344 bytes match, not only the file lengths. Their shared SHA-256 hash is retained in the raw record. The helper synthesizes from each note's start, held end and velocity; these fields agree after pedal handling, even though the original key-off events do not.

We also selected and converted that third WAV separately in the live page. Its downloaded MIDI is byte-identical to the 82-byte pedal-held output, including the C4, C2, C2, C2 sequence and absence of controller events.

Inference from this control: these exact audio files cannot tell us which of the two different key/controller patterns generated them. The inference follows from identical audio bytes paired with different original events. It does not claim that a real piano's resonance, damper noises or partial pedaling behave like this simple sine renderer. It demonstrates why an audio-derived long note is insufficient evidence for a particular key-off or pedal event in this case.

Short key presses plus sustain pedal and long key presses without pedal both generated the same 132344-byte WAV and the same 82-byte actual MIDI output.
The WAV equality was checked across the full files. The identical actual outputs were separate native downloads, independently inspected after conversion.

Check the note events and pedal lane separately

The MIDI Association's controller overview assigns controller 64 to the sustain/damper switch: values from zero through 63 are off, and 64 through 127 are on. Our test uses the two explicit values 127 and zero. A note-off event and a controller-64 event are different instructions.

The current audio-to-MIDI writer writes a tempo, detected note starts and ends, and the track ending. It does not receive an estimated pedal-event sequence to export. This implementation reading explains the file's supported instructions; it is separate from the measured pitch and timing failures above.

  1. Keep original MIDI when available

    Use the instrument's original key and controller events if your goal is to preserve that performance. Rendering to audio and transcribing it again can discard the distinction demonstrated here.

  2. Inspect pitches before changing lengths

    A duration edit cannot turn the three C2 rows into the missing E4, G4 and C5 events. Compare the returned pitches and attacks with the intended line before deciding how to arrange it.

  3. Choose the editing goal

    A compact notation draft and a replay of a pedaled performance can require different key lengths and pedal instructions. Review those separately in your editor. We did not verify a particular DAW or notation application's import behavior.

Download by control, with each actual result beside it

Choose a WAV below to reproduce the conversion. The original MIDI describes the programmed instructions; the actual MIDI is the file saved after audio conversion.

Short keys

Keys released, no pedal

Four separate keyed notes; no controller 64.

Original MIDI instructions Rendered input WAV Actual downloaded MIDI

Sustain pedal

Short keys, pedal held

The same key events, with controller 64 held until 2.5 seconds.

Original MIDI instructions Rendered input WAV Actual downloaded MIDI

Same-audio control

Long keys, no pedal

Different key releases, but the same rendered WAV as the pedal control.

Original MIDI instructions Rendered input WAV Actual downloaded MIDI

Read all source events, actual outputs, hashes and formula inputs · Rebuild the WAVs from the original MIDIs

A question before shortening the notes

Can a long exported note reveal when the sustain pedal was released?

Editorial question. It did not in this test. The pedal download contains no controller-64 events, and its last long C2 is not an intended source pitch. A different original key pattern also generated the exact same WAV and actual output. Keep the original MIDI if you need its key releases and pedal instructions; do not label an estimated note ending as a measured pedal release.

Scope of this check

These are four-note sine-tone controls, not an acoustic piano, a commercial song or a transcription accuracy benchmark. The pedal creates overlapping tones that exceed this converter's single-melody scope. We tested one production Chrome session with one export BPM and one final-release setting, and did not compare another transcription service. Identical audio under this helper does not establish identical physical-piano audio. The actual files expose this case's pitch errors and missing controller events; they do not establish a universal editing correction.

Start with the audio-to-MIDI workflow for a clear single melody. A separate issue is reconstructing tempo changes; changing note spacing and recovering controller events are different tasks.