Re: Couple of AUSampler questions:
Re: Couple of AUSampler questions:
- Subject: Re: Couple of AUSampler questions:
- From: Andrew Lim <email@hidden>
- Date: Wed, 13 Jun 2012 15:03:30 -0700
1 - I had this same impression because the WWDC videos from last year made that implication. But I have asked this several times on the Apple Developer forum and it is completely possible to do this. I am able to load sounds from the Documents folder, and there is also some search path for sounds as well. See this document,
http://developer.apple.com/library/ios/#technotes/tn2283/_index.html
And yes you can do this during runtime, or even while MIDI data is being sent to the unit.
2 - The AUSampler is not a multi-timbral instrument like DLSMusicSynth, it can only have one instrument loaded at a time (though this instrument can of course be made up of multiple layers, i.e., multi-sampled piano instrument, velocity layer samples, or even a drum kit).
If you desire having multiple channels then I would suggest using an AUGraph. You will need to add a Multichannel Mixer and configure it with the number of elements (channels) you want. Create an AUSampler instance for each element. You may optionally place your distortion/delay/filter/FX/etc. units in between the desired AUSampler instance and the Multichannel mixer. You could even add a unit between the MultichannelMixer and the RemoteIO, for master effects.
In this setup, each AUSampler is its own "channel". You will need to load a sample/instrument into each AUSampler separately. You have a choice of controlling pan and volume at the MultichannelMixer element level, or accessing AUSampler's parameters to do this (giving you access to other things such as coarse pitch, fine pitch, etc).
You can also automate the usual standard MIDI CCs. (Send MIDI events to it using MusicDeviceMIDIEvent)
If you are planning to play MIDI files using the MusicPlayer class, you can iterate through each MusicTrack in the MusicSequence and use MusicTrackSetDestNode to assign the MIDI track to the individual AUSampler node. (you'll also need to assign the MusicSequence to the AUGraph using MusicSequenceSetAUGraph).
Hope that helps.
Andrew
On Wed, Jun 13, 2012 at 3:15 AM, Ben
<email@hidden> wrote:
Regarding AUSampler:
1) Can I load in new samples to an AUSampler during runtime, for instance by downloading samples from the internet? I keep reading stuff which suggests that I can not do this, is this true?
2) How do I access individual the raw data from 'channels' (for want of better terminology) of an AUSampler? So for example: Lets say I load in 10 samples, each of which is assigned to a separate midi channel. How would I access midi channel 1 to process through a distortion audio unit separately from channel 2 (which i might for instance want to process with a delay)?
Thanks in advance.
_______________________________________________
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
_______________________________________________
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