How to know which program changes are used in a midi file ?
Hello,
After loading a midi file (type 1) in max, I want to know the program change number used for each track. I tried detonate, but he gives no info for the program change...
For example, in a midi file with 3 instruments, how can I know that one instrument use program change 0 for a piano sound, another one use program change 32 for a bass, etc. ?
Thanks
If your question is about knowing what program change messages are contained in the file, you can use [pgmin] to track the messages. On the other hand, if your question is about which instrument produces a piano sound for a given patch number, that's often not standardized--unless they are using General MIDI--but a function of the synth itself.
Thanks for your answer.
Indeed, my question is about knowing what program change messages are contained in a midi file.
I've looked to the pgmin but I don't understand at all how it works. In patch help and reference page it's always used with the input connected to nothing (!?), so how did it receives MIDI information ? And from where ?
In my case, I have a midi files which is played by a detonate object. So I have to connect one of the output of detonate object to the input of pgmin ?
Thanks again for your help, I'm totally lost with this...
[detonate] should be able to output controller 0, but you could also use
[filein], read at word, and search for the hex string for controller 0.
-110
What if you used [seq] instead of [detonate]? If all you need to do is play MIDI sequences, would that work? You could then connect the [pgmin] object to the left outlet of [seq]. Check out the helpfile for [seq] for instructions on loading and playing MIDI files.
Thanks both for the tips.
In fact, I use detonate because I have to deal with midi file type 1.
To explain a little more, I have to load a midi file (type 1) and played each track with different vst sounds. For example, if my midi file have 3 tracks : Acoustic Grand Piano / Acoustic Guitar (nylon) / Slap Bass 1, I have to send the piano track to a vst~ object and use program change 0 to play it, then the program change 24 for the guitar on another vst and the program change 36 for the bass on a third vst.
So that's why I'm trying to automatically get the program change of each track to assign the track to the right vst preset.
How about [mtr] then?
Unfortunately there is no Max object for playing (or analyzing) universal midi files.
But you could try the external 'ajm.midi2coll' from Adam Murray.
I tried with seq and pgmin doesn't work. But I think I'm doing mistakes.
It's the first time I use MIDI in max so I discover a new (complex) world :-)
I'm looking at [mtr] but I don't understand yet how it works.
Oh I didn't saw your answer broc.
Thank you, I'll take a look at this object.
Have you checked the MIDI tutorials in Max?
Yep I've checked the MIDI tutorials, but I have to spend more time to understand all objects.
Oops, meant to compress. I hope someone finds this useful! I'd love feedback if there are better ways to do it.