Georg Holzmann wrote:
Hallo!
(unless somebody else does it first...). The ideal would be to have midifile work the same way as qlist, with only the internal encoding of the data being different, the advantage being that other sequencers besides pd will be able to read it.
you could also use the xeq external to read and write MIDI files ... (and I think there is also an other one)
xeq looks very complicated to me, and I can't find any help patches for it, and it's a library. None of these issues may be important to you. But I wanted a simple record/playback type external that could be used in place of a midiin or midiout object. midifile so far can read a file and play it back at any speed from any start time. It outputs its current time so you can use that to loop it as I have done in the help patch. It won't play backwards (yet) and you can't edit the file because it seems more useful to use a qlist, which may be edited in a text editor, as the input to the (not_yet_implemented) midifile writer. Speaking of which it would be a lot easier for me to have midifile accept an entire qlist as input, that way I don't have to preallocate memory for an arbitrarily large MIDI stream...or is it better to allocate linked blocks with getbytes() as needed? I'm afraid it might glitch the audio if allocation takes the OS too long.
Martin