SoundFont Parameters in AUSampler for iOS

The AUSampler Audio Unit (or AVAudioUnitSampler class, available since iOS 8) can be used to load samples in various formats such as SoundFont, EXS24, or plain WAVE files, and play MIDI events using those samples. In this article I am describing issues I have discovered when using SoundFonts in the sampler within a mobile iOS app. Sometimes workarounds are available.

When planning a new app these issues could influence the decision whether to use Apple’s AUSampler, to license a 3rd party package (e.g. bismark synth), or to write your own DIY sampler.

SoundFonts can be downloaded from websites, or you can create your own. A good editor is Polyphone which also lets you listen to samples, instruments, and presets, especially with parameters you have entered. I have noticed that Apple’s AUSampler has problems with complex SoundFonts such as GeneralUser GS by S. Christian Collins. This may be partly due to sophisticated layering of instruments, or because some SoundFont parameters do not seem to work as expected in the sampler. This may be confusing because all parameters sound good in Polyphone but some just sound wrong in AUSampler. Here is a list of such parameters that I have identified so far.

Attenuation

The sample volume is reduced by the attenuation value in dB. The allowed raw range is 0…1440 which translates to 0…144 dB. In AUSampler the sample sounds as if it is reduced by only 10% of this value. So essentially entered values are interpreted as 0…14.4 dB. Looks like AUSampler seems to divide by 10 two times (raw to dB, and then one more time?).

Unfortunately there is no workaround if you want to hear values higher than 14.4 dB. Of course you can change the sample amplitude but it’s not feasible for fine-tuning.

Vol Env Release

This parameter works well at instrument level.

Mod LFO freq

This parameter works as intended. In Polyphone I recommend to set this parameter to 1.0 at instrument level so you can set desired values at multiple presets using the same instrument. In Polyphone the default value at instrument level is around 8.

Mod LFO volume

Works at instrument or preset level. Multiply the value with 10 in order to work as expected in AUSampler (see Attenuation).

Hint for sound designers: This parameter works well if you need a vibrato of tremolo type, for example for a vibraphone or panpipe.

Vib LFO Delay

This parameter works only at instrument level, not at preset level.

Vib LFO Rate

This parameter works at preset level.

Vib LFO Pitch

Value is in cents but AUSampler does not really sound like a semitone if a value of 100 is entered. I figured if you multiply the value with 15 it sounds in AUSampler like it sounds in Polyphone with the original value.

Tip: It is useful to preview sounds in Polyphone. But it is cumbersome to edit values forth and back just so it works in AUSampler, then in Polyphone, then again in AUSampler etc. Duplicate the preset (I append an asterisk (*) to the name) and change the Vib LFO pitch value to work with AUSampler, for example 100 ct becomes 1500. Now in the app you load the duplicate preset, and in Polyphone you use the original preset for preview.

This parameter works at preset level.

Chorus, Reverb

These parameters do not work, there are no built-in effects in AUSampler.