• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Issue with MusicDeviceMidiEvent() on hosted synth-type AU's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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,&noteParams);
       
       // 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

  • Prev by Date: Core Audio Book
  • Next by Date: Re: Core Audio Book
  • Previous by thread: Re: Core Audio Book
  • Next by thread: Limiting available sample rates
  • Index(es):
    • Date
    • Thread