Re: MusicDeviceMIDIEvent and TimeStamps
Re: MusicDeviceMIDIEvent and TimeStamps
- Subject: Re: MusicDeviceMIDIEvent and TimeStamps
- From: Doug Wyatt <email@hidden>
- Date: Mon, 2 Jan 2006 15:22:48 -0800
On Jan 2, 2006, at 14:36, Ron Benditt wrote:
I've got a program that I'm putting together that sends MIDI to
external devices via CoreMIDI, and MIDI to the dls synth using the
MusicDeviceMIDIEvent call. I'm not sure how to convert my CoreMIDI
timestamps over to the inOffsetSampleFrame parameter that is needed
in MusicDeviceMIDIEvent. Can anyone shed any light on this?
MIDITimeStamp is a host times.
If you install a render notification on the DLS synth, the callback
receives (among other things) an AudioTimeStamp, which contains a
host time. You should be doing this anyhow; the render thread is the
only place where you can call MusicDeviceMIDIEvent and know for
certain in which I/O cycle the event will be rendered.
So given an event with a MIDITimeStamp, if you observe the DLS
synth's rendering host times, and know the rendering sample rate,
then with some simple interpolation you can translate the host time
into a sample time and know where in the buffer you want an event
rendered.
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden