Setting A MusicDevice's Instrument Timbre
Setting A MusicDevice's Instrument Timbre
- Subject: Setting A MusicDevice's Instrument Timbre
- From: Craig Bakalian <email@hidden>
- Date: Fri, 31 Oct 2003 14:44:53 -0500
Hi,
It is me again. I am still fussing with the property types to pass in
to a AudioUnit. How do I set an MusicDevice's instrument? The below
code is of course not working. I am getting a
kAudioUnitErr_InvalidProperty for the err. Please, any help is
appreciated.
-(void)setInstrumentNumber: (id)sender ForTrackNumber: (UInt32)num
{
UInt32 instrumentNumber = (UInt32)[sender indexOfSelectedItem];
AUNode synthNode;
AudioUnit theSynth;
AUGraph track = [[self document] getGraphForTrackNumber: num];
AUGraphGetIndNode(track, 0, &synthNode);
AUGraphGetNodeInfo(track, synthNode, NULL, NULL, NULL, &theSynth);
OSStatus err;
MusicDeviceInstrumentID musicID;
UInt32 size = sizeof(musicID);
err = AudioUnitGetProperty(theSynth,
kMusicDeviceProperty_InstrumentNumber, kAudioUnitScope_Global,
instrumentNumber, &musicID, &size);
//err = 0 good!
err = AudioUnitSetProperty(theSynth,
kMusicDeviceProperty_InstrumentNumber, kAudioUnitScope_Global,
instrumentNumber, &musicID, size);
//err = -10879
}
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
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.