Re: Apple DLS only audible on first few instruments
Re: Apple DLS only audible on first few instruments
- Subject: Re: Apple DLS only audible on first few instruments
- From: Daniel Jalkut <email@hidden>
- Date: Mon, 2 Jun 2003 17:48:19 -0700
This was sort of the impression I had - that it was an "optional for
preflighting" type of call. But taking Chris's advice - my problem is
remedied completely. I now call MusicDevicePrepareInstrument before
every MusicDeviceStartNote, and it works quite well. I'm glad to see
that the performance hit of redundantly calling this doesn't seem to be
significant.
Thanks to both of you,
Daniel
On Monday, June 2, 2003, at 05:24 PM, Bill Stewart wrote:
not strictly true -
It just means that your start note will be slower to execute as the
instrument wasn't prepared... and this is highly undesirable as that
generally means the preparation is done in the render thread itself
and this can lead to "not good things" happening
Bill
On Monday, June 2, 2003, at 03:31 PM, Chris Rogers wrote:
You need to call MusicDevicePrepareInstrument() before
an instrument will be ready to play with MusicDeviceStartNote().
This is similar to a program change in the MIDI world before sending
note-on MIDI events...
Chris Rogers
Core Audio
Apple Computer
On Monday, June 2, 2003, at 01:08 PM, Daniel Jalkut wrote:
[....]
- (MusicDeviceInstrumentID) instrumentIDForIndex:(short)index
{
OSStatus anyError;
UInt32 size = sizeof(MusicDeviceInstrumentID);
MusicDeviceInstrumentID instrumentID;
// Get the InstrumentID for this index
anyError = AudioUnitGetProperty([self nativeMusicDevice],
kMusicDeviceProperty_InstrumentNumber, kAudioUnitScope_Global,
index,
&instrumentID, &size);
if (anyError != noErr)
{
NSLog(@"RSMusicDevice: instrumentIDForIndex failed to get
instrument
at desired index.");
instrumentID = 0;
}
return instrumentID;
}
This is the right code, and I went back and dumped all instrument
ID's and found that I do get values like the ones you saw -
instrument ID: 0x0
instrument ID: 0x80000
instrument ID: 0x100000
instrument ID: 0x1
instrument ID: 0x80001
instrument ID: 0x2
instrument ID: 0x80002
instrument ID: 0x3
instrument ID: 0x80003
instrument ID: 0x4
instrument ID: 0x80004
instrument ID: 0x100004
...but these all work for me.
A difference is that I don't use MusicDeviceStartNote(), I set the
instrument and patch with three calls to MusicDeviceMIDIEvent().
Perhaps someone else on the list who uses MusicDeviceStartNote()
successfully
for these instruments can respond? I'd expect that this call is just
sending
the same low-level midi messages using bytes from the ID, so it
should work
the same. However if you want the midi-event patch-setting code let
me know and
I'll send or post it.
- 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.
_______________________________________________
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.