Re: Playing back MIDI data
Re: Playing back MIDI data
- Subject: Re: Playing back MIDI data
- From: Christopher Corbell <email@hidden>
- Date: Mon, 6 Oct 2003 23:24:05 -0700
On Monday, October 6, 2003, at 08:15 AM, jiayin wrote:
Hi,
I need help in regard to programmatically playing back MIDI events. I
understand that each MIDI packet contains info about how a note should
be played back.
But I'm kind of stuck now, not sure which function in the CoreMIDI API
can be used to play back raw MIDI data.
Thanks!!
MT
Take a look at the MusicDevice audio unit.
You can set up an AUGraph with a MusicDevice
connected to an output unit.
The MusicDevice unit can accept raw MIDI messages
via the MusicDeviceMIDIEvent() function. It will render
notes (and other stuff like sustain, pitch-bend, etc.).
Headers:
AudioUnit/MusicDevice.h
AudioToolbox/AUGraph.h
Some sample code:
(Java)
/Developer/Examples/CoreAudio/Java/MIDIGraph
(C++)
/Developer/Examples/CoreAudio/Services/AUViewTest
The latter example also shows how to use the AudioToolbox
MusicPlayer/MusicSequence objects with a MusicDevice.
The MusicPlayer also supports playback of standard
MIDI file data. There may be more MusicDevice code
samples in the CA SDK and there are some on the web
as well.
- Christopher
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.