AudioEffect Struct

An AudioEffect struct stores the parameters used by an audio effect. You can change these values to adjust the effect in real-time.

This struct must be created using the audio_effect_create function. The parameters that are available in the struct depend on the type of audio effect that you pass to the function (see AudioEffectType Enum).

NOTE This is a built-in struct, and as such GameMaker has more control over its contents. This means it may contain some additional, inaccessible variables created by GameMaker, and some values may change automatically if invalid values were assigned.

NOTE All gain parameters are linear gains and range from 0 to infinity; values from 0 to 1 indicate a decrease in gain, values from 1 to infinity an increase. They can be converted to dB and back using lin_to_db and db_to_lin.

All structs of this type have a type and bypass property. All other properties are specific to certain types of effects.

Below is a list of struct members depending on the type of effect created.

Reverb (AudioEffectType.Reverb1)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.Reverb1 for Reverb.
bypassBooleanWhether the effect should be bypassed (ignored).
sizeRealThe size of the space [range: 0.0 - 1.0].

Larger sizes mean more reflections and a longer reverberation.
dampRealThe amount that higher frequencies should be attenuated [range: 0.0 - 1.0].
mixRealThe proportion of the original/reverberated signal in the output [range: 0.0 - 1.0].

A value of 0.0 gives 100% of the original signal, a value of 1.0 gives 100% of the reverberated signal. A value of 0.5 results in 50% of the original and 50% of the reverberated signal.

Delay (AudioEffectType.Delay)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.Delay for Delay.
bypassBooleanWhether the effect should be bypassed (ignored).
timeRealThe length of the delay (in seconds).
feedbackRealThe proportion of the delayed signal which is fed back into the delay line [range: 0.0 - 1.0].
mixRealThe proportion of the original/delayed signal in the output [range: 0.0 - 1.0].

A value of 0.0 gives 100% of the original signal, a value of 1.0 gives 100% the delayed signal. A value of 0.5 results in 50% of the original and 50% of the delayed signal.

Distortion (AudioEffectType.Bitcrusher)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.Bitcrusher for Distortion.
bypassBooleanWhether the effect should be bypassed (ignored).
gainRealThe input gain going into the effect. There is a hard clipper (clipping at ±1.0) directly after this stage.
factorRealThe factor by which the original signal is downsampled [range: 0.0 - 100.0].

This is rounded down to an integer.
resolutionRealThe bit depth at which the signal is resampled [range: 1.0 - 16.0].

This is rounded down to an integer.
mixRealThe proportion of the original/distorted signal in the output [range: 0.0 - 1.0].

A value of 0.0 gives 100% of the original signal, a value of 1.0 gives 100% the distorted signal. A value of 0.5 results in 50% of the original and 50% of the distorted signal.

LPF (AudioEffectType.LPF2)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.LPF2 for LPF.
bypassBooleanWhether the effect should be bypassed (ignored).
cutoffRealThe cutoff frequency of the filter. Frequencies higher than the cutoff will be attenuated.
qRealThe quality factor of the filter [range: 1.0 - 100.0].

This is a dimensionless parameter which indicates how peaked (in gain) the frequency is around the cutoff. The greater the value, the greater the peak.

HPF (AudioEffectType.HPF2)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.HPF2 for HPF.
bypassBooleanWhether the effect should be bypassed (ignored).
cutoffRealThe cutoff frequency of the filter. Frequencies lower than the cutoff will be attenuated.
qRealThe quality factor of the filter [range: 1.0 - 100.0].

This is a dimensionless parameter which indicates how peaked (in gain) the frequency is around the cutoff. The greater the value, the greater the peak.

Gain (AudioEffectType.Gain)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.Gain for Gain.
bypassBooleanWhether the effect should be bypassed (ignored).
gainRealThe gain value applied to the input signal.

Tremolo (AudioEffectType.Tremolo)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.Tremolo for Tremolo.
bypassBooleanWhether the effect should be bypassed (ignored).
rateRealThe frequency of the LFO modulating the gain (0.0-20.0 Hz)
intensityRealThe proportion of the input signal which should be modulated by the LFO (0.0-1.0). Put differently, it is the proportion (or fraction) of the signal's/sample's amplitude that is affected by the LFO.
offsetRealThe proportion of a waveform's period that the right-hand channel's LFO should be offset by compared to the left-hand channel (0.0-1.0) At a value of 0.0 and 1.0 the left-hand and right-hand channel's LFO waveforms coincide (because the shape is periodic, i.e. repeats)
shapeAudioLFOType EnumThe waveform shape that the LFO should output.

EQ (AudioEffectType.EQ)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.EQ for EQ.
bypassBooleanWhether the effect should be bypassed (ignored).
locutAudioEffect StructA filter of type AudioEffectType.HPF2.
loshelfAudioEffect StructA filter of type AudioEffectType.LoShelf.
eq1AudioEffect StructA filter of type AudioEffectType.PeakEQ.
eq2AudioEffect StructA filter of type AudioEffectType.PeakEQ.
eq3AudioEffect StructA filter of type AudioEffectType.PeakEQ.
eq4AudioEffect StructA filter of type AudioEffectType.PeakEQ.
hishelfAudioEffect StructA filter of type AudioEffectType.HiShelf.
hicutAudioEffect StructA filter of type AudioEffectType.LPF2.

PeakEQ (AudioEffectType.PeakEQ)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.PeakEQ for the Peak EQ Filter.
bypassBooleanWhether the effect should be bypassed (ignored).
freqRealThe frequency (in Hz) of the filter [range: 10 - 20,000]*. This represents the centre frequency of the peak.

NOTE *The upper limit is either 20,000 or half of the audio device's sample rate, whichever is lower.
qRealThe quality factor of the filter [range: 1.0 - 100.0]. This is a dimensionless parameter which narrows the peak created, so that a smaller range of frequencies around the centre frequency are affected. The greater the value, the narrower the peak.
gainRealThe linear gain applied to the centre frequency [range: 0.0 - inf]. Frequencies around the centre frequency will also have a gain applied, which reduces depending on the quality factor and distance from the centre frequency. A gain lower than 1 represents a decrease in volume.

HiShelf (AudioEffectType.HiShelf)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.HiShelf for the HiShelf Filter.
bypassBooleanWhether the effect should be bypassed (ignored).
freqRealThe frequency (in Hz) of the filter [range: 10 - 20,000]*. This represents the midpoint of the shelf's slope.

Frequencies higher than this value will have a constant gain applied.

NOTE *The upper limit is either 20,000 or half of the audio device's sample rate, whichever is lower.
qRealThe quality factor of the filter [range: 1.0 - 100.0]. This is a dimensionless parameter which increases the steepness of the filter's slope, at the cost of some resonance at frequencies around the top of the shelf's slope. The greater the value, the steeper the slope, and the greater the resonance.
gainRealThe linear gain applied to frequencies in the shelf [range 0.0 - inf]. A gain lower than 1 represents a decrease in volume.

LoShelf (AudioEffectType.LoShelf)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.LoShelf for the LoShelf Filter.
bypassBooleanWhether the effect should be bypassed (ignored).
freqRealThe frequency (in Hz) of the filter [range: 10 - 20,000]*. This represents the midpoint of the shelf's slope.

Frequencies lower than this value will have a constant gain applied.

NOTE *The upper limit is either 20,000 or half of the audio device's sample rate, whichever is lower.
qRealThe quality factor of the filter [range: 1.0 - 100.0]. This is a dimensionless parameter which increases the steepness of the filter's slope, at the cost of some resonance at frequencies around the top of the shelf's slope. The greater the value, the steeper the slope, and the greater the resonance.
gainRealThe linear gain applied to frequencies in the shelf [range 0.0 - inf]. A gain lower than 1 represents a decrease in volume.

Compressor (AudioEffectType.Compressor)

VariableTypeDescription
typeAudioEffectType EnumA read-only property that stores the type of audio effect stored in this struct. It is set to AudioEffectType.Compressor for a Compressor effect.
bypassBooleanWhether the effect should be bypassed (ignored).
ingainRealThe gain scalar applied to the input signal [range: 0 - inf]. This allows audio to be pushed into the compression threshold.
thresholdRealThe amplitude level above which the compressor will begin to apply gain reduction [range: 0.001 - 1].
ratioRealThe ratio by which audio that exceeds the threshold is reduced [range: 1 - inf]. The compression ratio applied is ratio : 1.
attackRealThe responsiveness (in seconds) of the compressor in compressing audio above the threshold [range: 0.001 - 0.1].
releaseRealThe responsiveness (in seconds) of the compressor in stopping compressing audio below the threshold [range: 0.01 - 1].
outgainRealThe gain scalar applied to the output signal [range: 0 - inf]. This allows compensating for the overall level reduction caused by the compression process.