# Appendix B: The <binding> element Adding a binding to a UI control, MIDI handler, or modulator tells the DecentSampler engine that it should take input from a source and use it to change values in another part of the engine. An example of this would be a knob which controls the volume of a group, a CC controller that changes an effect parameter, or an LFO that modulates an effect parameter. In order to set up a binding for a specific source, create a `` element within the source element. In this example, a labeled knob is controlling the volume of the first group of samples (group 0): ```xml ``` Here's a full list of parameters for the `` element: | Attribute | Description | | |:---------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------| | **`type`** | This tells the engine what type of parameter this is. Valid values are: `amp`, `general`, `effect`, `control`, `note`, `note_binding`, `velocity_binding`, `button_state_binding`, `keyboard_color`, `modulator`, `note_sequence`. | Required | | **`level`** | Valid values are `ui`, `instrument`, `group`, `tag`, `midi` | Required | | **`position`** | The specific 0-based index of the element to be modified by this binding. If you are targeting a group, for example, the first group would be 0, the second group would be 1, etc. | Required | | **`controlIndex`** | When a binding is targeting a control, this is the same thing as the `position` attribute. It is a specific 0-based index of the control to be modified by this binding. If you are targeting an group-level effect, this would specified the group under which the effect lives. | Optional | | **`groupIndex`** | When a binding is targeting a group, this is the same thing as the `position` attribute. It is a specific 0-based index of the group to be modified by this binding. If you are targeting an group-level effect, this would specified the group under which the effect lives. | Optional | | **`effectIndex`** | When a binding is targeting an effect, this is the same thing as the `position` attribute. It is a specific 0-based index of the effect to be modified by this binding. | Optional | | **`modulatorIndex`** | When a binding is targeting a modulator, this is the same thing as the `position` attribute. It is a specific 0-based index of the modulator to be modified by this binding. | Optional | | **`tags`** | A comma-separated list of tags to be modified by this binding. This allows you to set values for multiple groups at once by targeting a tag that is assigned to the groups. | Optional | | **`enabled`** | A value that turns the binding on and off. Valid values are: `true`, `false`. | Optional | | **`identifier`** | A string identifying the specific parameter that you wish to change. If you are modulating based on tags, you would put the tag you are targeting here. See Appendix D for example. | Required | | **`parameter`** | A token describing the specific kind of parameter that you wish to change. A list of controller parameters are below. | Required | | **`translation`** | Valid values are `fixed_value`, `linear` and `table`. Explanation of both translation modes is in a separate section below. Default: `linear` | Optional | | **`translationOutputMin`** | This is the min value this binding should send to the target parameter. This is only looked at if translation is set to `linear`. | Optional | | **`translationOutputMax`** | This is the max value this binding should send to the target parameter. This is only looked at if translation is set to `linear`. | Optional | | **`translationReversed`** | Valid values are `true` and `false`. Default: `false`. This is only looked at if translation is set to `linear`. | Optional | | **`translationTable`** | A list of input-output pairs that make up the translation table. The input and output are separated by commas. The groups of coordinates themselves are separated by semi-colons. Default: `0,0;1,1`. You must have at least two coordinates in your list. This is only looked at if translation is set to `table`. | Optional | | **`translationValue`** | The value that should be passed along when `translation` is set to `fixed_value`. | Optional | ## Binding Parameters for Targeting Note Sequences A special set of binding attributes exist for targeting note sequences: | Attribute | Description | Default | Required | |:--------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------|:----------------------------------------------------| | **`seqIndex`** | A 0-based index of a sequence underneath the `` section | None | Required | | **`seqFollowGlobalTempo`** | Whether or not the sequence should follow the global tempo. Valid values are `true` and `false`. If this is set to false, then playback will be hardcoded at 120BPM. This can be useful if you want to assure that sequences will always play back at the same rate regardless of the DAW clock. | `true` | Optional | | **`seqTriggerBehavior`** | What the binding should do with the sequence in question. Valid values are `on` (start playing the sequence), `off` (stop playing the sequence), `midi_key` (special value that will cause the binding to follow a specific MIDI key note binding) | `midi_key` | Optional | | **`seqPlayerIdentifier`** | An identifier used for tracking the state of a sequence. This value can be any sequence of numbers or letters. | None | Required when `seqTriggerBehavior` is `on` or `off` | | **`seqTrackMidiInputVelocity`** | Whether or not the sequence should respect the velocity of the incoming MIDI note. This can only be used when the sequence is being triggered by a MIDI note binding. Value should be a floating point number from 0.0 to 1. | | Optional | | **`seqTranspose`** | Transpose the notes in the sequence by an arbitrary number of half steps. Value should be a floating point number from -36 to 36. | Any sequence of numbers of letters | Optional | | **`seqTransposeWithRootNote`** | Transpose the notes in the sequence relative to the pitch of the incoming MIDI note. This can only be used when the sequence is being triggered by a MIDI note binding. Value should be a floating point number from 0 to 127. | Any sequence of numbers of letters | Optional | | **`seqPlaybackRate`** | The speed of playback. Value should be a floating point number from 0.001 to 10000. | 1.0 | Optional | | **`seqLoopMode`** | Valid values are: `forward`, `reverse`, `random`, `random_no_repeat`, `no_loop` | `forward` | Optional | ## Controllable Parameters This is a list of parameters that can be used in conjunction with the `` element above. NOTE: The table below scrolls to the right. | Description | `type` | `level` | `parameter` | Valid Range | Modulatable | Additional required parameters | |:-----------------------------------------------------|:-----------------------|:------------------------|:--------------------------------|:--------------------------------------------------------------|:------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Global Volume | `amp` | `instrument` | `AMP_VOLUME` | 0.0 - 16.0 | No | N/A | | Global Tuning | `amp` | `instrument` | `GLOBAL_TUNING` | -36.0 - 36.0 | No | N/A | | Global Pan | `amp` | `instrument` | `PAN` | -100 - 100 | No | N/A | | Sample Start (see note 2 below) | `general` | `instrument` or `group` | `SAMPLE_START` | 0 - last sample | No | This value will be in number of raw samples where 0 is the beginning. See note 2 below. | | Sample End (see note 2 below) | `general` | `instrument` or `group` | `SAMPLE_END` | 0 - last sample | No | This value will be in number of raw samples where 0 is the beginning. See note 2 below. | | Loop Start (see note 2 below) | `general` | `instrument` or `group` | `LOOP_START` | 0 - last sample | No | This value will be in number of raw samples where 0 is the beginning. See note 2 below. | | Loop End (see note 2 below) | `general` | `instrument` or `group` | `LOOP_END` | 0 - last sample | No | This value will be in number of raw samples where 0 is the beginning. See note 2 below. | | Amplitude Velocity Tracking | `amp` | `instrument` | `AMP_VEL_TRACK` | 0.0 - 1.0 | No | N/A | | Global Amp Envelope Attack | `amp` | `instrument` | `ENV_ATTACK` | 0.0 - 10.0 | No | N/A | | Global Amp Envelope Attack Curve Shape | `amp` | `instrument` | `ENV_ATTACK_CURVE` | -100 - 100 | No | N/A | | Global Amp Envelope Decay | `amp` | `instrument` | `ENV_DECAY` | 0.0 - 25.0 | No | N/A | | Global Amp Envelope Decay Curve Shape | `amp` | `instrument` | `ENV_DECAY_CURVE` | -100 - 100 | No | N/A | | Global Amp Envelope Sustain | `amp` | `instrument` | `ENV_SUSTAIN` | 0.0 - 1.0 | No | N/A | | Global Amp Envelope Release | `amp` | `instrument` | `ENV_RELEASE` | 0.0 - 25.0 | No | N/A | | Global Amp Envelope Release Curve Shape | `amp` | `instrument` | `ENV_RELEASE_CURVE` | -100 - 100 | No | N/A | | Glide/Portamento Time | `amp` | `instrument` | `GLIDE_TIME` | 0.0 - 10.0 | No | N/A | | Group Enabled / Disabled | `amp` | `group` | `ENABLED` | true, false | | `groupIndex` or `position` contains the 0-based index of the group | | Group Volume | `amp` | `group` | `AMP_VOLUME` | 0.0 - 16.0 | Yes | `groupIndex` or `position` contains the 0-based index of the group | | Group Tuning | `amp` | `group` | `GROUP_TUNING` | -36.0 - 36.0 | Yes | `groupIndex` or `position` contains the 0-based index of the group | | Pan | `amp` | `group` | `PAN` | -100 - 100 | Yes | `groupIndex` or `position` contains the 0-based index of the group | | Amplitude Velocity Tracking | `amp` | `group` | `AMP_VEL_TRACK` | 0.0 - 1.0 | | `groupIndex` or `position` contains the 0-based index of the group | | Group Amp Envelope Attack | `amp` | `group` | `ENV_ATTACK` | 0.0 - 10.0 | | `groupIndex` or `position` contains the 0-based index of the group | | Group Amp Envelope Decay | `amp` | `group` | `ENV_DECAY` | 0.0 - 25.0 | | `groupIndex` or `position` contains the 0-based index of the group | | Group Amp Envelope Sustain | `amp` | `group` | `ENV_SUSTAIN` | 0.0 - 1.0 | | `groupIndex` or `position` contains the 0-based index of the group | | Group Amp Envelope Release | `amp` | `group` | `ENV_RELEASE` | 0.0 - 25.0 | | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 1 Volume | `amp` | `group` | `OUTPUT_1_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 2 Volume | `amp` | `group` | `OUTPUT_2_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 3 Volume | `amp` | `group` | `OUTPUT_3_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 4 Volume | `amp` | `group` | `OUTPUT_4_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 5 Volume | `amp` | `group` | `OUTPUT_5_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 6 Volume | `amp` | `group` | `OUTPUT_6_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 7 Volume | `amp` | `group` | `OUTPUT_7_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 8 Volume | `amp` | `group` | `OUTPUT_8_VOLUME` | 0.0 - 1 | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 1 Target | `amp` | `group` | `OUTPUT_1_TARGET` | Any of the valid values for `output1Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 2 Target | `amp` | `group` | `OUTPUT_2_TARGET` | Any of the valid values for `output2Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 3 Target | `amp` | `group` | `OUTPUT_3_TARGET` | Any of the valid values for `output3Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 4 Target | `amp` | `group` | `OUTPUT_4_TARGET` | Any of the valid values for `output4Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 5 Target | `amp` | `group` | `OUTPUT_5_TARGET` | Any of the valid values for `output5Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 6 Target | `amp` | `group` | `OUTPUT_6_TARGET` | Any of the valid values for `output6Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 7 Target | `amp` | `group` | `OUTPUT_7_TARGET` | Any of the valid values for `output7Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Output 8 Target | `amp` | `group` | `OUTPUT_8_TARGET` | Any of the valid values for `output8Target` | No | `groupIndex` or `position` contains the 0-based index of the group | | Group Glide/Portamento Time | `amp` | `group` | `GLIDE_TIME` | 0.0 - 10.0 | | `groupIndex` or `position` contains the 0-based index of the group | | Tag Enabled | `amp` | `tag` | `TAG_ENABLED` | true, false | | `identifier` contains the tag name | | Tag Volume | `amp` | `tag` | `TAG_VOLUME` | 0.0 - 16.0 | | `identifier` contains the tag name | | MIDI CC Binding Enabled | `cc_binding` | `midi` | `ENABLED` | `true` or `false` | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Mapping Enabled | `note` | `midi` | `ENABLED` | Any number | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) | | MIDI Note Binding Enabled | `note_binding` | `midi` | `ENABLED` | Any number | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Binding Change `seqIndex` | `note_binding` | `midi` | `SEQ_INDEX` | Any whole number | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Binding Change `seqLoopMode` | `note_binding` | `midi` | `SEQ_LOOP_MODE` | `forward`, `reverse`, `random`, `random_no_repeat`, `no_loop` | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Binding Change `seqTransposeWithRootNote` | `note_binding` | `midi` | `SEQ_TRANSPOSE_WITH_ROOT_NOTE` | 0 - 128 | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Binding Change `seqPlaybackRate` | `note_binding` | `midi` | `SEQ_PLAYBACK_RATE` | 0.001 - 10000 | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Binding Change `seqTrackMidiInputVelocity` | `note_binding` | `midi` | `SEQ_TRACK_MIDI_INPUT_VELOCITY` | 0.0 - 1.0 | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Note Binding Change `seqTranspose` | `note_binding` | `midi` | `SEQ_TRANSPOSE` | -36 - 36 | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | MIDI Velocity Binding Enabled | `velocity_binding` | `midi` | `ENABLED` | `true` or `false` | | `midiElementIndex` that contains the 0-based index of the note handler within the `` element (this used to be called ``) and `bindingIndex` that contains the index of the binding being referenced. | | Modulator Amount (Depth) | `modulator` | `instrument` | `MOD_AMOUNT` | 0.0 - 1.0 | | `modulatorIndex` contains the 0-based index of the modulator in question | | LFO Modulator Rate (or Frequency) | `modulator` | `instrument` | `FREQUENCY` | 0.0 - 22000.0 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Attack | `modulator` | `instrument` | `ENV_ATTACK` | 0.0 - 10.0 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Attack Curve Shape | `modulator` | `instrument` | `ENV_ATTACK_CURVE` | -100 - 100 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Decay | `modulator` | `instrument` | `ENV_DECAY` | 0.0 - 25.0 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Decay Curve Shape | `modulator` | `instrument` | `ENV_DECAY_CURVE` | -100 - 100 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Sustain | `modulator` | `instrument` | `ENV_SUSTAIN` | 0.0 - 1.0 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Release | `modulator` | `instrument` | `ENV_RELEASE` | 0.0 - 25.0 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Envelope Modulator Release Curve Shape | `modulator` | `instrument` | `ENV_RELEASE_CURVE` | -100 - 100 | | `modulatorIndex` contains the 0-based index of the modulator in question | | Sequence Rate | `note_sequence` | `instrument` | `RATE` | 0.01 - 100 | | `seqIndex` contains the 0-based index of the note sequence in question | | All Notes Off | `general` | `instrument` | `ALL_NOTES_OFF` | true | | | ### UI Parameters NOTE: The table below scrolls to the right. | Description | `type` | `level` | `parameter` | Valid Range | Modulatable | Additional required parameters | |:-----------------------------------------------------|:-----------------------|:------------------------|:--------------------------------|:--------------------------------------------------------------|:------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | UI Background Image Path | `general` | `ui` | `BG_IMAGE` | Text | | | | UI Button State Binding Enabled | `button_state_binding` | `ui` | `ENABLED` | true, false | | `tags` or `controlIndex` contains the 0-based index of the control in question (see note 1 below), `stateIndex` contains the 0-based index of the state in question, and `bindingIndex` that contains the index of the binding being referenced. | | UI Control Enabled | `control` | `ui` | `ENABLED` | true, false | | `tags` or `controlIndex`/`position` contains the 0-based index of the control in question (see note 1 below) | | UI Control Visible | `control` | `ui` | `VISIBLE` | true, false | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | UI Control Value | `control` | `ui` | `VALUE` | Any number | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | UI Control Text | `control` | `ui` | `TEXT` | Text | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | UI Control Minimum Value | `control` | `ui` | `MIN_VALUE` | Any number | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | UI Control Maximum Value | `control` | `ui` | `MAX_VALUE` | Any number | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | UI Control Value Type | `control` | `ui` | `VALUE_TYPE` | float, integer, musical_time | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | Image or Animation File Path | `control` | `ui` | `PATH` | Text | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | Image or Animation Opacity | `control` | `ui` | `OPACITY` | 0.0 - 1.0 | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | UI Keyboard Coloring Enable / Disable | `keyboard_color` | `ui`. | `ENABLED` | true, false | | `colorIndex` that contains the 0-based index of the color element within the `` element | | Animation Frame Rate | `control` | `ui` | `FRAME_RATE` | 0 - 24 | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | Animation Current Frame | `control` | `ui` | `CURRENT_FRAME` | Any number | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | Animation Playback Mode | `control` | `ui` | `PLAYBACK_MODE` | Valid values: `forward_loop`, `forward_once`, `reverse_loop`, `reverse_once`, `ping_pong_loop` (forth and back), and `stopped`. Default value is `forward_loop`. | | `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | X-Y Pad X Value | `control` | `ui` | `X_VALUE` | 0.0 - 1.0 | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | | X-Y Pad Y Value | `control` | `ui` | `Y_VALUE` | 0.0 - 1.0 | | `tags` or `controlIndex` or `position` contains the 0-based index of the control in question (see note 1 below) | 1. NOTE: The indexes of the controls within the UI also include UI controls that are not editable, such as `