SoundFonts
8 nodes
On this page 8
Default SoundFont
FunctionThe General MIDI SoundFont that ships with Divooka: GeneralUser GS, 287 presets covering every General MIDI instrument and drum kit.
DefaultSoundFont() -> Sound Font Bank
SoundFontBank DefaultSoundFont()
Returns
| SoundFont | Sound 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
FunctionA font's name, preset count, size and the text it stores about itself: author, copyright, comments.
DescribeSoundFont(soundFont: Sound Font Bank) -> Text
string DescribeSoundFont(SoundFontBank soundFont)
Parameters
| name | type | default | description |
|---|---|---|---|
| soundFont | Sound Font Bank | — | The font; the default one when not connected. |
Returns
| Description | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- SoundFonts
- Package
- Music
Find Preset
FunctionThe first preset whose name contains the given text, ignoring case - "piano", "strings", "kit".
FindPreset -> Sound Font Preset
soundFont: Sound Font Bank
name: TextSoundFontPreset FindPreset(
SoundFontBank soundFont,
string name = "piano")Parameters
| name | type | default | description |
|---|---|---|---|
| soundFont | Sound Font Bank | — | The font; the default one when not connected. |
| name | Text | piano | Part of the preset's name. |
Returns
| Preset | Sound Font Preset |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- SoundFonts
- Package
- Music
Load SoundFont
FunctionOpens a SoundFont 2 file.
LoadSoundFont(path: Text) -> Sound Font Bank
SoundFontBank LoadSoundFont(string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | An .sf2 file. |
Returns
| SoundFont | Sound 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
FunctionReads a SoundFont that is already in memory - an asset, a download, an attachment.
LoadSoundFontBytes -> Sound Font Bank
bytes: Byte Array
name: TextSoundFontBank LoadSoundFontBytes(byte[] bytes, string name = "")
Parameters
| name | type | default | description |
|---|---|---|---|
| bytes | Byte Array | — | The whole .sf2 file. |
| name | Text | — | What to call it; the name stored in the file when empty. |
Returns
| SoundFont | Sound Font Bank |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- SoundFonts
- Package
- Music
Presets
FunctionEvery preset in a font, by bank and program.
Presets(soundFont: Sound Font Bank) -> Sound Font Preset Array
SoundFontPreset[] Presets(SoundFontBank soundFont)
Parameters
| name | type | default | description |
|---|---|---|---|
| soundFont | Sound Font Bank | — | The font; the default one when not connected. |
Returns
| Presets | Sound Font Preset Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- SoundFonts
- Package
- Music
Save SoundFont
FunctionSaves a font as an .sf2 file, creating the folder if it is not there.
SaveSoundFont(soundFont: Sound Font Bank, path: Text) -> Text
string SaveSoundFont(SoundFontBank soundFont, string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| soundFont | Sound Font Bank | — | The font to save. |
| path | Text | — | Where to write it. |
Returns
| Path | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- SoundFonts
- Package
- Music
Trim SoundFont
FunctionA 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.
TrimSoundFont -> Sound Font Bank
soundFont: Sound Font Bank
presets: Text ArraySoundFontBank TrimSoundFont(
SoundFontBank soundFont,
string[] presets)Parameters
| name | type | default | description |
|---|---|---|---|
| soundFont | Sound Font Bank | — | The font to trim; the default one when not connected. |
| presets | Text Array | — | The presets to keep, written bank:program, such as 0:0 for the piano and 128:0 for the standard drum kit. |
Returns
| SoundFont | Sound 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