The AUSampler (kAudioUnitSubType_Sampler
) is monotimbral (reference and here) so in order to play two notes of the same pitch simultaneously, you will need two "instruments" - i.e. to instances of the AUSampler. In my projects, I have found that this doesn't add much to the memory overhead since the sound resources get shared.
As for aftertouch - I haven't explored that but it seems like the property you want is kAUGroupParameterID_KeyPressure_FirstKey
(References here, and maybe here).
Supporting the kAUGroupParameterID_KeyPressure parameter indicates to
hosts that your audio unit supports polyphonic "aftertouch" key pressure.
Each of the 128 MIDI key numbers can have its own value for polyphonic
aftertouch. To respond to aftertouch for a particular key, your audio
unit needs to support an additional parameter specifically for that key.
The aftertouch parameter ID for a given MIDI key is equal to the MIDI
key number plus 256. For example, the aftertouch parameter ID for MIDI
key #60 (middle C) is:
60 + kAUGroupParameterID_KeyPressure_FirstKey = 316
If you get aftertouch working, post back some sample code.