MIDI Merger and Splitter
Merge, split and convert Standard MIDI Files without opening a sequencer. The work happens on raw events, so a file with pedal data, pitch bend, SysEx patches or karaoke lyrics comes out with all of it still in place.
Add one or more files, pick a job, and download the result. The list under the drop area shows what each file contains before anything is written: format, track count, resolution, length, tempo, time signature, channels in use and track names.
Merge MIDI files
Two arrangements cover the two reasons people merge.
Layer starts every file at tick zero and puts their tracks side by side in a format 1 file. Use it when the drums, bass and keys of one song were exported as separate files. One timeline can only follow one tempo map, so the first file in the list supplies the tempo, time signature and key signature events. Move the file with the correct tempo to the top with the arrow buttons.
Append plays the files one after another in list order. Track 1 of each file continues track 1 of the file before it, track 2 continues track 2, and so on. Each file’s tempo and time signature changes move with it. With “Start each file on the next bar line” ticked, a file that ends partway through a bar is followed by silence up to the bar line, so the next section lands on a downbeat.
Program changes, controller values and pitch bend are channel state, and a MIDI file has no event that resets them between sections. In an appended file, a channel keeps the instrument and controller values the previous section left unless the next section sets its own.
Mixed resolutions
Each MIDI file declares how many ticks make a quarter note: 96, 192, 480 and 960 are common. Merging files with different values means moving them onto one grid.
The merged file uses the least common multiple of the source resolutions. Files at 96 and 480 are written at 480, and files at 96 and 120 at 480 as well, so every tick maps to a whole tick and nothing shifts. The file header stores the resolution in 15 bits, so the largest value is 32767. When the least common multiple is larger, the finest source grid is used and the page says that timings were rounded.
Split by track or by channel
Splitting writes one single-track file per part and offers them as a ZIP or one at a time.
- By track suits format 1 files, where each instrument already has a track. A track that holds only tempo and signatures is not written as a part.
- By channel suits format 0 files, where one track holds all 16 channels. Channel 10 is the drum channel in General MIDI.
Every part receives a copy of the full tempo map, the time signatures and the key signatures. Without them a part taken from track 3 of a song at 140 BPM would play at the MIDI default of 120.
Track names, lyrics, markers and SysEx carry no channel number. In a channel split they follow their track’s channel when that track uses exactly one. Anything left over goes to a last part named no-channel, so the parts together still contain every event of the source.
Format 0 and format 1
Converting to format 0 folds all tracks into one, sorted by tick. Events that share a tick keep their track order, so a tempo change in the first track still comes before the notes it applies to, and a note-off still comes before a new note-on of the same key.
Converting a single-track file to format 1 writes a conductor track holding tempo, signatures, text and SysEx, followed by one track per channel in use. A file that is already format 1 with several tracks is written back unchanged.
Format 2 files, which hold independent patterns, are read as separate tracks. They are rare outside older hardware sequencers.
CSV and JSON
The CSV follows the midicsv layout, one event per line:
0, 0, Header, 1, 2, 480
1, 0, Start_track
1, 0, Tempo, 500000
1, 0, End_track
2, 0, Start_track
2, 0, Note_on_c, 1, 79, 81
2, 960, Note_off_c, 1, 79, 0
2, 960, End_track
0, 0, End_of_file
Tracks count from 1, channels from 0, and times are absolute ticks. Text is quoted, and bytes outside printable ASCII are written as octal escapes such as \351, which keeps Latin-1 and Shift-JIS lyrics intact through a text editor.
The JSON holds the same records as objects with named fields (note, velocity, controller, microsecondsPerQuarter) and adds each event’s time in seconds, calculated through every tempo change. A script reads it with one JSON.parse call, which suits analysis better than the CSV does.
A CSV dropped into the file list is read back as a MIDI file. Choose Convert and “The same format, rewritten” to save it as .mid.
Limits
- Files are written with a status byte on every event. Some sources omit repeated status bytes to save space, so a rewritten file can be a few percent larger while holding identical events.
- Chunks that are not track data, which a few sequencers add for their own settings, are skipped.
- Nothing is quantized, transposed or renamed here. Use the MIDI editor for changes to notes, and MIDI to audio to hear or render the result.