Multitrack MIDI or Multiple MIDI files

Feb 28, 2013 at 12:54pm

Multitrack MIDI or Multiple MIDI files

I haven’t used MIDI files in MAX before so forgive the ignorance.

I have some MIDI data that I can either load as one multitrack MIDI file or load at one time as multiple MIDI files (stored somehow). I then want to send that info to drive a poly~ synth. Not sure exactly how to achieve this as detonate help/ref and seq help/ref don’t seem to reference loading or playing either multiple MIDI files or a multitrack file.

Feb 28, 2013 at 2:18pm

I think using multiple MIDI files is the only option in Max. But you could try to implement a “multifile” player by putting detonate into poly~ and use some file name numbering to automate loading the files into corresponding instances of detonate.

Mar 1, 2013 at 7:11pm

Thanks, will give it a go.

Mar 1, 2013 at 7:42pm

[detonate] can play Type 1 MIDI files, but it takes a bit to get the output to parse correctly. The help file needs some studying ;) …it’s not immediately plug-and-play, quite, but it does give you a lot of flexibility.

[seq] is more straightforward but only does Type 0 files. Just have as many [seq] objects as you need, running at the same time, should work fine with a master control for all at once…that is, unless you want to start offsetting some tracks, playing some faster or slower, transposing them, etc…

I’d definitely work these options into the setup (they’re very easy to implement) because you’ll be able to expand the possibilities of a given MIDI file a lot. And it’s easy enough to have a “Default” button which would set all the [seq] objects (MIDI tracks from your file) back to playing normally. Slap some presets for the tweaking controls and you’re off and running…live improvisation using a single MIDI file that previously only played back one way!

Mar 1, 2013 at 9:11pm

That’s helpful seejayjames. What I am not sure about in detonate is how to separate each track and route it to its own synth (most likely poly~). How does detonate differentiate between pitch data from multiple tracks if they are coming out simultaneously from the pitch outlet?

Mar 2, 2013 at 12:12am

They shouldn’t be exactly simultaneous, though I’m not sure how that works with timing. Anyway, try a [gate] with the Track outlet to see if you can filter out the notes from specific tracks, like this (probably are other ways to do it too):

– Pasted Max Patch, click to expand. –
Mar 2, 2013 at 1:36am

That looks interesting. I could then create multiple select –> objects that correspond to each track being sent from outlet 6 (track) and then send that data to the poly~ synth. But this assumes that the pitch data is tied directly to a track in order for the gate to only pass track specific information. Do I understand that correctly?

Mar 2, 2013 at 1:54am

To follow up saw this in the reference.

“In 6th inlet: The number of a track on which to record the note event. Overdub recording is not possible with detonate, but each recorded note can be tagged with a track number for storing separate tracks of notes internally. If no track number has ever been received, notes are recorded on track 1.”

What I plan to do is have detonate read a Type 1 MIDI file which I will then send tracks and pitch data to drive a poly~synth.

I’ll see how it goes.

Thanks again for all your help.

Mar 2, 2013 at 10:23am

You could use the track number to control a gate with multiple outlets.

– Pasted Max Patch, click to expand. –
Mar 4, 2013 at 4:31pm

Making headway on this.

Is the first track of a type 2 midi file (the one that contains tempo data, etc.) labeled track 0 or track 1?

Mar 4, 2013 at 6:18pm

I guess you mean type 1 midi files (type 2 is quite unusual).

In my experience with midi files generated in Logic, track numbering starts at 1. So even if the first track doesn’t contain midi notes, it is labeled track 1.

Mar 4, 2013 at 7:49pm

I did mean type 1. Sorry.

I see the same thing in Logic and other programs as well. I just wonder if those programs offset the track to read as 1 even though inside the MIDI file it is a 0.

Mar 5, 2013 at 10:16am

The tracks in a midi file are simply stored one after the other without numbering.

Mar 5, 2013 at 12:02pm

very helpful

Apr 16, 2013 at 9:07pm

Finally got around to trying to work through this. Below is the patch I built based off seejay’s example. I want to plug this into a poly~ synth but I am not able to get any data out (it appears) when I hit start. (It is not connected to a MIDI keyboard at all; all internal). Any help on troubleshooting would be great.

– Pasted Max Patch, click to expand. –
Apr 17, 2013 at 8:15pm

Bump for rising frustration in not getting it to work.

Looked at ajm.midi2coll and note~ but still no luck.

Jan 22, 2014 at 4:26am

Dl the cnmat stuff: and try

Jan 22, 2014 at 5:12am

hmm finally it seems is more versatile to me (from )


You must be logged in to reply to this topic.