I Have a console program, written in C, which generates short random musical compositions using the PortMidi library. Ultimately I would like to write these sequences as either a midi or audio file.
I have found some explanations of reading and writing functions within the portmidi library: Pm_read()
, and Pm_write()
; but, without examples, I am struggling to understand and implement this.
Is there anyway I can export the entire sequence at once?
If not, is it necesary to recursively read into a buffer and save individual midi notes? Or do I need to read the whole sequence into the buffer and then save it?