Divooka Reference

Generate

7 nodes

On this page 7

Noise

Function

Random noise of a chosen colour.

Signature
Noise -> AudioBuffer
    color: Noise Color
    duration: Number
    amplitude: Number
    seed: Integer
    sampleRate: Integer
AudioBuffer Noise(
    NoiseColor color = NoiseColor.White,
    double duration = 1,
    double amplitude = 0.5,
    int seed = 1,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
colorNoise ColorWhiteWhite hisses, pink sounds like rain, brown rumbles.
durationNumber1Length, in seconds.
amplitudeNumber0.5Peak level, from 0 to 1.
seedInteger1Which take of the noise.
sampleRateInteger44100Samples per second.

Returns

AudioAudioBuffer

Remarks

The same seed gives the same noise every time, so a document sounds the same on every run; change the seed for a different take.

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

Note Frequency

Function

The frequency of a note named the way a musician writes it: A4, C#5, Eb3.

Signature
NoteFrequency(note: Text) -> Number
double NoteFrequency(string note = "A4")

Parameters

nametypedefaultdescription
noteTextA4A letter A to G, an optional # or b, and an octave number.

Returns

FrequencyNumber

Remarks

Equal temperament with A4 at 440 Hz; middle C is C4. A sharp is # and a flat is b.

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

Silence

Function

Nothing, for a length of time - a gap between sounds, or a bed to mix them onto.

Signature
Silence -> AudioBuffer
    duration: Number
    channels: Integer
    sampleRate: Integer
AudioBuffer Silence(
    double duration = 1,
    int channels = 1,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
durationNumber1Length, in seconds.
channelsInteger1How many channels: 1 for mono, 2 for stereo.
sampleRateInteger44100Samples per second.

Returns

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

Sound Effect

Function

A synthesized game sound effect - a coin, a laser, an explosion, footsteps, rain - from the built-in recipe library.

Signature
SoundEffect(name: Text, seed: Integer) -> AudioBuffer
AudioBuffer SoundEffect(
    string name = "Pickup/Coin",
    int seed = 1)

Parameters

nametypedefaultdescription
nameTextPickup/CoinThe effect's name, such as Pickup/Coin, Weapon/Laser or Ambient/Rain.
seedInteger1Which take of the effect.

Returns

AudioAudioBuffer

Remarks

Every effect is made from oscillators, noise and filters as it is rendered; nothing is a recording. Each seed is a slightly different take of the same effect, which is what stops a sound played a hundred times from sounding like one sample played a hundred times. AudioGenerators.SoundEffectNames lists every name.

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

Sound Effect Names

Function

The name of every effect AudioGenerators.SoundEffect can make.

Signature
SoundEffectNames() -> Text Array
string[] SoundEffectNames()

Returns

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

Sweep

Function

A tone whose pitch glides from one frequency to another, evenly in musical terms - each octave takes the same time.

Signature
Sweep -> AudioBuffer
    startFrequency: Number
    endFrequency: Number
    duration: Number
    amplitude: Number
    waveform: Waveform
    sampleRate: Integer
AudioBuffer Sweep(
    double startFrequency = 100,
    double endFrequency = 8000,
    double duration = 3,
    double amplitude = 0.5,
    Waveform waveform = Waveform.Sine,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
startFrequencyNumber100Where the glide starts, in hertz.
endFrequencyNumber8000Where it ends, in hertz.
durationNumber3Length, in seconds.
amplitudeNumber0.5Peak level, from 0 to 1.
waveformWaveformSineThe tone's shape.
sampleRateInteger44100Samples per second.

Returns

AudioAudioBuffer

Remarks

A sweep is the standard test signal for a filter or an effect: every frequency passes through it once, so its spectrogram is a single rising line and anything the effect does to one part of the spectrum shows as a change in that line.

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

Tone

Function

A steady tone of one pitch.

Signature
Tone -> AudioBuffer
    frequency: Number
    duration: Number
    amplitude: Number
    waveform: Waveform
    sampleRate: Integer
AudioBuffer Tone(
    double frequency = 440,
    double duration = 1,
    double amplitude = 0.5,
    Waveform waveform = Waveform.Sine,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
frequencyNumber440Pitch, in hertz. 440 is the A above middle C.
durationNumber1Length, in seconds.
amplitudeNumber0.5Peak level, from 0 (silent) to 1 (full scale).
waveformWaveformSineSine is pure; square, triangle and saw add harmonics and sound brighter.
sampleRateInteger44100Samples per second.

Returns

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