Re: HostCallback_GetBeatAndTempo
Re: HostCallback_GetBeatAndTempo
- Subject: Re: HostCallback_GetBeatAndTempo
- From: Robert Grant <email@hidden>
- Date: Thu, 8 Jan 2004 21:00:59 -0500
Well I wish it were so but you must have missed my:
memset (&info, 0, sizeof (HostCallbackInfo));
Which I believe would set the info.musicalTimeLocationProc to NULL?
Robert.
On Jan 8, 2004, at 7:39 PM, William Stewart wrote:
On 16/12/2003, at 12:55 PM, Robert Grant wrote:
Sure, here's the beat and tempo proc:
OSStatus GetBeatAndTempo(
void * inHostUserData,
Float64 * outCurrentBeat,
Float64 * outCurrentTempo)
{
if (outCurrentBeat) {
int beat = 0; // left out call to my beat determination code
(and retested to make sure it still crashes)
*outCurrentBeat = beat;
}
if (outCurrentTempo)
*outCurrentTempo = 120; // left out call to my tempo
determination code
return noErr;
}
// And here's the setup code:
HostCallbackInfo info;
memset (&info, 0, sizeof (HostCallbackInfo));
info.hostUserData = nil;
info.beatAndTempoProc = GetBeatAndTempo;
// info.musicalTimeLocationProc = GetMusicalTimeLocation;
Here's your problem:
// info.musicalTimeLocationProc = GetMusicalTimeLocation;
should be either a valid function pointer or NULL
Bill
//ignore result of this - don't care if the property isn't
supported
result = AudioUnitSetProperty (unit,
kAudioUnitProperty_HostCallbacks,
kAudioUnitScope_Global,
0, //elementID
&info,
sizeof (HostCallbackInfo));
if (result) NSLog(@"kAudioUnitProperty_HostCallbacks status:
%ld", result);
return result;
This code crashes the Oddity - without it plays fine. Also I set this
property on every effect and music device which are all fine with
it, except the Oddity.
Thanks,
Robert.
On Dec 16, 2003, at 3:14 PM, Jeremy Sagan wrote:
Robert,
Perhaps you should post a code snippet of your BeatAndTempo
procedure and how you set it up.
On Tuesday, December 16, 2003, at 02:24 PM, Robert Grant wrote:
Hi Jeremy,
Well thanks for the sanity check, but I'm still not getting it to
work here. The Oddity starts up OK but as soon as some MIDI hits
it, it crashes. I thought that perhaps some MIDI data was getting
to it before it was ready (my keyboard is always issuing
ActiveSense) but filtering that out didn't help.
It really doesn't make much sense... especially as not setting the
BeatAndTempo property makes it happy!
Robert.
On Dec 14, 2003, at 9:31 PM, Jeremy Sagan wrote:
Robert,
I just tried the oddity AU demo in Metro and the beat and tempo
(and all else that I could see) seem to work fine. It synced when
changing tempo also. Of course I do not know how to operate it but
it does not crash.
Jeremy
On Sunday, December 14, 2003, at 07:49 PM, Robert Grant wrote:
Here's a surprise. Oddity AU is blowing chunks if I set the
BeatAndTempo property on it! Not immediately, put pretty soon
after.
Here's a portion of the call stack - looks surprisingly shallow:
Thread 3 Crashed:
#0 0x05c25004 in 0x5c25004
#1 0x05bd52b4 in
AUMIDIBase::ComponentEntryDispatch(ComponentParameters*,
AUMIDIBase*)
(AUMIDIBase::ComponentEntryDispatch(ComponentParameters*,
AUMIDIBase*) + 88)
#2 0x05bd5478 in
MusicDeviceBase::ComponentEntryDispatch(ComponentParameters*,
MusicDeviceBase*)
(MusicDeviceBase::ComponentEntryDispatch(ComponentParameters*,
MusicDeviceBase*) + 108)
#3 0x05b72418 in AUMusicDeviceEntry (AUMusicDeviceEntry + 120)
#4 0x90281a90 in CallComponent (CallComponent + 212)
#5 0x91a90a0c in MusicDeviceMIDIEvent (MusicDeviceMIDIEvent +
52)
As a comparison but Zebra and Albino are happy with the tempo
settings.
Has anyone else had success with this property and Oddity?
Robert.
On Dec 14, 2003, at 8:04 PM, Marc Poirier wrote:
On Sun, 14 Dec 2003, Robert Grant wrote:
Attempting to support this in my Rax update, but had a question:
Is the "outCurrentBeat" indexed from 0 or 1?
It is from 0.
http://lists.apple.com/archives/coreaudio-api/2002/Oct/01/
auhostcallbackmusicalloc.001.txt
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.
--
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
_______________________________________________________________________
___
_______________________________________________
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.
_______________________________________________
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.