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: Chris Rogers <email@hidden>
- Date: Mon, 2 Jun 2003 15:31:21 -0700
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.