Audio to MIDI for a Melody Over a Bass Drone

Use an isolated recording when you want MIDI of just the lead. Adding a continuous G2 kept all three melody notes, put a short G2 on the same MIDI track, and moved the D4 and E4 starts about 47 ms later than in the clean export. This test used one lead and one synthesized bass tone.

One continuous tone across the notes and rests

We programmed a mono PCM16 WAV to play A3, D4 and E4. In a copy of that WAV, we added a G2 sine wave at 98.00 Hz with short fades at the file edges. Each file contains 33075 samples at 22050 Hz. The lead samples, their timing and the WAV headers match. Subtracting the control from the mixed WAV yields the added tone sample for sample.

The first rest covers frames 7938 through 11024. In the control every one of those samples is zero. In the mix, the low tone keeps sounding through that gap. Both takes stay within the PCM16 range. The diagram marks the programmed note windows and the full span of the drone.

Both WAVs share A3, D4 and E4. The mixed WAV adds G2 over the full 1.5 seconds.
The lead stays the same in both inputs. The orange line shows the added G2 through the melody and its rests.

The extra note appears between D4 and E4

We converted the WAVs separately in Chrome with the export grid set to 120 BPM and final-release trimming enabled. The actual downloads contain three and four notes. Each file has one note track. In the mixed file, G2 starts at 0.8125 seconds and ends at 0.9292 seconds, after the exported D4 and before the exported E4. That is about 117 ms of a tone that lasts for nearly the whole WAV.

WAV cues and MIDI starts in seconds
NoteWAV cueCleanWith G2
A30.0000.0000.000
D40.5000.3950.442
E41.0000.9050.952

D4 and E4 each start 45 ticks later in the mixed MIDI. The files use 480 ticks per quarter and a half second per quarter. A shift of 45 ticks therefore gives 45 ÷ 960 × 1000 = 46.875 ms. Both D4 starts are still before their programmed cue. Keep the clean draft or your original recording handy when checking where the notes belong.

The clean file has A3, D4 and E4. A short orange G2 appears between D4 and E4 in the mixed file.
The bars show the actual MIDI start and end events. Orange marks the extra G2 in the mixed output.

Listen and download

Download exact event timings and file hashes

Watch the test

Hear both WAVs and follow the added G2 and the shifted note starts in the measured MIDI timeline.

Watch the test on YouTube

Questions about bass under a lead

Can I get just the lead out of my mix?

Editorial question. Export or record the lead by itself when you have access to that track. Set the same tempo in both conversions if you plan to compare them. In the mixed sample here, G2 joined the same piano roll as the melody. Check rests and sustained passages for unexpected low notes.

Will deleting the extra bass note fix the timing?

Editorial question. Compare the remaining note starts with the original recording after deleting the bass. Removing G2 from this export leaves D4 and E4 at the timestamps in the With G2 column. Move those starts separately if your edit needs them to match the source.

What changes with short kick hits?

Hear the same lead with three short bass sweeps and compare the actual MIDI downloads.

Each kick starts inside a programmed lead note.
Orange shows where the kick hits overlap the lead.
See the kick drum experiment