Divooka Reference

Dynamics

6 nodes

On this page 6

Compress

Function

Evens out a clip's level: whatever rises above the threshold is turned down by the ratio, through a soft knee, with the attack and release a studio compressor has.

Signature
Compress -> AudioBuffer
    audio: AudioBuffer
    threshold: Number
    ratio: Number
    knee: Number
    attack: Number
    release: Number
    makeup: Number
AudioBuffer Compress(
    AudioBuffer audio,
    double threshold = -18,
    double ratio = 4,
    double knee = 6,
    double attack = 10,
    double release = 150,
    double makeup = 0)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to compress.
thresholdNumber-18Level in dB above which compression starts.
ratioNumber4How hard: 4 turns every 4 dB over the threshold into 1.
kneeNumber6Width in dB of the soft knee around the threshold.
attackNumber10Milliseconds to clamp down on a rise.
releaseNumber150Milliseconds to let go.
makeupNumber0Gain in dB added afterwards to win back level.

Returns

AudioAudioBuffer

Remarks

The channels are linked - one gain for all - so a stereo image does not wander. The look-ahead is compensated, so the result lines up with the input.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Dynamics
Package
Audio Processing

Duck

Function

Turns one clip down while another plays - music under a voice-over, the classic radio duck.

Signature
Duck -> AudioBuffer
    audio: AudioBuffer
    control: AudioBuffer
    threshold: Number
    reduction: Number
    attack: Number
    release: Number
AudioBuffer Duck(
    AudioBuffer audio,
    AudioBuffer control,
    double threshold = -30,
    double reduction = 12,
    double attack = 50,
    double release = 200)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to turn down.
controlAudioBuffer—The clip whose sound triggers it, such as the voice; heard over the first clip's length.
thresholdNumber-30How loud in dB the control must be to duck.
reductionNumber12How far in dB to turn the clip down.
attackNumber50Milliseconds to fall.
releaseNumber200Milliseconds to come back.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Dynamics
Package
Audio Processing

Limit

Function

Keeps a clip under a ceiling without audible clipping: a look-ahead limiter that turns the level down just before a peak would cross it.

Signature
Limit -> AudioBuffer
    audio: AudioBuffer
    ceiling: Number
    lookahead: Number
    release: Number
AudioBuffer Limit(
    AudioBuffer audio,
    double ceiling = -1,
    double lookahead = 5,
    double release = 50)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to limit.
ceilingNumber-1The highest level in dB the clip may reach; -1 leaves room for a codec's overshoot.
lookaheadNumber5Milliseconds the limiter sees ahead.
releaseNumber50Milliseconds to let go after a peak.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Dynamics
Package
Audio Processing

Loudness

Function

A clip's integrated loudness in LUFS, measured as ITU-R BS.1770 does: K-weighted, gated, over the whole clip.

Signature
Loudness(audio: AudioBuffer) -> Number
double Loudness(AudioBuffer audio)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to measure.

Returns

LoudnessNumber

Remarks

Streaming services aim at about -14 LUFS, broadcast at -23 (EBU R128) or -24 (ATSC A/85). A clip too short or too quiet to measure gives negative infinity.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Dynamics
Package
Audio Processing

Normalize Loudness

Function

Brings a clip to a target integrated loudness, as a streaming service or broadcaster would.

Signature
NormalizeLoudness -> AudioBuffer
    audio: AudioBuffer
    target: Number
    maximumGain: Number
AudioBuffer NormalizeLoudness(
    AudioBuffer audio,
    double target = -14,
    double maximumGain = 30)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to adjust.
targetNumber-14The loudness to reach, in LUFS.
maximumGainNumber30The most gain in dB it may add, so silence is not turned into noise.

Returns

AudioAudioBuffer

Remarks

This only changes gain; follow it with Limit if the gain pushes peaks past full scale.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Dynamics
Package
Audio Processing

True Peak

Function

A clip's true peak in dBTP: the highest the waveform reaches between samples as well as on them, by 4× band-limited reconstruction, which is what a converter will actually play.

Signature
TruePeak(audio: AudioBuffer) -> Number
double TruePeak(AudioBuffer audio)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to measure.

Returns

TruePeakNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Dynamics
Package
Audio Processing