Issue with MusicDeviceMidiEvent() on hosted synth-type AU's
Issue with MusicDeviceMidiEvent() on hosted synth-type AU's
- Subject: Issue with MusicDeviceMidiEvent() on hosted synth-type AU's
- From: Sean Lamont <email@hidden>
- Date: Tue, 13 Sep 2011 23:21:50 -0700
Hi there. I've been trying to do some programmatic control of aumu-type audio units.
After finally getting CocoaAUHost to compile, I patched in some extra stuff to instantiate AUMU-type instruments. This seems to work fine, but when I try and send StartNote / EndNote information to the audio unit, it gets a core audio error coming back. I have reason to believe that the AU's are functioning and outputting audio, I just can't send any controlling information. Yes, the graph is running. I'm casting mFileUnit, which is the AudioUnit
The error received is -4. NSError reports as:
2011-09-13 23:04:32.849 CocoaAUHost[45677:407] Error: Error Domain=NSOSStatusErrorDomain Code=-4 "The operation couldn’t be completed. (OSStatus error -4.)" ( / / unimplemented core routine)
Any thoughts? Is there some special way the aumu units need to be prepared in order to work?
Thanks
Sean T Lamont
Mobile Strategies
This is my IB button target method, approximately. Excuse the extraneous junk.
-(void)doThingWithNotes {
OSStatus result;
MusicDeviceGroupID groupID = 0;
MusicDeviceComponent mSynth = mFileUnit;
int midiChannelInUse = 1;
NoteInstanceID nid;
static MusicDeviceNoteParams noteParams;
int kMidiMessage_ProgramChange = 0xc;
UInt32 offset = 0;
Float32 instrument = 10;
noteParams.mVelocity = 127;
// noteParams.mPitch = 60.0f;
noteParams.argCount = 2; // pitch, velocity, and whatever is in mControls (ie, nothing)
NSLog(@"Pitch is %0.2lf\n",noteParams.mPitch);
#if 1
int patchnum = 0;
// do sequentially incrementing note generation / termination
//
OSStatus status = MusicDeviceStartNote(mSynth, kMusicNoteEvent_Unused, groupID, &nid,
offset,¬eParams);
// require_noerr(status,ParameterMissing);
sleep(1);
OSStatus status2 = MusicDeviceStopNote(mSynth, groupID, nid, 0);
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain
code:status2
userInfo:nil];
NSLog(@"Error: %@", [error description]);
sleep(1);
noteParams.mPitch += 20.0;
instrument++;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden