Generate
7 nodes
On this page 7
Noise
FunctionRandom noise of a chosen colour.
Noise -> AudioBuffer
color: Noise Color
duration: Number
amplitude: Number
seed: Integer
sampleRate: IntegerAudioBuffer Noise(
NoiseColor color = NoiseColor.White,
double duration = 1,
double amplitude = 0.5,
int seed = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| color | Noise Color | White | White hisses, pink sounds like rain, brown rumbles. |
| duration | Number | 1 | Length, in seconds. |
| amplitude | Number | 0.5 | Peak level, from 0 to 1. |
| seed | Integer | 1 | Which take of the noise. |
| sampleRate | Integer | 44100 | Samples per second. |
Returns
| Audio | AudioBuffer |
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
FunctionThe frequency of a note named the way a musician writes it: A4, C#5, Eb3.
NoteFrequency(note: Text) -> Number
double NoteFrequency(string note = "A4")
Parameters
| name | type | default | description |
|---|---|---|---|
| note | Text | A4 | A letter A to G, an optional # or b, and an octave number. |
Returns
| Frequency | Number |
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
FunctionNothing, for a length of time - a gap between sounds, or a bed to mix them onto.
Silence -> AudioBuffer
duration: Number
channels: Integer
sampleRate: IntegerAudioBuffer Silence(
double duration = 1,
int channels = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| duration | Number | 1 | Length, in seconds. |
| channels | Integer | 1 | How many channels: 1 for mono, 2 for stereo. |
| sampleRate | Integer | 44100 | Samples per second. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generate
- Package
- Audio Processing
Sound Effect
FunctionA synthesized game sound effect - a coin, a laser, an explosion, footsteps, rain - from the built-in recipe library.
SoundEffect(name: Text, seed: Integer) -> AudioBuffer
AudioBuffer SoundEffect(
string name = "Pickup/Coin",
int seed = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | Pickup/Coin | The effect's name, such as Pickup/Coin, Weapon/Laser or Ambient/Rain. |
| seed | Integer | 1 | Which take of the effect. |
Returns
| Audio | AudioBuffer |
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
FunctionThe name of every effect AudioGenerators.SoundEffect can make.
SoundEffectNames() -> Text Array
string[] SoundEffectNames()
Returns
| Names | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generate
- Package
- Audio Processing
Sweep
FunctionA tone whose pitch glides from one frequency to another, evenly in musical terms - each octave takes the same time.
Sweep -> AudioBuffer
startFrequency: Number
endFrequency: Number
duration: Number
amplitude: Number
waveform: Waveform
sampleRate: IntegerAudioBuffer Sweep(
double startFrequency = 100,
double endFrequency = 8000,
double duration = 3,
double amplitude = 0.5,
Waveform waveform = Waveform.Sine,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| startFrequency | Number | 100 | Where the glide starts, in hertz. |
| endFrequency | Number | 8000 | Where it ends, in hertz. |
| duration | Number | 3 | Length, in seconds. |
| amplitude | Number | 0.5 | Peak level, from 0 to 1. |
| waveform | Waveform | Sine | The tone's shape. |
| sampleRate | Integer | 44100 | Samples per second. |
Returns
| Audio | AudioBuffer |
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
FunctionA steady tone of one pitch.
Tone -> AudioBuffer
frequency: Number
duration: Number
amplitude: Number
waveform: Waveform
sampleRate: IntegerAudioBuffer Tone(
double frequency = 440,
double duration = 1,
double amplitude = 0.5,
Waveform waveform = Waveform.Sine,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| frequency | Number | 440 | Pitch, in hertz. 440 is the A above middle C. |
| duration | Number | 1 | Length, in seconds. |
| amplitude | Number | 0.5 | Peak level, from 0 (silent) to 1 (full scale). |
| waveform | Waveform | Sine | Sine is pure; square, triangle and saw add harmonics and sound brighter. |
| sampleRate | Integer | 44100 | Samples per second. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generate
- Package
- Audio Processing