you can also use a soundfont with an AUSampler, which is VERY easy — you just pass the url of the sound font file when setting the kAUSamplerProperty_LoadPresetFromBank property.
here’s another thing i came across recently that might be useful: i was using a high priority real-time thread for scheduling MIDI events, (as described in https://developer.apple.com/library/ios/technotes/tn2169/_index.html <https://developer.apple.com/library/ios/technotes/tn2169/_index.html>) and it was rock-solid ONLY for sending to an external MIDI device. to get proper timing when using an AUSampler, i had to ditch that pthread stuff and just make all my MIDI calls inside the audio thread — i ended up doing them in an AURenderNotify callback (making sure to pass the proper inOffsetSampleFrame value to the MusicDeviceMIDIEvent calls) -m > On Dec 5, 2014, at 1:18 PM, Mark Stultz <[email protected]> wrote: > > You could use AUSampler to store your tick and tock audio samples. You could > then use the MusicPlayer API to playback a MusicSequence that could store a > looping MIDI sequence which sends commands to play the tick and tock samples > at whatever intervals you specify. > > I don't remember which year, but I recall that there was a helpful WWDC video > that discusses AUSampler. I believe it also shows how you would set up those > samples in AULab. Basically you create a .aupreset in AULab.app that contains > the tick/tock sample mapping, that you then load into your AUSampler (There > is a tech note on how to do this). > > Mark > > On Fri, Dec 5, 2014 at 4:05 PM, Benjamin Rindt <[email protected] > <mailto:[email protected]>> wrote: > Hey guys, > > basically I need to create a metronome and I want to play a tick or a tock. > Is AUSampler the right way to go about it? > > It looks like it is some serious work to get 2 sound files into somehow a > bank and load it into AUSampler but I still don’t know how its done. Is there > an easier way to do this? Looks like AUSampler is little bit too much for > such a small thing. > > Is there another way to trigger a sound with a MIDI event? Any ideas would be > appreciated or how to make a AUSampler bank I can use. I haven’t found > anything how to do it. In the documentation is mentioned that it would be > possible in AULab but I don’t know how. > > > Thanks in advance guys! > > - Benjamin > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list ([email protected] > <mailto:[email protected]>) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/mstultz%40gmail.com > <https://lists.apple.com/mailman/options/coreaudio-api/mstultz%40gmail.com> > > This email sent to [email protected] <mailto:[email protected]> > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list ([email protected] > <mailto:[email protected]>) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/matt%40sonomatics.com > <https://lists.apple.com/mailman/options/coreaudio-api/matt%40sonomatics.com> > > This email sent to [email protected] <mailto:[email protected]>
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to [email protected]
