Hi Rowan,
Midi is very messy. For example, MIDI files have tempo information and multiple tracks, none of which appears in a MIDI stream. I wrote portsmf mainly to support MIDI in Audacity, but it is an independent library you could use to read/write MIDI files and store MIDI sequences in memory. The in-memory representation is probably overkill, and that's the big problem with MIDI file libraries -- there's no obvious simple representation, so often people find it easier to write an app-specific representation than to figure out how to work with something more elaborate. If you make your own representation, portsmf has at least a MIDI file parser and some examples for writing data to a MIDI file you might be able to use. Portsmf is next to portmidi in the sourceforge portmedia project. The apps directory has a very simple midi file player that uses portmidi and portsmf.

    -Roger

On 6/5/11 11:04 AM, Rowan Sylvester-Bradley wrote:

Hi,

Has anyone written an application that will record and/or play back midi files using portmidi and portsmf?

I need to write a program that will:

- receive a stream of music commands, similar in concept to midi (i.e. note on and note off events, changes of volume, changes of instrument, tempo changes etc.) but in a proprietary protocol.

- translate the received commands in real time to midi and transmit them, so they can be played on a midi instrument, or recorded by a separate midi recording program.

 - record the received commands as a midi file

- receive a stream of midi events, translate them to the proprietary protocol and re-transmit them in real time so they can be played on an instrument using the proprietary protocol.

- play back a midi file, converting it to the proprietary protocol and transmit it so it can be played on an instrument using the proprietary protocol, reproducing the original performance as closely as possible.

It would help me get up to speed if there was some sample code doing the midi bits, so I can concentrate on the software needed to translate to and from the proprietary protocol.

Thank you - Rowan


_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api
_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to