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: Bill Stewart <email@hidden>
- Date: Mon, 2 Jun 2003 23:04:27 -0700
Christopher
I think the difference is a misunderstanding of what StartNote expects
and which we'll have to sort out...
I was under the impression that StartNote would still play even if the
instrument had not been prepared... By setting the bank and patch
numbers you do implicilty prepare the instrument. However, this doesn't
appear to be the case...(despite my previous comment!)
So... either PrepareInstrument is required to be called - in which case
starting a note with an instrument that is *not* prepared would yield
an error, or it is *not* required to be called, in which case the start
note call would prepare the instrument.
Bill
On Monday, June 2, 2003, at 03:03 PM, Christopher Corbell wrote:
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.
--
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.