Command-line utility to merge multiple MIDI files in a single file?

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

Post Reply
Basslint
Established Member
Posts: 1516
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 385 times
Been thanked: 299 times

Command-line utility to merge multiple MIDI files in a single file?

Post by Basslint »

Hello,

is there a program that can merge multiple MIDI files in a single file?

Example usage: Let's say I have the MIDI files for each part of a piece (cello, violin, piano) and I want to turn it into a single MIDI file of the entire composition with each instrument having its separate track.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 141 times
Been thanked: 349 times

Re: Command-line utility to merge multiple MIDI files in a single file?

Post by LAM »

Hi @Basslint,

you could try https://pjb.com.au/midi/midisox.html

Code: Select all

 -m | -M | --combine concatenate|merge|mix|sequence

    Select the input file combining method; -m means mix, -M merge. If the mix combining method is selected (with -m) then two or more input files must be given and will all be mixed together into one MIDI-track. A mixed file cannot be un-mixed.

    If the merge combining method is selected (with -M), then the merged file contains all of the MIDI-tracks from all of the input files; un-merging is possible using multiple invocations of midisox with the mixer effect. The merging process attempts to avoid channel-conflicts by renumbering channels in the later files as necessary (however, a total of only fifteen MIDI-channels is available). 

in mix, nobody can hear your screen

Basslint
Established Member
Posts: 1516
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 385 times
Been thanked: 299 times

Re: Command-line utility to merge multiple MIDI files in a single file?

Post by Basslint »

LAM wrote: Mon Jun 06, 2022 7:57 am Hi @Basslint,

you could try https://pjb.com.au/midi/midisox.html

Code: Select all

 -m | -M | --combine concatenate|merge|mix|sequence

    Select the input file combining method; -m means mix, -M merge. If the mix combining method is selected (with -m) then two or more input files must be given and will all be mixed together into one MIDI-track. A mixed file cannot be un-mixed.

    If the merge combining method is selected (with -M), then the merged file contains all of the MIDI-tracks from all of the input files; un-merging is possible using multiple invocations of midisox with the mixer effect. The merging process attempts to avoid channel-conflicts by renumbering channels in the later files as necessary (however, a total of only fifteen MIDI-channels is available). 
Thanks, I actually found a repository for it:

https://gitlab.com/peterbillam/miditools
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
Post Reply