Hi there.
Thanks for helping me out with the variable Latency
issue. PropertyChanged() seems to do the job!
Now I ran into another issue: For exact synchronous timing
of MIDI events I need to know when the
currently rendered audio buffer will be played out. In theory there is a field called
mHostTime in the inTimeStamp field that is passed into the Render() function. The
problem is, with the host application GarageBand this field is always 0 and the
kAudioTimeStampHostTimeValid flag is zero. All I get is the mSampleTime field,
which is in no deterministic way bound to the host time (MIDI
events get scheduled in highly accurate host time, which is an UInt64)
When my audio unit is called from a standard AUGraph,
this field is filled in properly and timing is accurate. Not so with
GarageBand. I can imagine the developers intentionally left this field blank to
discourage people from writing any MIDI
plugins with “pro level” timing accuracy – after all there
should be a market left for Logic Pro and Express.
I also tried the CallHostMusicalTimeLocation() and
CallHostTransportState() function calls, but to no avail. The CurrentSampleInTimeLine
field is always 0.
Could there be any other way that I can determine
when the audio buffers get played? Should I try to manually walk up or down the
audio unit connections until I hit the audio driver? ;-) Any help would be
greatly appreciated.
Christian