Skip to content

Audio Effects

Narta Xaymar Dirks edited this page Nov 27, 2026 · 1 revision

Audio effects

Effects sit in a chain on an audio bus and work on everything that plays on it, in the order they were added. They keep running after the last sound on the bus has stopped, so echoes and reverb tails ring out. Types and parameters are numbered constants from the shipped include file audio.bb.

Include "<audio.bb>"
world = CreateAudioBus()
cave  = AddAudioEffect(world, BB_EFFECT_REVERB)
AudioEffectParam cave, BB_EFFECTPARAM_SIZE, 0.8
AudioEffectParam cave, BB_EFFECTPARAM_MIX, 0.5

; Walking out of the cave: the reverb fades out over a second.
AudioEffectParam cave, BB_EFFECTPARAM_MIX, 0, 1000
Command What it does
AddAudioEffect, FreeAudioEffect Add an effect to a bus, and take it off again.
AudioEffectParam, GetAudioEffectParam A parameter, set at once or over a fade time.
AudioEffectBypass Turns it off and on without losing its settings.
AudioSceneParam, AudioSceneBypass The same in an audio scene.

Types

Every effect also has BB_EFFECTPARAM_MIX, how much of what it makes is heard: 0 only the sound, 1 (the default) only the effect. For the echo and the reverb, the repeats come on top of the sound: 0.5 is the sound and the repeats at full level, and 1 only the repeats, for a bus that only holds a reverb.

Type Parameters (default)
BB_EFFECT_LOWPASS FREQUENCY (20000), RESONANCE (0.707)
BB_EFFECT_HIGHPASS FREQUENCY (20), RESONANCE (0.707)
BB_EFFECT_BANDPASS FREQUENCY (1000), RESONANCE (1)
BB_EFFECT_PEAK FREQUENCY (1000), RESONANCE (1), GAIN (0)
BB_EFFECT_LOWSHELF FREQUENCY (200), GAIN (0)
BB_EFFECT_HIGHSHELF FREQUENCY (4000), GAIN (0)
BB_EFFECT_ECHO DELAY (0.3), FEEDBACK (0.4), DAMPING (0.3, makes each repeat darker), MIX (0.5)
BB_EFFECT_REVERB SIZE (0.5), DAMPING (0.5), WIDTH (1), PREDELAY (0), MIX (0.3)
BB_EFFECT_COMPRESSOR THRESHOLD (-12), RATIO (4), ATTACK (0.01), RELEASE (0.2), GAIN (0, added after)
BB_EFFECT_LIMITER CEILING (-0.3), RELEASE (0.05)
BB_EFFECT_DISTORTION DRIVE (0.5), MIX (1)
BB_EFFECT_LOFI RATE (8000), BITS (8)

Parameters

The names are BB_EFFECTPARAM_ and the name in the table. A value outside the range is a runtime error.

Parameter Unit Range
MIX 0 to 1
FREQUENCY Hz 1 to 100000 (above half the rate of the sound device, it acts as half of it)
RESONANCE Q 0.05 to 40
GAIN dB -60 to 60
DELAY seconds 0 to 4
FEEDBACK 0 to 0.99
DAMPING, SIZE, WIDTH 0 to 1
PREDELAY seconds 0 to 1
THRESHOLD dB -96 to 0
RATIO 1 to 100
ATTACK, RELEASE seconds 0 to 5
CEILING dB -60 to 0
DRIVE 0 to 1
RATE Hz 100 to 192000
BITS 1 to 24

The limiter has no look-ahead: it turns a peak down on the sample it arrives, so a ceiling far below the sound distorts it. The distortion drives the sound into a curve that keeps full scale at full scale, so it also makes quiet sounds louder. A reverb hears every speaker and plays on the front pair.

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally