Forums > MaxMSP

Multitrack MIDI or Multiple MIDI files

February 28, 2013 | 12:54 pm

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.

February 28, 2013 | 2:18 pm

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.

March 1, 2013 | 7:11 pm

Thanks, will give it a go.

March 1, 2013 | 7:42 pm

[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!

March 1, 2013 | 9:11 pm

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?

March 2, 2013 | 12:12 am

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. —
March 2, 2013 | 1:36 am

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?

March 2, 2013 | 1:54 am

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.

March 2, 2013 | 10:23 am

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

— Pasted Max Patch, click to expand. —
March 4, 2013 | 4:31 pm

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?

March 4, 2013 | 6:18 pm

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.

March 4, 2013 | 7:49 pm

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.

March 5, 2013 | 10:16 am

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

March 5, 2013 | 12:02 pm

very helpful

April 16, 2013 | 9:07 pm

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. —
April 17, 2013 | 8:15 pm

Bump for rising frustration in not getting it to work.

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

January 22, 2014 | 4:26 am

Dl the cnmat stuff: and try

January 22, 2014 | 5:12 am

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

Viewing 18 posts - 1 through 18 (of 18 total)

Forums > MaxMSP