Divooka Reference

SoundFonts

8 nodes

On this page 8

Default SoundFont

Function

The General MIDI SoundFont that ships with Divooka: GeneralUser GS, 287 presets covering every General MIDI instrument and drum kit.

Signature
DefaultSoundFont() -> Sound Font Bank
SoundFontBank DefaultSoundFont()

Returns

SoundFontSound Font Bank

Remarks

Set SYNTHSIZER_SOUNDFONT_FILE to use another font everywhere one is not given.

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

Describe SoundFont

Function

A font's name, preset count, size and the text it stores about itself: author, copyright, comments.

Signature
DescribeSoundFont(soundFont: Sound Font Bank) -> Text
string DescribeSoundFont(SoundFontBank soundFont)

Parameters

nametypedefaultdescription
soundFontSound Font Bank—The font; the default one when not connected.

Returns

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

Find Preset

Function

The first preset whose name contains the given text, ignoring case - "piano", "strings", "kit".

Signature
FindPreset -> Sound Font Preset
    soundFont: Sound Font Bank
    name: Text
SoundFontPreset FindPreset(
    SoundFontBank soundFont,
    string name = "piano")

Parameters

nametypedefaultdescription
soundFontSound Font Bank—The font; the default one when not connected.
nameTextpianoPart of the preset's name.

Returns

PresetSound Font Preset
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SoundFonts
Package
Music

Load SoundFont

Function

Opens a SoundFont 2 file.

Signature
LoadSoundFont(path: Text) -> Sound Font Bank
SoundFontBank LoadSoundFont(string path)

Parameters

nametypedefaultdescription
pathText—An .sf2 file.

Returns

SoundFontSound Font Bank

Remarks

A file is read once and shared while it is unchanged, so loading the same font on every run costs nothing after the first.

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

Load SoundFont Bytes

Function

Reads a SoundFont that is already in memory - an asset, a download, an attachment.

Signature
LoadSoundFontBytes -> Sound Font Bank
    bytes: Byte Array
    name: Text
SoundFontBank LoadSoundFontBytes(byte[] bytes, string name = "")

Parameters

nametypedefaultdescription
bytesByte Array—The whole .sf2 file.
nameText—What to call it; the name stored in the file when empty.

Returns

SoundFontSound Font Bank
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SoundFonts
Package
Music

Presets

Function

Every preset in a font, by bank and program.

Signature
Presets(soundFont: Sound Font Bank) -> Sound Font Preset Array
SoundFontPreset[] Presets(SoundFontBank soundFont)

Parameters

nametypedefaultdescription
soundFontSound Font Bank—The font; the default one when not connected.

Returns

PresetsSound Font Preset Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
SoundFonts
Package
Music

Save SoundFont

Function

Saves a font as an .sf2 file, creating the folder if it is not there.

Signature
SaveSoundFont(soundFont: Sound Font Bank, path: Text) -> Text
string SaveSoundFont(SoundFontBank soundFont, string path)

Parameters

nametypedefaultdescription
soundFontSound Font Bank—The font to save.
pathText—Where to write it.

Returns

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

Trim SoundFont

Function

A smaller font holding only the chosen presets and the instruments and samples they use - for shipping the three sounds a piece plays instead of the whole bank.

Signature
TrimSoundFont -> Sound Font Bank
    soundFont: Sound Font Bank
    presets: Text Array
SoundFontBank TrimSoundFont(
    SoundFontBank soundFont,
    string[] presets)

Parameters

nametypedefaultdescription
soundFontSound Font Bank—The font to trim; the default one when not connected.
presetsText Array—The presets to keep, written bank:program, such as 0:0 for the piano and 128:0 for the standard drum kit.

Returns

SoundFontSound Font Bank

Remarks

Stereo partners of kept samples are kept with them. Every kept preset sounds exactly as it did in the original.

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