Can someone explain how does [mrpeach/midifile] work?
I'm looking for a way to change the reading tempo of a midi file, and someone suggested this object.
If I'm not mistaken, [metro] is used to progress to the next MIDI tick. So you should be able to alter the tempo by changing the rate of [metro].
Thanks a lot for replying. I have no clue how [mrpeach/midifile] works. It has one inlet and three outlet. So, sending bangs with [metro] to the inlet? What are its outlets?
[midifile] has the same number of inlets and outlets, but again, I don't know how it works exactly, and how are the two objects related.
Sorry for a basic question here, I've never dealt with midi object in Pd before, and the help menu is not very clear.
[midifile] and [mrpeach/midifile] are the same. mrpeach is just the library, so by including it in the object you ensure that you are using the right one (in case there is a [midifile] in another library) and it also loads it right away, so you don't need [import].
I agree that the helpfile isn't that clear, mainly because there are a lot of overlapping connections, something that I think should be discouraged. I'd recommend rearranging some of the helpfile a bit so you can see things more clearly.
I haven't used this object for a while, but I believe the main things are that you first open the file using the [read( message, which will then dump some meta data out the right outlet. Then play it by using a [metro] connected to the inlet. Each bang from the [metro] will progress it each tick. The left outlet will send the MIDI messages as lists, which you will need to parse yourself. The middle outlet just give the current tick number.
For more info about controlling the tempo, I found this:
Also, you might have an easier time parsing the data by doing something like this:
[zexy/drip] <-- because midiparse expects on float at a time
Thanks for your detailed reply. I'll check those options and post a reply here if I have any questions or just share my experience with midi objects...