Re: Core Audio/Midi sync accuracy?
Re: Core Audio/Midi sync accuracy?
- Subject: Re: Core Audio/Midi sync accuracy?
- From: William Stewart <email@hidden>
- Date: Fri, 3 Mar 2006 17:57:20 -0800
It depends.
Firstly, you'd need to establish what the driver's overall latency
is, and verify its accuracy. For instance, you couldn't get close to
really knowing with USB because a USB class driver has no way to
ascertain what the latency of a device is. Of course, if the driver
writer isn't reporting a valid latency figure you will also have
problems too. So, lets assume that the audio device is accurate
(Built In Audio is, most of the PCI and FireWire Audio interfaces are).
Then its the propogation time of MIDI through the system. You can
provide -- and SHOULD provide! -- a host time stamp for the MIDI
Packet list. This will ensure that the MIDI server is able to
schedule the MIDI data accurately, and send it out when you want it
sent out.
The MIDI driver is responsible for doing its best to play the event
at the requested time. Some hardware and their drivers provide
accurate schedule-ahead. But usually the driver will send the message
to hardware at the requested host time, and then (typically for USB)
there's a ~1 ms latency getting the message to the interface, ~1 ms
to transport the message over a MIDI cable to a synthesizer, and then
all bets are off ... some synths respond extremely quickly, others
are notoriously bad.
You can measure all this by sending MIDI notes and audio pulses at
the same time, then recording the synth's audio output and the pulse
and looking at the recording.
Bill
On 03/03/2006, at 5:00 AM, Eric Lee wrote:
Hi,
I was wondering how accurately Core Audio/Midi are synced. I
suppose that this is somewhat dependent on the output hardware...
For example, if I schedule a PCM audio buffer to start playing back
at host time X, and a MIDI "note on" event to start also at the
same host time, how far out of sync will they actually be at the
output? There will be some difference, since they have to go
through separate output paths (the audio through the DAC and the
MIDI through a synthesizer). Also, the scheduled MIDI event has to
be converted to a MIDI timestamp at some point..?
Does anyone have an idea of a rough estimate for how much this
difference could be? Milliseconds, tens of milliseconds?
Thanks,
Eric
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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