Question

I currently have a MusicPlayer which contains a MusicSequence with a set of MusicTracks that hold MIDI information. What I want is to know when a MIDI Note starts reproducing and when it ends, something like a listener of the playback of the MIDI.

I was looking and think of maybe using MusicSequenceSetUserCallback but I don't really know how would that work. Anybody has an idea on how to accomplish this?

Was it helpful?

Solution

There's a tutorial on how to capture midi events from a MusicSequence here (such as note on/off): http://www.deluge.co/?q=midi-driven-animation-core-audio-objective-c

In brief, the method is to call MIDIDestinationCreate to create your own MIDI endpoint to handle the MIDI messages, and then point your MusicSequence at it with MusicSequenceSetMIDIEndpoint.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top