AKAUPresetBuilder

open class AKAUPresetBuilder

Builds presets for Apple sampler to read from

  • Create an AUPreset from a collection of dictionaries. dict is a collection of other dictionaries that have the format like this: - Key:Value - filename: string - rootnote: int - startnote: int (optional) - endnote: int (optional)

    • Parameters:
      • dict: Collection of dictionaries with format as given above
      • path: Where the AUPreset will be created
      • instrumentName: The name of the AUPreset
      • attack: Attack time in seconds
      • release: Release time in seconds

    Declaration

    Swift

    static open func createAUPreset(dict: NSDictionary,
                                        path: String,
                                        instrumentName: String,
                                        attack: Double? = 0,
                                        release: Double? = 0)

    Parameters

    dict

    Collection of dictionaries with format as given above

    path

    Where the AUPreset will be created

    instrumentName

    The name of the AUPreset

    attack

    Attack time in seconds

    release

    Release time in seconds

  • This functions returns 1 dictionary entry for a particular sample zone. You then add this to an array, and feed that into createAUPreset

    • Parameters:
      • rootNote: Note at which the sample playback is unchanged
      • filename: Name of the file
      • startNote: First note in range
      • endNote: Last note in range

    Declaration

    Swift

    open static func generateDictionary(
            rootNote: Int,
            filename: String,
            startNote: Int,
            endNote: Int) -> NSMutableDictionary

    Parameters

    rootNote

    Note at which the sample playback is unchanged

    filename

    Name of the file

    startNote

    First note in range

    endNote

    Last note in range

  • Build the instrument file

    • Parameters:
      • name: Coded instrument name
      • connections: Connection XML
      • envelopes: Envelopes XML
      • filter: Filter XML
      • lfos: Low Frequency Oscillator XML
      • zones: Zones XML
      • filerefs: File references XML
      • layers: Combined xml

    Declaration

    Swift

    static open func buildInstrument(name: String = "Coded Instrument Name",
                                         connections: String = "",
                                         envelopes: String = "",
                                         filter: String = "",
                                         lfos: String = "",
                                         zones: String = "***ZONES***\n",
                                         filerefs: String = "***FILEREFS***\n",
                                         layers: String = "") -> String

    Parameters

    name

    Coded instrument name

    connections

    Connection XML

    envelopes

    Envelopes XML

    filter

    Filter XML

    lfos

    Low Frequency Oscillator XML

    zones

    Zones XML

    filerefs

    File references XML

    layers

    Combined xml