Output Midi as CSV list

Armin Seltz's icon

Hello there.

I am very new to Max, but have used vvvv a lot. Still trying to adjust to the many differences.

So my first task is seemingly quite simple. I have a Midi-input, coming from Live for example, and now I want to record all the Midi messages in a sort of human readable form, like:

Messagetype (Note,CC,Program,...); Time (in ms or units); Duration (in ms or units); Velocity; Pitch; Channel; Track

Like that simply on one line for each event, a bit like the MidiMonitor example in Max for Live. Then I want to be able to save that list as a text file (I am using it in a different script).

I have dabled with MidiParse and Detonate, but not really getting my head round how to get the "global" time value. I guess it needs to start a timer or even better just get the time from Live's transport directly.

Thanks for any help or hints where to start.

Best, Armin.