The <effects> element =========================== Adding global, instrument-wide effects is easy: just add an `` element right below your top-level `` element. It is also possible to have effects that only get added to a specific group. To adding effects that only apply to a specific group, all you need to do is create an `` group that lives underneath the `` element for the group you want to affect. Group level effects are initialized every time a note is started and destroyed every time a note is stopped. If you play two notes simultaneously, two instances of this effect will be created and these will be independent of eachother. As a result, they use more CPU than global effects. NOTE: Only certain effects will work as group-level effects: lowpass filter, hipass filter, bandpass filter, gain, and chorus. Delay and reverb cannot work properly as they will be deleted before their tail peters out. ## The <effect> element Within the `` element, you can have any number of `` sub-elements. These specify parameters for each individual effect that you would like to have in your global effects chain. There are currently only a handful effects available although more could definitely be added on request: All `` elements support a **`tags`** attribute — a comma-separated list of tag names. Tags allow bindings to target effects by name instead of by numeric index. For example: ```xml ``` A binding can then reference this effect using `tags="main-filter"` instead of `effectIndex="0"`: ```xml ``` ### Low-pass, Band pass, and Hi-pass filter A 2-pole resonant filter that can be either a lowpass, bandpass, or highpass filter Example: ```xml ``` There is also a single pole version of the lowpass filter that can be accessed using the `lowpass_1pl` effect type. This version does not have a resonance parameter. ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | | ----------- | -------- | ------------------------ | ------------------------------------------------------------------------------------------ | ------- | | `type` | Required | The type of filter | Must be either `lowpass` (legacy: `lowpass_4pl`), `lowpass_1pl`, `bandpass`, or `highpass` | | | `resonance` | Optional | The filter resonance (Q) | 0.001 - 5.0, where 5 is big, 0 is small. | 0.7 | | `frequency` | Optional | The filter frequency | 0 - 22000 | 22000 | ### Notch EQ Filter A simple notch filter. Example: ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | | ----------- | -------- | ------------------------ | --------------------------------------------------------------------------- | ------- | | `type` | Required | The type of filter | Must be `notch` | | | `frequency` | Required | The filter frequency | 60 - 22000.0 | 10000 | | `Q` | Optional | Q is the ratio of center frequency to bandwidth | 0.01 - 18.0 | 0.7 | ### Peak EQ Filter A peak filter centred around a given frequency, with a variable Q and gain. Example: ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | | ----------- | -------- | ------------------------ | --------------------------------------------------------------------------- | ------- | | `type` | Required | The type of filter | Must be `peak` | | | `frequency` | Required | The filter frequency | 60 - 22000.0 | 10000 | | `Q` | Optional | Q is the ratio of center frequency to bandwidth | 0.01 - 18.0 | 0.7 | | `gain` | Required | Values greater than 1.0 will boost the high frequencies, values less than 1.0 will attenuate them. | 0 - 1.0 | 1.0 | ### Gain effect Applies a volume boost or cut to the output signal. Example: ```xml ``` Attributes: | Attribute | | Type | Default | Valid Range | | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------- | | `type` | Required | Must be `gain` | | `gain` | | `level` | Required | The amount of gain to apply. By default (and for backwards compatibility) this is expressed in **decibels** (e.g. `-6` reduces the signal by ~50%). If `levelUnit="linear"` is also set, this value is treated as a **linear multiplier** (e.g. `0.5` reduces the signal by 50%, `1.0` is unity gain, `2.0` doubles it). | `0` | dB: -99 – 24; linear: 0.0 – 8.0 | | `levelUnit` | Optional | Specifies the unit for the `level` attribute. Valid values are `decibels` (default, for backwards compatibility) and `linear`. When set to `linear`, the `level` attribute is treated as a linear multiplier rather than a dB value. **Note:** this attribute must appear before `level` in the XML element. | `decibels` | `decibels`, `linear` | ### Reverb effect Example: ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | | ---------- | -------- | --------------------------- | ---------------------------------------------------- | ------- | | `type` | Required | Must be `reverb` | `reverb` | | | `roomSize` | Optional | The reverb "room size" | 0 - 1.0, where 1.0 is big, 0 is small. | 0.7 | | `damping` | Optional | The reverb damping level | 0 - 1.0, where 0 is not damped, 1.0 is fully damped. | 0.3 | | `wetLevel` | Optional | The volume of reverb signal | 0 - 1.0 | 0 | ### Delay effect A simple delay effect that can be controlled either in seconds or using musical time increments based on the host tempo. For a complete explanation of how to use tempo-syncing, see [here](https://www.decentsamples.com/2024/02/08/for-sample-creators-how-to-add-tempo-synced-delay-to-your-instruments/). **Attributes:** | Attribute | | Type | Valid Range | Default | |:------------------|:---------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------|:----------| | `type` | Required | Must be `delay` | `delay` | | | `delayTimeFormat` | Optional | Determines whether the delay will be synced to DAW tempo or not, as well as what format you will be using for the `delayTime` parameter. There are two possible values: 1) `seconds`, which is the default, means that `delayTime` will be specified in seconds and will not change when the DAW tempo changes; 2) `musical_time` means that delay time will be specified using an integer value generated by a control which is setup to use the `musical_time` `valueType` parameter. In order for this to work, you will need to be using the plug-in within a DAW that provides a tempo to the plug-in. | `seconds`, `musical_time` | `seconds` | | `delayTime` | Optional | The delay time in seconds | 0 - 20.0 | 0.7 | | `feedback` | Optional | The feedback level. | 0 - 1.0, where 0 is no feedback, 1.0 is max feedback. | 0.2 | | `stereoOffset` | Optional | The parameter allows you to introduce delay variations between the left and right channels. Half of this amount is subtracted from the left channel's delay time and half of this amount is added to the right channel's delay time. For example, if the `delayTime` is 0.5 seconds and the `stereoOffset` is 0.02 s, then the actual left channel delay time will be 0.49s and the actual right channel delay time will be 0.51s so that the two channels are offset by 0.02 seconds. | -10 - 10 | 0 | | `wetLevel` | Optional | The volume of the delay signal | 0 - 1.0 | 0.5 | Example of using the delay effect when specifying time in seconds: ```xml ``` Example of using the delay effect when specifying time in musical time: ```xml ``` ### Chorus effect Example: ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | | ---------- | -------- | --------------------------- | ------------- | -------- | | `type` | Required | Must be `chorus` | `chorus` | | | `mix` | Optional | The wet/dry mix which controls how much of the chorus signal we hear | 0 - 1.0, where 1.0 is just chorus, 0 is just dry signal. | 0.5 | | `modDepth` | Optional | The modulation depth of the effect | 0 - 1.0, where 0 is no modulation, 1.0 is max modulation. | 0.2 | | `modRate` | Optional | The modulation speed in Hz. | 0 - 10.0 | 0.2 | ### Phaser effect Example: ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | | ----------------- | -------- | ---------------------------------------------------------------------- | --------------------------------------------------------- | ------- | | `type` | Required | Must be `phaser` | `phaser` | | | `mix` | Optional | The wet/dry mix which controls how much of the phaser signal we hear | 0 - 1.0, where 1.0 is just phaser, 0 is just dry signal. | 0.5 | | `modDepth` | Optional | The modulation depth of the effect | 0 - 1.0, where 0 is no modulation, 1.0 is max modulation. | 0.2 | | `modRate` | Optional | The modulation speed in Hz. | 0 - 10.0 | 0.2 | | `centerFrequency` | Optional | The center frequency (in Hz) of the phaser all-pass filters modulation | 0 - 22000 | 400 | | `feedback` | Optional | Sets the feedback volume of the phaser. | -1 - 1.0 | 0.7 | ### Convolution effect This effect allows you to use a convolution reverb or amp simulation to your sample library. Depending on the length of the impulse response, the convolution effect can use substantial CPU, so you'll definitely want to do some testing both with and without the convolution effect turned on. Example: ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | |:----------|:---------|:--------------------------------------------------------------------|:--------------------------------------------------------------|:-----------| | `type` | Required | Must be `convolution` | `convolution` | | | `mix` | Optional | The wet/dry mix controls how much of the convolution signal we hear | 0 - 1.0, where 1.0 is just convolution, 0 is just dry signal. | 0.5 | | `irFile` | Required | The path of the WAV or AIFF to use as an Impulse Response (IR) file | String | No default | ### Pitch Shifter effect As of version 1.13.3, Decent Sampler contains an old-school pitch shifter effect, which allows you to shift the pitch of the audio signal up or down by a specified number of semitones. This can be useful for creating harmonies or for adding subtle chorus effects. Attributes: | Attribute | | Type | Valid Range | Default | |:-------------|:---------|:----------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------|:--------| | `type` | Required | Must be `pitch_shift` | `pitch_shift` | | | `pitchShift` | Optional | The number of semitones to shift the pitch of the audio signal | -24 - 24, where -24 means two octaves down, 0 means no pitch shift, and 24 means two octaves up | | `mix` | Optional | The wet/dry mix controls how much of the pitch-shifted signal we hear | 0 - 1.0, where 1.0 is just pitch-shifted signal, 0 is just dry signal. | 0.5 | Example: ```xml ``` ### Wave Folder effect Introduced in version 1.7.2. This effect allows you to fold a waveform back on itself. This is very useful for generating additional harmonic content. Attributes: | Attribute | | Type | Valid Range | Default | |:------------|:---------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------------------------|:--------| | `type` | Required | Must be `wave_folder` | `wave_folder` | | | `drive` | Optional | The volume of the input signal | 1 - 100, where 100 means the signal is amplified by a factor of 100 and 1 means no amplification is applied | 1 | | `threshold` | Optional | The amplitude above which wave folding should take place | 0 - 10.0 | 0.25 | Because wave folding tends to sound better when applied on a per-voice basis, it usually makes sense to set up the wave folder at the group level (separate group effects get created for each keypress). Example: ```xml ``` ### Wave Shaper effect Introduced in version 1.7.2. This effect allows you to distort an audio signal. This is very useful for generating additional harmonic content. Attributes: | Attribute | | Type | Valid Range | Default | |:--------------|:---------|:------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------|:--------| | `type` | Required | Must be `wave_shaper` | `wave_shaper` | | | `drive` | Optional | The amount of distortion. This really just controls the volume of the input signal. The volume of the input signal | 1 - 1000, where 1000 means the signal is amplified by a factor of 1000 and 1 means no amplification is applied | 1 | | `driveBoost` | Optional | Introduces an extra gain boost to the drive | 0 - 1.0 | 1 | | `outputLevel` | Optional | The linear output level of the signal | 0 - 1.0 | 0.1 | | `highQuality` | Optional | Whether or not oversampling is performed. Oversampling sounds better, but it's CPU intensive. If you want to save CPU, set this to false. | true, false | true | Because wave shaping tends to sound better when applied on a per-voice basis, it usually makes sense to set up the wave shaper at the group level (separate group effects get created for each keypress). Example: ```xml ``` ### Stereo Simulator effect Introduced in version 1.17.0. This effect converts a mono input signal into a pseudo-stereo signal using one of three classic algorithms. ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | |:--------------|:---------|:----------------------------------------------------------------------------------|:--------------------------------------------|:--------| | `type` | Required | Must be `stereo_simulator` | `stereo_simulator` | | | `algorithm` | Optional | Pseudo-stereo algorithm to use | `lauridsen`, `schroeder`, `adt` | `adt` | | `width` | Optional | Stereo spread and dry/wet amount; 0 = mono/dry, 1 = full stereo effect | 0–1 | 0.5 | | `delayTime` | Optional | Delay time in seconds | 0.001–0.030 | 0.005 | | `modRate` | Optional | LFO modulation rate in Hz (ADT algorithm only) | 0.1–10.0 | 0.5 | | `modDepth` | Optional | LFO modulation depth (ADT algorithm only) | 0–1 | 0.3 | The three algorithms are: - **`lauridsen`**: Complementary comb filters — simple and CPU-efficient. - **`schroeder`**: Double-delay comb filters — slightly richer stereo image. - **`adt`** (default): Artificial Double Tracking with LFO-modulated delay — the most convincing stereo widening effect. The `modRate` and `modDepth` parameters only affect this algorithm. The `width` parameter serves as both the stereo spread amount and the dry/wet control. Setting `width` to `0` produces a mono dry signal; setting it to `1` applies the full stereo effect. All parameters except `algorithm` are bindable. Example with a width knob: ```xml ``` ### Bit Crusher effect The bit crusher reduces the bit depth and sample rate of the audio signal, producing a characteristic lo-fi, digital, crunchy sound. Bit depth reduction introduces quantisation noise, while sample rate reduction creates aliasing artifacts. ```xml ``` Attributes: | Attribute | | Type | Valid Range | Default | |:----------------------|:---------|:----------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|:--------| | `type` | Required | Must be `bit_crusher` | `bit_crusher` | | | `bitDepth` | Optional | The number of bits used to quantise the audio signal. Lower values = more aggressive crushing. | 1–24, where 24 is clean and 1 is maximum crushing. | 24 | | `sampleRateReduction` | Optional | Sample-rate reduction factor. A value of 4 means the effective sample rate is reduced to one quarter of the original. | 1–32, where 1 is no reduction and 32 is maximum downsampling. | 1 | | `mix` | Optional | The wet/dry mix which controls how much of the bit-crushed signal we hear. | 0–1.0, where 1.0 is fully crushed and 0.0 is the original dry signal. | 1.0 | Both `bitDepth` and `sampleRateReduction` are bindable, so you can attach knobs to control them in real time. Binding parameters for the bit crusher effect: | Binding `parameter` value | Description | |:----------------------------|:------------------------------------------------| | `FX_BIT_DEPTH` | Controls the bit depth (1–24) | | `FX_SAMPLE_RATE_REDUCTION` | Controls the sample-rate reduction factor (1–32) | | `FX_MIX` | Controls the wet/dry mix (0–1) | Example with knobs for all three parameters: ```xml ```