Merging MIDI files after export

Share your favorite Ableton Live tips, tricks, and techniques.
Post Reply
kamih
Posts: 39
Joined: Sun Apr 25, 2010 3:52 am
Location: NJ, USA
Contact:

Merging MIDI files after export

Post by kamih » Wed Jul 04, 2012 7:16 pm

As you all might know, Ableton isn't able to export multiple MIDI files into one multi-track file.

I really needed this so I created a little tool that allows you to merge your exported files into one.

I've tested this with some of my music and then imported the file into MuseScore and it looked great, but keep in mind this is still experimental. Let me know if you find any bugs or problems with it.

http://people.happycoders.org/kamih/midijoin

cheers,
kamih

Rxkimo
Posts: 57
Joined: Thu Dec 06, 2007 9:20 pm

Re: Merging MIDI files after export

Post by Rxkimo » Tue Mar 19, 2013 1:16 am

Hi kamih,

Does your tool work with Windows 7? Or maybe I'm missing something?

I downloaded the .exe and .cpp file, double clicked the .exe, then there's a quick flash of a window (too fast to recognize, like it opened and closed immediately).

Any help is much appreciated.

solger
Posts: 89
Joined: Mon Jan 09, 2012 10:57 am

Re: Merging MIDI files after export

Post by solger » Tue Mar 19, 2013 8:39 am

Rxkimo wrote:I downloaded the .exe and .cpp file, double clicked the .exe, then there's a quick flash of a window (too fast to recognize, like it opened and closed immediately).

Any help is much appreciated.
Since it's a command line tool, open a Command-prompt-Window (cmd.exe), go to the folder and launch the program (.exe) from there.

Rxkimo
Posts: 57
Joined: Thu Dec 06, 2007 9:20 pm

Re: Merging MIDI files after export

Post by Rxkimo » Wed Mar 20, 2013 4:08 am

Thanks for the help. That got me further, but it looks like there might be a bug with the tool.

In the cmd prompt I type:
C:\midiJoin.exe Guitar.mid Harmonica.mid Bass.mid

I hit enter and the prompt says:

Error while reading Harmonica.mid: file has 0 tracks (instead of 1)

If instead I type:
C:\midiJoin.exe Harmonica.mid Guitar.mid Bass.mid
I get:
Error while reading Guitar.mid: file has 0 tracks (instead of 1)

So, I think the tool might have a bug since it was able to read the Guitar.mid file when it was first in order, but isn't if it's second in order.

solger
Posts: 89
Joined: Mon Jan 09, 2012 10:57 am

Re: Merging MIDI files after export

Post by solger » Wed Mar 20, 2013 5:26 pm

When I first tested the tool, I had a similar issue, in which the input-file had too many tracks.
So it looks like that the input midi-files need to contain exactly one midi track (like the error message suggests).

The command is working like this:

midiJoin output.mid input1.mid ... inputN.mid (merges the input-files 1-N into the multi-channel-file called output.mid)

You can get the info about the command usage, if you only type in 'midiJoin' (and hit enter).

Rxkimo
Posts: 57
Joined: Thu Dec 06, 2007 9:20 pm

Re: Merging MIDI files after export

Post by Rxkimo » Thu Mar 21, 2013 12:12 am

Any thoughts on how to resolve the error:
Error while reading Harmonica.mid: file has 0 tracks (instead of 1)
or
Error while reading Guitar.mid: file has 0 tracks (instead of 1)

I'm creating the .mid file from Live by click on the midi clip > click File > Export midi clip. Not sure why it would think it has "zero" tracks. Maybe I'm exporting midi incorrectly from Live?

And I'm still puzzled why it looks like it can read the Guitar file if I put it first in the order, but it can't read the Guitar file if I put it second in the order.

Thanks for the help

solger
Posts: 89
Joined: Mon Jan 09, 2012 10:57 am

Re: Merging MIDI files after export

Post by solger » Thu Mar 21, 2013 5:28 pm

Rxkimo wrote:I'm creating the .mid file from Live by click on the midi clip > click File > Export midi clip. Not sure why it would think it has "zero" tracks. Maybe I'm exporting midi incorrectly from Live?
Not sure what might cause the problem.
For me, in Live 8 (both 32 and 64bit) and Live 9 (32bit) it works using the same steps:

(1) Select a midi clip (in session or arrangement view)
(2) File -> export midi clip

Maybe try to drag the exported midi-file back into Live and see what it looks like.
And I'm still puzzled why it looks like it can read the Guitar file if I put it first in the order, but it can't read the Guitar file if I put it second in the order.
Because the first element after midiJoin defines the output-file, into which the input files are merged:

midiJoin OUTPUTFILE.mid inputfile_1.mid ... inputfile_N.mid

----------------------------------------
So in your case you're trying to

o) merge the input-files (Harmonica + Bass) into the output-file called Guitar.mid
C:\midiJoin.exe Guitar.mid Harmonica.mid Bass.mid

o) merge Guitar + Bass into output-file called Harmonica
C:\midiJoin.exe Harmonica.mid Guitar.mid Bass.mid


Hope that makes it more clear.

Rxkimo
Posts: 57
Joined: Thu Dec 06, 2007 9:20 pm

Re: Merging MIDI files after export

Post by Rxkimo » Fri Mar 22, 2013 12:17 am

Because the first element after midiJoin defines the output-file, into which the input files are merged:
Ah, got it.

Thanks for all the help. It looks like it's something on my end. I've using Live 9 64-bit, but I doubt that's the issue. I tried pulling two random midi files from the internet (Katy Perry and Philip Phillips) and I'm still unable to join them...I still get the error:

Error while readying katy_perry-peacock.mid: file has 0 tracks (instead of 1)

And the Katy Perry midi file loads into live just fine, so I know it's ok.

solger
Posts: 89
Joined: Mon Jan 09, 2012 10:57 am

Re: Merging MIDI files after export

Post by solger » Sat Mar 23, 2013 9:14 am

Rxkimo wrote:I tried pulling two random midi files from the internet (Katy Perry and Philip Phillips) and I'm still unable to join them...I still get the error:
Error while readying katy_perry-peacock.mid: file has 0 tracks (instead of 1)
And the Katy Perry midi file loads into live just fine, so I know it's ok.
Maybe this might be the problem:

Make sure that you are using the full filename including the filetype (.mid) for the input-files.
Otherwise, you'll probably get the 0 tracks error, because the midiJoin-tool might think that it's not a MIDI-file:

midiJoin.exe outputfile.mid katy_perry-peacock.mid Guitar.mid ---> This way it works

midiJoin.exe outputfile.mid katy_perry-peacock Guitar ---> Error (because the input-filename is without .mid)

Rxkimo
Posts: 57
Joined: Thu Dec 06, 2007 9:20 pm

Re: Merging MIDI files after export

Post by Rxkimo » Tue Mar 26, 2013 3:03 am

I finally got it to work - it looks like the file path I was using to run the cmd line didn't have enough administrator privileges.

Thanks for all the suggestions - I couldn't have done it without your help and now I've got a quick way to consolidate files.

chronicshake
Posts: 3
Joined: Tue Nov 17, 2015 8:56 pm

Re: Merging MIDI files after export

Post by chronicshake » Wed Jul 04, 2018 9:02 pm

Hey team, is this tool still available? Anyone have it floating in their drive?

Post Reply