Skip to content

Roles of the PresetBank

Guillaume Piolat edited this page Jan 11, 2021 · 6 revisions

Preset is an aggregate (preset name + N x normalized parameters)

PresetBank is an aggregate (M x Presets + "current" index)

PresetBank and Preset fulfills many different roles that we need to analyze.

What different modules need from Presets and the PresetBank:

(this is the current state of Dplug as of Jan 2021)

dplug.client.client.Client

  • holds factory presets
  • gives access to the PresetBank as a part of itself
  • can create a default Preset

LV2 Client:

  • doesn't need the presetbank to save/restore, the host deals with that with parameters
  • ergo, upgrading chunks would not allow state without using the LV2 extension for this
  • generating the LV2 presets iterate the PresetBank and hence keep the normalization to make the .ttl

VST3 Client:

  • save/restore with state chunks from the presetbank (but state chunks have nothing to do with the presetbank actually)
  • can get preset names (but not set them)
  • expose a fake program change parameter, which is used by the host to change the preset (again: normalized)
  • setting this parameter calls _presetBank.loadPresetFromHost, which does the following:
    • calls putCurrentStateInCurrentPreset which store current state into current preset (!!?)
    • calls loadFromHost which put the nth preset values into the parameters

AAX Client:

  • save/restore with state chunks from the presetbank
  • generating the AAX presets iterate the PresetBank and hence keep the normalization to make the .tfx, where the state chunk is wrapped.

AU Client:

  • save/restore with state chunks from the presetbank, wrapped inside
  • can get the current Preset values and name
  • can set presets, calling loadPresetFromHost
  • can appends a new default preset and load immediately, using addNewDefaultPresetFromHost (!!?)
  • current index doesn't seem to be used?
  • describing factory presets (kAudioUnitProperty_FactoryPresets) needs a lot of CoreFoundation scaffolding

VST2 Client:

  • save/restore with host-provided mechanism, we'd like to go into chunks instead
  • can set and get the current preset index. Setting is done with: loadPresetFromHost
  • can get and set preset name
  • effGetChunk returns "preset" and "bank" chunks: one contain just the preset and the other contains the whole bank. They are only used in VST2.4 when chunks are activated.