Open and play MIDI file in Cinder

Hello :slight_smile:

I’m working on visuals for an electronic track and I’m planning to write down in a MIDI file the main sections of the arrangement so the visuals can automatically adapt to the different parts of the track. To do so I was hoping to create a MIDI file in Ableton, and then open and play it back directly in Cinder. But I’m not sure how to do so…

I have found the Cinder-MIDI2 block but that seems to be more for receiving live MIDI messages in Cinder coming from other apps. Is it possible to just play back MIDI files with that block? Any good alternative? I guess if need be I could play the MIDI file from Ableton and send MIDI Messages to Cinder but I’d like to avoid that and do everything in Cinder directly if possible…

Thanks for your help!

You may want to use a C++ audio library like YSE.

2 Likes

Hi there,

Sounds like you’re wanting to use midi files as a score for your visuals? I haven’t used midi myself very much (mostly due to its quantization / numerical limitations, but these might not matter to you for visual cues or whatever you’re doing), but I bet you can find some simple code around to parse the files. A quick search brought up this library, though I haven’t looked too close at it. From there, it shouldn’t be too difficult to sequence those events back from your update loop.

I believe there are both Windows and OS X specific ways of reading midi files, though I can’t find them at the moment and I’m not sure if there is a way to use them without creating sound. As in, just for reading / sequencing the file. Might be.

YSE looks really interesting @paul.houx! And open source, I bet there’s lots of good stuff in there.

cheers,
Rich

2 Likes

Thanks for the suggestions folks, I’ll take a look! I might also end up just playing back MIDI from Ableton and send MIDI messages to Cinder.

I wrote a library that will probably do what you want, in terms of managing MIDI connections and reading MIDI files.

It’s Cinder friendly, although not Cinder-integrated.

My friend Dimitri did a rewrite using C++11 idioms -

4 Likes