Divooka Reference

Rendering

14 nodes

On this page 14

Default Sample Rate

Function

The rate everything renders at unless asked otherwise.

Signature
DefaultSampleRate() -> Integer
int DefaultSampleRate()

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Music Styles

Function

The styles Render Generated Music composes in.

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

Returns

StylesText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Generated Music

Function

Composes a piece in a style and renders it through a SoundFont.

Signature
RenderGeneratedMusic -> AudioBuffer
    style: Text
    length: MusicLength
    seed: Integer
    seconds: Number
    soundFont: Sound Font Bank
    sampleRate: Integer
AudioBuffer RenderGeneratedMusic(
    string style = "Cinematic",
    MusicLength length = MusicLength.Short,
    int seed = 1,
    double seconds = 0,
    SoundFontBank soundFont,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
styleTextCinematicA style from Music Styles, such as Cinematic, BattleDrive or Ambient.
lengthMusicLengthShortThe shape: a stinger, a short piece, a full song, or a seamless loop.
seedInteger1Which piece; the same seed always composes the same one.
secondsNumber0About how long it should run; zero lets the style decide.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render MIDI

Function

Renders a MIDI document built in the graph through a SoundFont.

Signature
RenderMidi -> AudioBuffer
    MIDI: MidiDocument
    soundFont: Sound Font Bank
    tail: Number
    sampleRate: Integer
AudioBuffer RenderMidi(
    MidiDocument midi,
    SoundFontBank soundFont,
    double tail = 2,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
MIDIMidiDocument—The document.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
tailNumber2Seconds rendered after the last event.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render MIDI Bytes

Function

Renders a Standard MIDI File already in memory through a SoundFont.

Signature
RenderMidiBytes -> AudioBuffer
    bytes: Byte Array
    soundFont: Sound Font Bank
    tail: Number
    sampleRate: Integer
AudioBuffer RenderMidiBytes(
    byte[] bytes,
    SoundFontBank soundFont,
    double tail = 2,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
bytesByte Array—The whole .mid file.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
tailNumber2Seconds rendered after the last event.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render MIDI On FM Chip

Function

Renders a MIDI document built in the graph on an emulated OPL FM chip.

Signature
RenderMidiDocumentOnFm -> AudioBuffer
    MIDI: MidiDocument
    chip: OplChipType
    sampleRate: Integer
AudioBuffer RenderMidiDocumentOnFm(
    MidiDocument midi,
    OplChipType chip = OplChipType.Opl3,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
MIDIMidiDocument—The document.
chipOplChipTypeOpl3OPL2 (mono) or OPL3 (stereo).
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render MIDI File

Function

Renders a Standard MIDI File through a SoundFont.

Signature
RenderMidiFile -> AudioBuffer
    path: Text
    soundFont: Sound Font Bank
    tail: Number
    sampleRate: Integer
AudioBuffer RenderMidiFile(
    string path,
    SoundFontBank soundFont,
    double tail = 2,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
pathText—A .mid file.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
tailNumber2Seconds rendered after the last event, so the last notes ring out.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render MIDI On FM

Function

Renders a Standard MIDI File on an emulated Yamaha OPL FM chip - the sound of 1990s PC games - with its General MIDI instrument bank. Nothing is sampled: every note is two sine-wave operators, one modulating the other.

Signature
RenderMidiOnFm -> AudioBuffer
    bytes: Byte Array
    chip: OplChipType
    sampleRate: Integer
AudioBuffer RenderMidiOnFm(
    byte[] bytes,
    OplChipType chip = OplChipType.Opl3,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
bytesByte Array—The whole .mid file.
chipOplChipTypeOpl3OPL2 (nine voices, mono) or OPL3 (eighteen voices, stereo).
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Music

Function

Renders music written with the Euterpea nodes through a SoundFont: every instrument it names, drums on the General MIDI kit.

Signature
RenderMusic -> AudioBuffer
    music: Music
    soundFont: Sound Font Bank
    beatsPerMinute: Number
    tail: Number
    sampleRate: Integer
AudioBuffer RenderMusic(
    Music music,
    SoundFontBank soundFont,
    double beatsPerMinute = 120,
    double tail = 2,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
musicMusic—The music.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
beatsPerMinuteNumber120Quarter notes a minute; a Tempo node inside the music speeds its part further.
tailNumber2Seconds rendered after the last note, so it rings out.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Music On FM

Function

Renders music written with the Euterpea nodes on an emulated OPL FM chip.

Signature
RenderMusicOnFm -> AudioBuffer
    music: Music
    beatsPerMinute: Number
    chip: OplChipType
    sampleRate: Integer
AudioBuffer RenderMusicOnFm(
    Music music,
    double beatsPerMinute = 120,
    OplChipType chip = OplChipType.Opl3,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
musicMusic—The music.
beatsPerMinuteNumber120Quarter notes a minute.
chipOplChipTypeOpl3OPL2 (mono) or OPL3 (stereo).
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Note

Function

One note played on one SoundFont preset: pressed, held, then released and left to ring.

Signature
RenderNote -> AudioBuffer
    soundFont: Sound Font Bank
    program: Integer
    key: Integer
    velocity: Integer
    duration: Number
    release: Number
    bank: Integer
    sampleRate: Integer
AudioBuffer RenderNote(
    SoundFontBank soundFont,
    int program = 0,
    int key = 60,
    int velocity = 100,
    double duration = 1,
    double release = 1,
    int bank = 0,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
programInteger0The instrument: 0 is the piano, 24 nylon guitar, 40 violin, 56 trumpet, 73 flute in General MIDI. For a drum kit, the kit.
keyInteger60MIDI key: 60 is middle C, 69 the A above it. For a drum kit the key is the drum: 36 kick, 38 snare, 42 closed hi-hat.
velocityInteger100How hard the key is struck, 1 to 127.
durationNumber1Seconds the key is held.
releaseNumber1Seconds rendered after it is let go.
bankInteger00 for melodic sounds, 128 for drum kits.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Preset Note

Function

One note played on a preset found with Find Preset or Presets.

Signature
RenderPresetNote -> AudioBuffer
    preset: Sound Font Preset
    soundFont: Sound Font Bank
    key: Integer
    velocity: Integer
    duration: Number
    release: Number
AudioBuffer RenderPresetNote(
    SoundFontPreset preset,
    SoundFontBank soundFont,
    int key = 60,
    int velocity = 100,
    double duration = 1,
    double release = 1)

Parameters

nametypedefaultdescription
presetSound Font Preset—The preset to play.
soundFontSound Font Bank—The font the preset belongs to; the default one when not connected.
keyInteger60MIDI key, 60 is middle C.
velocityInteger100How hard the key is struck, 1 to 127.
durationNumber1Seconds the key is held.
releaseNumber1Seconds rendered after it is let go.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Score

Function

Renders a score sheet through a SoundFont: every part on its instrument, drums on the drum channel, vocal samples mixed in where the score places them.

Signature
RenderScore -> AudioBuffer
    score: Musical Score
    soundFont: Sound Font Bank
    sampleRate: Integer
AudioBuffer RenderScore(
    FScoreSheet score,
    SoundFontBank soundFont,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
scoreMusical Score—The score, from Parse.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music

Render Score Text

Function

Renders a score written in Cantus numbered notation, such as [C C G G] [A A G/2], through a SoundFont.

Signature
RenderScoreText -> AudioBuffer
    score: Text
    soundFont: Sound Font Bank
    sampleRate: Integer
AudioBuffer RenderScoreText(
    string score = "[C C G G] [A A G/2] [F F E E] [D D C/2]",
    SoundFontBank soundFont,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
scoreText[C C G G] [A A G/2] [F F E E] [D D C/2]The score text.
soundFontSound Font Bank—The font; the default General MIDI one when not connected.
sampleRateInteger44100Output rate.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Rendering
Package
Music