• 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
Re: kMusicDeviceProperty_InstrumentCount
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kMusicDeviceProperty_InstrumentCount


  • Subject: Re: kMusicDeviceProperty_InstrumentCount
  • From: Craig Bakalian <email@hidden>
  • Date: Thu, 30 Oct 2003 14:17:38 -0500

Hi,
Yes, Okay. I got it. I was guessing at the parameters for the AudioUnitGetProperty call. I didn't understand the scope and element bit yet, now I do. Thanks for the help. And for future reference, how does one know the kAudioUnitScope_ type based upon the AudioUnit. Where would I find this information? The same for the element parameter.

Craig Bakalian

On Thursday, October 30, 2003, at 11:17 AM, Marc Poirier wrote:

I am using this code to get the instrument count with a -50.

-(NSArray *)instrumentArray
{
AUNode synthNode;
AudioUnit theSynth;
UInt32 count =0;
UInt32 size = 0;

OSStatus err;
AUGraphGetIndNode(graph, 0, &synthNode);
err = AUGraphGetNodeInfo(graph, synthNode, NULL, NULL, NULL,
&theSynth);
err = AudioUnitGetProperty(theSynth,
kMusicDeviceProperty_InstrumentCount, kAudioUnitScope_Output, 2,
&count, &size);
NSLog(@"%d", err);

return blahblah...
}

I see 1 definite mistake. You should have
UInt32 size = sizeof(count);
not:
UInt32 size = 0;
The ioDataSize argument of AudioUnitGetProperty is an input/output
argument. On entry, it lets you say how large the the data buffer you are
passing is. On return, the value may be changed to the size of the data
actually gotten, if that differs from the entry value. So what you are
saying is, "Here's a data buffer that has space for 0 bytes of data.
Please put the data in there," which won't work.

The other possible problem is specifying 2 as the element in
AudioUnitGetProperty. The DLS MD doesn't have 3 elements, does it? I
think that you want to pass 0 for element 1, since instrument count is
element-global, isn't it? Anyway, this point I'm not so sure about, but
the size thing I know will not work and needs to change.

Marc



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.

  • Follow-Ups:
    • Re: kMusicDeviceProperty_InstrumentCount
      • From: Marc Poirier <email@hidden>
  • Prev by Date: Re: kMusicDeviceProperty_InstrumentCount
  • Next by Date: got MatrixMixerTest working
  • Previous by thread: Re: kMusicDeviceProperty_InstrumentCount
  • Next by thread: Re: kMusicDeviceProperty_InstrumentCount
  • Index(es):
    • Date
    • Thread