Configuring controls for AUSampler in AULab
Configuring controls for AUSampler in AULab
- Subject: Configuring controls for AUSampler in AULab
- From: Jack Nutting <email@hidden>
- Date: Tue, 08 May 2012 12:05:23 +0200
I'm working on integrating an AUSampler unit in an iOS app. I've
managed to create an aupreset with AULab, and in the app I
successfully load it up and play notes programmatically by sending
midi events. So far so good, but I'd also like to be able to effect
the characteristics of the instrument programmatically just like I
would with a real-world controller, and I'm enough of a MIDI noob that
I just don't see what to do here.
For instance, the sampler created in AULab has some connections set up
in the Connection Editor Pane, which are all defined to create the
basic sound, mapping keys to pitches etc. The Zone/Layer Grid Editing
Page also contains some controls for the envelope, filter, and LFO,
all put there by default when I created the instrument. From the looks
of it, it seems like if I want to control something like the filter's
cutoff frequency, I should add one item in the Connection Editor Pane.
So I tried this. I picked the unused "Ctrl 13" from the Source list,
and Cutoff Freq from the Destination list. In the app, I created this
method:
- (void)setUnit:(MusicDeviceComponent)unit control:(UInt8)control
value:(UInt8)value {
UInt32 midiStatus = 0xB0; // control change message
CheckError(MusicDeviceMIDIEvent(unit,
midiStatus,
control,
value,
0),
"Couldn't send MIDI event");
}
Which I use like this to try to change the cutoff frequency in real time:
[audioController setUnit:anInstrumentUnit control:13
value:aVal]; // aVal is an int between 0 and 127
In the running app, I'm basically varying the value of aVal by
dragging a finger back and forth across the screen. What happens when
I do this doesn't sound anything like adjusting the cutoff frequency
in AULab. Instead, apart from a *very* light click or tick when I
change the value, the sample doesn't audibly change at all.
Anyway, I've clearly misunderstood something. Either I've got the MIDI
messaging wrong, or I've misconfigured something in AULab. Perhaps
both. Does anyone have any ideas?
--
// Jack Nutting
// email@hidden
// http://nuthole.com
// http://learncocoa.org
_______________________________________________
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