Divooka Reference

Edit

13 nodes

On this page 13

Concatenate

Function

Plays one clip after another.

Signature
Concatenate -> AudioBuffer
    first: AudioBuffer
    second: AudioBuffer
AudioBuffer Concatenate(AudioBuffer first, AudioBuffer second)

Parameters

nametypedefaultdescription
firstAudioBuffer—The clip that plays first; the result takes its sample rate.
secondAudioBuffer—The clip that follows it.

Returns

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

Fade In

Function

Brings a clip in from silence.

Signature
FadeIn -> AudioBuffer
    audio: AudioBuffer
    duration: Number
    curve: Fade Curve
AudioBuffer FadeIn(
    AudioBuffer audio,
    double duration = 0.5,
    FadeCurve curve = FadeCurve.Smooth)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to fade.
durationNumber0.5How long the fade takes, in seconds; a fade longer than the clip covers the whole clip.
curveFade CurveSmoothThe shape of the fade.

Returns

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

Fade Out

Function

Takes a clip down to silence at its end.

Signature
FadeOut -> AudioBuffer
    audio: AudioBuffer
    duration: Number
    curve: Fade Curve
AudioBuffer FadeOut(
    AudioBuffer audio,
    double duration = 0.5,
    FadeCurve curve = FadeCurve.Smooth)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to fade.
durationNumber0.5How long the fade takes, in seconds; a fade longer than the clip covers the whole clip.
curveFade CurveSmoothThe shape of the fade.

Returns

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

Gain

Function

Makes a clip louder or quieter by a number of decibels.

Signature
Gain(audio: AudioBuffer, decibels: Number) -> AudioBuffer
AudioBuffer Gain(AudioBuffer audio, double decibels = -6)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to change.
decibelsNumber-6How much louder (positive) or quieter (negative).

Returns

AudioAudioBuffer

Remarks

+6 dB roughly doubles the level and -6 dB roughly halves it; 0 dB leaves the clip exactly as it was. Anything pushed past full scale is clipped.

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

Mix

Function

Layers one clip over another, so both are heard at once.

Signature
Mix -> AudioBuffer
    first: AudioBuffer
    second: AudioBuffer
    offset: Number
AudioBuffer Mix(
    AudioBuffer first,
    AudioBuffer second,
    double offset = 0)

Parameters

nametypedefaultdescription
firstAudioBuffer—The bottom layer; the result takes its sample rate.
secondAudioBuffer—The layer on top.
offsetNumber0How far into the first clip the second one starts, in seconds.

Returns

AudioAudioBuffer

Remarks

The result lasts until whichever clip ends later. The levels add, so lower them first if the sum would clip.

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

Mix All

Function

Adds any number of clips together, all starting at the same moment.

Signature
MixAll(clips: AudioBuffer Array) -> AudioBuffer
AudioBuffer MixAll(AudioBuffer[] clips)

Parameters

nametypedefaultdescription
clipsAudioBuffer Array—The clips; at least one.

Returns

AudioAudioBuffer

Remarks

The result is as long as the longest clip and has the most channels any clip has, at the first clip's sample rate. The levels add without being clipped, so the bands or parts a clip was divided into mix back to exactly that clip.

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

Normalize

Function

Turns a clip up or down so that its loudest moment reaches a set level.

Signature
Normalize -> AudioBuffer
    audio: AudioBuffer
    peakDecibels: Number
AudioBuffer Normalize(
    AudioBuffer audio,
    double peakDecibels = -1)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to normalize.
peakDecibelsNumber-1The level the loudest sample should reach, in decibels below full scale; -1 leaves a little headroom.

Returns

AudioAudioBuffer

Remarks

A silent clip has no loudest moment and comes back unchanged.

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

Pad

Function

Adds silence before and after a clip.

Signature
Pad -> AudioBuffer
    audio: AudioBuffer
    before: Number
    after: Number
AudioBuffer Pad(
    AudioBuffer audio,
    double before = 0.5,
    double after = 0.5)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to pad.
beforeNumber0.5Silence to add at the start, in seconds.
afterNumber0.5Silence to add at the end, in seconds.

Returns

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

Repeat

Function

Plays a clip several times in a row.

Signature
Repeat(audio: AudioBuffer, count: Integer) -> AudioBuffer
AudioBuffer Repeat(AudioBuffer audio, int count = 2)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to repeat.
countInteger2How many times it plays in total.

Returns

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

Reverse

Function

Plays a clip backwards.

Signature
Reverse(audio: AudioBuffer) -> AudioBuffer
AudioBuffer Reverse(AudioBuffer audio)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to reverse.

Returns

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

Subtract

Function

Takes one clip away from another, sample by sample: what is in the first and not the second.

Signature
Subtract(first: AudioBuffer, second: AudioBuffer) -> AudioBuffer
AudioBuffer Subtract(AudioBuffer first, AudioBuffer second)

Parameters

nametypedefaultdescription
firstAudioBuffer—The clip taken from; the result takes its sample rate.
secondAudioBuffer—The clip taken away.

Returns

DifferenceAudioBuffer

Remarks

Peak Decibels of the difference says how far apart two clips are - a clip and the parts it was divided into, mixed back, differ only by float rounding, well below -100 dB.

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

Trim

Function

Keeps one stretch of a clip and drops the rest.

Signature
Trim -> AudioBuffer
    audio: AudioBuffer
    start: Number
    length: Number
AudioBuffer Trim(
    AudioBuffer audio,
    double start = 0,
    double length = 1)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to cut.
startNumber0Where the kept stretch begins, in seconds from the start.
lengthNumber1How long the kept stretch is, in seconds.

Returns

AudioAudioBuffer

Remarks

A stretch that runs past the end of the clip stops at the end; one that starts past the end is empty.

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

Trim Silence

Function

Removes the quiet stretches at the start and the end of a clip.

Signature
TrimSilence -> AudioBuffer
    audio: AudioBuffer
    thresholdDecibels: Number
AudioBuffer TrimSilence(
    AudioBuffer audio,
    double thresholdDecibels = -50)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to tidy.
thresholdDecibelsNumber-50How quiet counts as silence, in decibels below full scale.

Returns

AudioAudioBuffer

Remarks

A sample counts as quiet when every channel is below the threshold. A clip that is quiet throughout comes back empty.

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