Divooka Reference

Signal

50 nodes

On this page 50

Make Signal

Function

This node carries no documentation.

Signature
op_Implicit(value: Number) -> Signal
Signal op_Implicit(double value)

Parameters

nametypedefaultdescription
valueNumber—

Returns

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

Abs

Function

The magnitude: full-wave rectification.

Signature
Abs(Signal: Signal) -> Signal
Signal Abs(Signal Signal)

Parameters

nametypedefaultdescription
SignalSignal—

Returns

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

Bandpass

Function

A bandpass around the cutoff.

Signature
Bandpass(Signal: Signal, cutoff: Signal, q: Signal) -> Signal
Signal Bandpass(Signal Signal, Signal cutoff, Signal q)

Parameters

nametypedefaultdescription
SignalSignal—
cutoffSignal—
qSignal—

Returns

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

Clip

Function

Hard clipping at ±Limit.

Signature
Clip(Signal: Signal, limit: Signal) -> Signal
Signal Clip(Signal Signal, Signal limit)

Parameters

nametypedefaultdescription
SignalSignal—
limitSignal—

Returns

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

Compile

Function

Compiles the signal at a sample rate into a processor that renders it block by block from time zero.

Signature
Compile(Signal: Signal, sampleRate: Integer) -> Signal Processor
SignalProcessor Compile(Signal Signal, int sampleRate)

Parameters

nametypedefaultdescription
SignalSignal—
sampleRateInteger—

Returns

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

Compress

Function

A feed-forward compressor as Giannoulis, Massberg and Reiss set it out (, JAES 60(6), 2012): a gain computer with a soft knee in decibels, then a smooth peak detector on the gain reduction, so attack and release are true time constants and the static curve is exact.

Signature
Compress -> Signal
    Signal: Signal
    threshold: Number
    ratio: Number
    attack: Number
    release: Number
    knee: Number
    makeup: Number
    sidechain: Signal
Signal Compress(
    Signal Signal,
    double threshold = -18,
    double ratio = 4,
    double attack = 0.01,
    double release = 0.1,
    double knee = 6,
    double makeup = 0,
    Signal sidechain)

Parameters

nametypedefaultdescription
SignalSignal—
thresholdNumber-18dBFS where compression starts.
ratioNumber4Decibels in for each decibel out above the threshold; 1 does nothing, a very large ratio limits.
attackNumber0.01Seconds for the gain reduction to reach 63% of a step up.
releaseNumber0.1Seconds for it to recover 63% of the way.
kneeNumber6Decibels over which the curve bends from 1:1 to the ratio, centred on the threshold.
makeupNumber0Decibels of gain after compression.
sidechainSignal—What the detector listens to instead of the signal itself: a kick, to duck a bass under it.

Returns

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

Crush

Function

A bitcrusher: the signal quantized to Bits bits and held at Rate samples a second, for the grit of an early sampler.

Signature
Crush(Signal: Signal, bits: Number, rate: Number) -> Signal
Signal Crush(Signal Signal, double bits = 8, double rate = 8000)

Parameters

nametypedefaultdescription
SignalSignal—
bitsNumber8
rateNumber8000

Returns

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

Delay

Function

The signal through a delay line: what went in Time seconds ago, fed back by Feedback so it repeats, mixed with the dry signal by Mix (1 is only the echo). The time may move - chorus, flanging - and is read between samples.

Signature
Delay -> Signal
    Signal: Signal
    time: Signal
    feedback: Signal
    mix: Signal
    maximumTime: Number
Signal Delay(
    Signal Signal,
    Signal time,
    Signal feedback,
    Signal mix,
    double maximumTime = 2)

Parameters

nametypedefaultdescription
SignalSignal—
timeSignal—
feedbackSignal—
mixSignal—
maximumTimeNumber2

Returns

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

Filter

Function

A state-variable filter - Simper's trapezoidal form, so its cutoff and Q can move every sample without zipper noise or blowing up.

Signature
Filter -> Signal
    Signal: Signal
    mode: Filter Mode
    cutoff: Signal
    q: Signal
Signal Filter(
    Signal Signal,
    FilterMode mode,
    Signal cutoff,
    Signal q)

Parameters

nametypedefaultdescription
SignalSignal—
modeFilter Mode—What it passes.
cutoffSignal—Hertz.
qSignal—Resonance: 0.707 is flat, higher rings.

Returns

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

Fold

Function

A wavefolder: the signal times Gain, reflected back off ±1 as often as it crosses it, so a sine pushed harder grows harmonics without growing louder - the west-coast synthesizer's way of brightening.

Signature
Fold(Signal: Signal, gain: Signal) -> Signal
Signal Fold(Signal Signal, Signal gain)

Parameters

nametypedefaultdescription
SignalSignal—
gainSignal—

Returns

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

Highpass

Function

A 12 dB an octave highpass.

Signature
Highpass(Signal: Signal, cutoff: Signal, q: Signal) -> Signal
Signal Highpass(Signal Signal, Signal cutoff, Signal q)

Parameters

nametypedefaultdescription
SignalSignal—
cutoffSignal—
qSignal—

Returns

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

Ladder

Function

A four-pole, 24 dB an octave ladder lowpass in zero-delay feedback form, with its passband gain kept at 1 as the resonance rises; a resonance of 1 is the edge of self-oscillation.

Signature
Ladder -> Signal
    Signal: Signal
    cutoff: Signal
    resonance: Signal
Signal Ladder(Signal Signal, Signal cutoff, Signal resonance)

Parameters

nametypedefaultdescription
SignalSignal—
cutoffSignal—
resonanceSignal—

Returns

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

Lag

Function

A one-pole lag: the output moves toward the input exponentially, 60 dB of the way in Time seconds, as SuperCollider's Lag does.

Signature
Lag(Signal: Signal, time: Number) -> Signal
Signal Lag(Signal Signal, double time = 0.1)

Parameters

nametypedefaultdescription
SignalSignal—
timeNumber0.1

Returns

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

Lowpass

Function

A 12 dB an octave lowpass.

Signature
Lowpass(Signal: Signal, cutoff: Signal, q: Signal) -> Signal
Signal Lowpass(Signal Signal, Signal cutoff, Signal q)

Parameters

nametypedefaultdescription
SignalSignal—
cutoffSignal—
qSignal—

Returns

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

Pan

Function

The signal placed between the speakers by the equal-power law: at Position -1 it is all left, at 1 all right, and in the middle each side carries it 3 dB down, so it is as loud wherever it is put. The position may move.

Signature
Pan(Signal: Signal, position: Signal) -> Stereo Signal
StereoSignal Pan(Signal Signal, Signal position)

Parameters

nametypedefaultdescription
SignalSignal—
positionSignal—

Returns

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

Pitch Shift

Function

The signal raised or lowered in pitch without being sped up or slowed down, as it plays: read from a short delay line by two heads sliding through it at the new speed, half a window apart, each faded out as it wraps round while the other is at its loudest, by an equal-power law, since the two heads read the sound at different moments and only partly agree. The classic real-time shifter, the Eventide H910's: it adds no more delay than Window, and a longer window warbles less on a held note at the cost of smearing a sharp one.

Signature
PitchShift -> Signal
    Signal: Signal
    semitones: Signal
    window: Number
Signal PitchShift(
    Signal Signal,
    Signal semitones,
    double window = 0.05)

Parameters

nametypedefaultdescription
SignalSignal—
semitonesSignal—How far to move it, in semitones; 12 is an octave up, and it may move.
windowNumber0.05Seconds of the delay line the heads slide through, 0.01 to 0.5.

Returns

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

Range

Function

The signal scaled from -1..1 to Low..High: an LFO turned into a cutoff sweep.

Signature
Range(Signal: Signal, low: Signal, high: Signal) -> Signal
Signal Range(Signal Signal, Signal low, Signal high)

Parameters

nametypedefaultdescription
SignalSignal—
lowSignal—
highSignal—

Returns

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

Render

Function

Renders a number of seconds of the signal, mono.

Signature
Render -> AudioBuffer
    Signal: Signal
    seconds: Number
    sampleRate: Integer
    blockSize: Integer
AudioBuffer Render(
    Signal Signal,
    double seconds,
    int sampleRate = 44100,
    int blockSize = 256)

Parameters

nametypedefaultdescription
SignalSignal—
secondsNumber—
sampleRateInteger44100
blockSizeInteger256

Returns

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

Render Samples

Function

Renders a number of frames of the signal into samples.

Signature
RenderSamples -> Low Accuracy Number Array
    Signal: Signal
    frames: Integer
    sampleRate: Integer
    blockSize: Integer
float[] RenderSamples(
    Signal Signal,
    int frames,
    int sampleRate = 44100,
    int blockSize = 256)

Parameters

nametypedefaultdescription
SignalSignal—
framesInteger—
sampleRateInteger44100
blockSizeInteger256

Returns

resultLow Accuracy Number Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Signal
Package
Audio Processing

Reverb

Function

Reverberation by Jezar's Freeverb: eight parallel comb filters with damped feedback into four series allpasses, the room every open-source synthesizer reaches for. Mix is how much of the result is reverb.

Signature
Reverb -> Signal
    Signal: Signal
    roomSize: Number
    damping: Number
    mix: Number
Signal Reverb(
    Signal Signal,
    double roomSize = 0.6,
    double damping = 0.5,
    double mix = 0.3)

Parameters

nametypedefaultdescription
SignalSignal—
roomSizeNumber0.60 to 1: how long the tail lasts.
dampingNumber0.50 to 1: how quickly the high frequencies die in it.
mixNumber0.30 is dry, 1 only the reverb.

Returns

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

Sample And Hold

Function

Sample and hold: the input's value at each rise of Trigger past one half, held until the next; 0 before the first. Noise sampled by a clock is the classic random-step modulation.

Signature
SampleAndHold(Signal: Signal, trigger: Signal) -> Signal
Signal SampleAndHold(Signal Signal, Signal trigger)

Parameters

nametypedefaultdescription
SignalSignal—
triggerSignal—

Returns

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

Saturate

Function

Soft saturation: tanh of the signal times Drive, so a hot signal rounds off instead of clipping.

Signature
Saturate(Signal: Signal, drive: Signal) -> Signal
Signal Saturate(Signal Signal, Signal drive)

Parameters

nametypedefaultdescription
SignalSignal—
driveSignal—

Returns

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

Slew

Function

A slew limiter: the output follows the input but moves at most one unit every Rise seconds going up and every Fall seconds going down - portamento for a pitch, de-clicking for a gate.

Signature
Slew(Signal: Signal, rise: Number, fall: Number) -> Signal
Signal Slew(Signal Signal, double rise = 0.1, double fall = 0.1)

Parameters

nametypedefaultdescription
SignalSignal—
riseNumber0.1
fallNumber0.1

Returns

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

Stereo Reverb

Function

The signal through Freeverb on each side, the right channel's combs tuned 23 samples longer so the two tails are uncorrelated and the room has width; Width 0 sums the tails to the middle.

Signature
StereoReverb -> Stereo Signal
    Signal: Signal
    roomSize: Number
    damping: Number
    mix: Number
    width: Number
StereoSignal StereoReverb(
    Signal Signal,
    double roomSize = 0.6,
    double damping = 0.5,
    double mix = 0.3,
    double width = 1)

Parameters

nametypedefaultdescription
SignalSignal—
roomSizeNumber0.60 to 1: how long the tail lasts.
dampingNumber0.50 to 1: how quickly the high frequencies die.
mixNumber0.30 is dry, 1 only the reverb.
widthNumber10 to 1: how wide the tail spreads.

Returns

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

To String

Function

The signal as an expression, such as lowpass(saw(220), 800).

Signature
ToString(Signal: Signal) -> Text
string ToString(Signal Signal)

Parameters

nametypedefaultdescription
SignalSignal—

Returns

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

Adsr

Function

An ADSR envelope following a gate: rising to 1 over Attack while the gate is above one half, falling to Sustain over Decay and holding, and falling to 0 over Release once the gate drops. Each segment is a straight line from wherever the envelope stands, so a retrigger never jumps.

Signature
Adsr -> Signal
    gate: Signal
    attack: Number
    decay: Number
    sustain: Number
    release: Number
Signal Adsr(
    Signal gate,
    double attack = 0.01,
    double decay = 0.1,
    double sustain = 0.7,
    double release = 0.3)

Parameters

nametypedefaultdescription
gateSignal—
attackNumber0.01
decayNumber0.1
sustainNumber0.7
releaseNumber0.3

Returns

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

Constant

Function

A constant value.

Signature
Constant(value: Number) -> Signal
Signal Constant(double value)

Parameters

nametypedefaultdescription
valueNumber—

Returns

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

Control

Function

A value set from outside while the signal runs - a knob, a gate a key holds - read every sample.

Signature
Control(value: Control Value) -> Signal
Signal Control(ControlValue value)

Parameters

nametypedefaultdescription
valueControl Value—

Returns

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

Gate

Function

A gate: 1 for On Seconds, then 0 - repeating every Period Seconds when that is positive.

Signature
Gate -> Signal
    onSeconds: Number
    periodSeconds: Number
    delaySeconds: Number
Signal Gate(
    double onSeconds,
    double periodSeconds = 0,
    double delaySeconds = 0)

Parameters

nametypedefaultdescription
onSecondsNumber—
periodSecondsNumber0
delaySecondsNumber0

Returns

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

Grains

Function

Granular synthesis from a clip: short Hann-windowed grains, Density a second, each read from where Position points when it starts, give or take Jitter seconds, at the speed Pitch says. A position that stands still freezes the sound; one that crawls stretches it without changing its pitch.

Signature
Grains -> Signal
    clip: AudioBuffer
    position: Signal
    pitch: Signal
    grainSeconds: Number
    density: Number
    jitter: Number
    seed: Integer
Signal Grains(
    AudioBuffer clip,
    Signal position,
    Signal pitch,
    double grainSeconds = 0.08,
    double density = 25,
    double jitter = 0.01,
    int seed = 1)

Parameters

nametypedefaultdescription
clipAudioBuffer—The source, mixed to mono.
positionSignal—Where each grain starts, 0 to 1 of the clip; read when the grain starts.
pitchSignal—Each grain's playback speed: 2 is an octave up; read when the grain starts.
grainSecondsNumber0.08How long each grain lasts.
densityNumber25Grains started a second; times Grain Seconds, at most 128 overlapping.
jitterNumber0.01Seconds of random scatter in where each grain reads from.
seedInteger1Which scatter.

Returns

resultSignal

Remarks

Grains overlapping by two or more are scaled so the windows sum to about one, so a clip granulated at its own speed and position comes out at its own level.

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

Input

Function

What a recording device hears, live: silence until a live session opens the device for it, then the device's sound, mixed to mono, about Cushion seconds after it arrives.

Signature
Input(device: Text, cushion: Number) -> Signal
Signal Input(string device, double cushion = 0.01)

Parameters

nametypedefaultdescription
deviceText—The device's name as the host lists it; empty for the system's default.
cushionNumber0.01Seconds of sound kept waiting so the audio thread never runs dry between the device's chunks, 0 to 0.5; see Live.LiveInput.

Returns

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

Mix

Function

Several signals summed.

Signature
Mix(signals: Signal Array) -> Signal
Signal Mix(params Signal[] signals)

Parameters

nametypedefaultdescription
signalsSignal Array—

Returns

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

Noise

Function

Noise from -1 to 1, the same for the same seed.

Signature
Noise(color: Noise Color, seed: Integer) -> Signal
Signal Noise(NoiseColor color = NoiseColor.White, int seed = 1)

Parameters

nametypedefaultdescription
colorNoise ColorWhite
seedInteger1

Returns

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

Addition Operation

Function

The sum of two signals: mixing.

Signature
op_Addition(a: Signal, b: Signal) -> Signal
Signal op_Addition(Signal a, Signal b)

Parameters

nametypedefaultdescription
aSignal—
bSignal—

Returns

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

Op Implicit

Function

This node carries no documentation.

Signature
op_Implicit(value: Number) -> Signal
Signal op_Implicit(double value)

Parameters

nametypedefaultdescription
valueNumber—

Returns

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

Multiply Operation

Function

The product of two signals: gain, ring modulation, an envelope applied.

Signature
op_Multiply(a: Signal, b: Signal) -> Signal
Signal op_Multiply(Signal a, Signal b)

Parameters

nametypedefaultdescription
aSignal—
bSignal—

Returns

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

Subtraction Operation

Function

The difference of two signals.

Signature
op_Subtraction(a: Signal, b: Signal) -> Signal
Signal op_Subtraction(Signal a, Signal b)

Parameters

nametypedefaultdescription
aSignal—
bSignal—

Returns

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

Unary Negation Operation

Function

The signal upside down.

Signature
op_UnaryNegation(a: Signal) -> Signal
Signal op_UnaryNegation(Signal a)

Parameters

nametypedefaultdescription
aSignal—

Returns

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

Operator

Function

A phase-modulation operator, the building block of the Yamaha DX7 and every FM synthesizer since: a sine at Frequency whose phase is pushed by Modulation radians every sample, and by its own last output times Feedback.

Signature
Operator -> Signal
    frequency: Signal
    modulation: Signal
    feedback: Number
    phase: Number
Signal Operator(
    Signal frequency,
    Signal modulation,
    double feedback = 0,
    double phase = 0)

Parameters

nametypedefaultdescription
frequencySignal—Hertz; read every sample.
modulationSignal—Radians added to the phase; a modulator of amplitude I gives sidebands at the Bessel amplitudes J_n(I).
feedbackNumber0Radians of its own output fed back into its phase, 0 to about 1.5.
phaseNumber0Where in its cycle it starts, 0 to 1.

Returns

resultSignal

Remarks

Chain operators by wiring one's output, scaled by a modulation index, into the next one's modulation. The feedback path averages the last two outputs, as the DX7's does, so a feedback near 1.5 turns the sine into a clean saw instead of noise.

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

Oscillator

Function

An oscillator from -1 to 1 at a frequency in hertz, which may itself be a signal - vibrato, FM, a glide.

Signature
Oscillator -> Signal
    shape: Oscillator Shape
    frequency: Signal
    phase: Number
Signal Oscillator(
    OscillatorShape shape,
    Signal frequency,
    double phase = 0)

Parameters

nametypedefaultdescription
shapeOscillator Shape—The waveform.
frequencySignal—Hertz; read every sample.
phaseNumber0Where in its cycle it starts, 0 to 1.

Returns

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

Pluck

Function

A plucked string by the Karplus-Strong algorithm with Jaffe and Smith's extensions: each rising edge of Trigger fills a delay line one period long with a burst of noise, and the burst circulates through a gentle lowpass, losing its high harmonics first as a string does.

Signature
Pluck -> Signal
    trigger: Signal
    frequency: Signal
    decay: Number
    brightness: Number
    seed: Integer
Signal Pluck(
    Signal trigger,
    Signal frequency,
    double decay = 2,
    double brightness = 0.5,
    int seed = 1)

Parameters

nametypedefaultdescription
triggerSignal—Plucks on every rise past one half.
frequencySignal—Hertz, read at each pluck.
decayNumber2Seconds for the fundamental to fall 60 dB.
brightnessNumber0.50 to 1: how much the loop and the pluck keep the high harmonics.
seedInteger1Which noise each pluck starts from.

Returns

resultSignal

Remarks

The period is tuned to a fraction of a sample with a first-order allpass, so notes are in tune across the keyboard rather than flat in the top octaves, and the loop gain is set from Decay, so the fundamental is 60 dB down after that many seconds whatever the pitch; high notes, whose loop filter alone would take them down faster, get a lighter filter and so keep a little more brightness. Every pluck starts at the same level, so brightness changes the tone and not the loudness, and the string stays within ±1.

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

Pulse

Function

A band-limited pulse whose high part lasts Width of a cycle; a width that moves is pulse-width modulation.

Signature
Pulse(frequency: Signal, width: Signal, phase: Number) -> Signal
Signal Pulse(Signal frequency, Signal width, double phase = 0)

Parameters

nametypedefaultdescription
frequencySignal—
widthSignal—
phaseNumber0

Returns

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

Ramp

Function

A straight line from one value to another over some seconds, then held.

Signature
Ramp(from: Number, to: Number, seconds: Number) -> Signal
Signal Ramp(double from, double to, double seconds)

Parameters

nametypedefaultdescription
fromNumber—
toNumber—
secondsNumber—

Returns

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

Render Stereo

Function

Renders two signals as the left and right of a stereo clip, compiled together so a signal both share is computed once.

Signature
RenderStereo -> AudioBuffer
    left: Signal
    right: Signal
    seconds: Number
    sampleRate: Integer
    blockSize: Integer
AudioBuffer RenderStereo(
    Signal left,
    Signal right,
    double seconds,
    int sampleRate = 44100,
    int blockSize = 256)

Parameters

nametypedefaultdescription
leftSignal—
rightSignal—
secondsNumber—
sampleRateInteger44100
blockSizeInteger256

Returns

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

Sample

Function

A clip played back, mixed to mono, at a speed that may itself be a signal - 2 an octave up, -1 backwards; silence once it runs out unless it loops.

Signature
Sample(clip: AudioBuffer, speed: Signal, loop: Truth) -> Signal
Signal Sample(AudioBuffer clip, Signal speed, bool loop = false)

Parameters

nametypedefaultdescription
clipAudioBuffer—
speedSignal—
loopTruthFalse

Returns

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

Saw

Function

A band-limited saw.

Signature
Saw(frequency: Signal, phase: Number) -> Signal
Signal Saw(Signal frequency, double phase = 0)

Parameters

nametypedefaultdescription
frequencySignal—
phaseNumber0

Returns

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

Sine

Function

A sine.

Signature
Sine(frequency: Signal, phase: Number) -> Signal
Signal Sine(Signal frequency, double phase = 0)

Parameters

nametypedefaultdescription
frequencySignal—
phaseNumber0

Returns

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

Square

Function

A band-limited square.

Signature
Square(frequency: Signal, phase: Number) -> Signal
Signal Square(Signal frequency, double phase = 0)

Parameters

nametypedefaultdescription
frequencySignal—
phaseNumber0

Returns

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

Triangle

Function

A band-limited triangle.

Signature
Triangle(frequency: Signal, phase: Number) -> Signal
Signal Triangle(Signal frequency, double phase = 0)

Parameters

nametypedefaultdescription
frequencySignal—
phaseNumber0

Returns

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

Wavetable

Function

A wavetable oscillator: the table's frames played at a frequency, morphing between neighbouring frames as Position moves from 0 to 1, from a copy of the table band-limited for the frequency it is playing.

Signature
Wavetable -> Signal
    table: Wavetable
    frequency: Signal
    position: Signal
    phase: Number
Signal Wavetable(
    Wavetable table,
    Signal frequency,
    Signal position,
    double phase = 0)

Parameters

nametypedefaultdescription
tableWavetable—The frames.
frequencySignal—Hertz; read every sample.
positionSignal—Where across the frames, 0 to 1; read every sample.
phaseNumber0Where in its cycle it starts, 0 to 1.

Returns

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