Instruments
8 nodes
On this page 8
FM Instrument
FunctionA General MIDI voice on an emulated OPL FM chip.
FmInstrument -> Instrument
instrument: General Midi Instrument
chip: OplChipTypeInstrument FmInstrument(
GeneralMidiInstrument instrument = GeneralMidiInstrument.AcousticGrandPiano,
OplChipType chip = OplChipType.Opl3)Parameters
| name | type | default | description |
|---|---|---|---|
| instrument | General Midi Instrument | Acoustic grand piano | Which voice. |
| chip | OplChipType | Opl3 | OPL2 or OPL3. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
Play Part
FunctionMusic played on one instrument, whatever instruments it names: a part, ready for the mixer.
PlayPart -> AudioBuffer
music: Music
instrument: Instrument
beatsPerMinute: Number
tail: Number
sampleRate: IntegerAudioBuffer PlayPart(
Music music,
Instrument instrument,
double beatsPerMinute = 120,
double tail = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| music | Music | — | The part. |
| instrument | Instrument | — | What plays it. |
| beatsPerMinute | Number | 120 | Quarter notes a minute. |
| tail | Number | 1 | Seconds after the last note. |
| sampleRate | Integer | 44100 | Output rate. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
Plucked Instrument
FunctionA plucked string: each note a burst of noise ringing at its pitch, dying away high harmonics first, damped when the key lifts.
PluckedInstrument -> Instrument
decay: Number
brightness: Number
release: Number
gain: NumberInstrument PluckedInstrument(
double decay = 3,
double brightness = 0.6,
double release = 0.08,
double gain = 0.6)Parameters
| name | type | default | description |
|---|---|---|---|
| decay | Number | 3 | Seconds for a held note to fall 60 dB. |
| brightness | Number | 0.6 | 0 to 1: a soft finger to a hard pick; louder notes are brighter. |
| release | Number | 0.08 | Seconds a lifted note takes to be damped. |
| gain | Number | 0.6 | The voice's level. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
Preset Instrument
FunctionAny preset of a SoundFont - another bank's variation, or a drum kit, which plays by key.
PresetInstrument -> Instrument
preset: Sound Font Preset
soundFont: Sound Font BankInstrument PresetInstrument(
SoundFontPreset preset,
SoundFontBank soundFont)Parameters
| name | type | default | description |
|---|---|---|---|
| preset | Sound Font Preset | — | The preset, from Presets or Find Preset. |
| soundFont | Sound Font Bank | — | The font it belongs to; the default when not connected. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
Sampler Instrument
FunctionA recording played at every pitch: the root note at its own speed, the rest faster or slower.
SamplerInstrument -> Instrument
sample: AudioBuffer
rootNote: Text
attack: Number
release: Number
loop: TruthInstrument SamplerInstrument(
AudioBuffer sample,
string rootNote = "C4",
double attack = 0.002,
double release = 0.1,
bool loop = false)Parameters
| name | type | default | description |
|---|---|---|---|
| sample | AudioBuffer | — | The recording. |
| rootNote | Text | C4 | The note it sounds at, such as C4. |
| attack | Number | 0.002 | Seconds to fade in. |
| release | Number | 0.1 | Seconds to fade out after each note. |
| loop | Truth | False | Whether a long note loops the recording. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
SoundFont Instrument
FunctionA General MIDI instrument from a SoundFont.
SoundFontInstrument -> Instrument
instrument: General Midi Instrument
soundFont: Sound Font BankInstrument SoundFontInstrument(
GeneralMidiInstrument instrument = GeneralMidiInstrument.AcousticGrandPiano,
SoundFontBank soundFont)Parameters
| name | type | default | description |
|---|---|---|---|
| instrument | General Midi Instrument | Acoustic grand piano | Which instrument. |
| soundFont | Sound Font Bank | — | The font; the default General MIDI one when not connected. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
Synth Instrument
FunctionA subtractive synthesizer: detuned band-limited oscillators through a resonant ladder filter that the envelope opens.
SynthInstrument -> Instrument
shape: Oscillator Shape
detune: Number
cutoff: Number
resonance: Number
filterEnvelope: Number
attack: Number
decay: Number
sustain: Number
release: Number
gain: NumberInstrument SynthInstrument(
OscillatorShape shape = OscillatorShape.Saw,
double detune = 8,
double cutoff = 600,
double resonance = 0.3,
double filterEnvelope = 2400,
double attack = 0.005,
double decay = 0.25,
double sustain = 0.5,
double release = 0.2,
double gain = 0.4)Parameters
| name | type | default | description |
|---|---|---|---|
| shape | Oscillator Shape | Saw | The oscillators' waveform. |
| detune | Number | 8 | Cents between the two oscillators; 0 for one. |
| cutoff | Number | 600 | The filter's resting cutoff, hertz. |
| resonance | Number | 0.3 | 0 to 1. |
| filterEnvelope | Number | 2400 | Hertz the envelope opens the filter by. |
| attack | Number | 0.005 | Seconds to rise. |
| decay | Number | 0.25 | Seconds to settle. |
| sustain | Number | 0.5 | The level held, 0 to 1. |
| release | Number | 0.2 | Seconds to die away. |
| gain | Number | 0.4 | The voice's level. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music
Wavetable Instrument
FunctionA wavetable synthesizer: each note plays the table at its pitch while the envelope sweeps the position, so the timbre moves as the note sounds.
WavetableInstrument -> Instrument
table: Wavetable
position: Number
sweep: Number
cutoff: Number
attack: Number
decay: Number
sustain: Number
release: Number
gain: NumberInstrument WavetableInstrument(
Wavetable table,
double position = 0,
double sweep = 0.6,
double cutoff = 6000,
double attack = 0.01,
double decay = 0.4,
double sustain = 0.6,
double release = 0.3,
double gain = 0.4)Parameters
| name | type | default | description |
|---|---|---|---|
| table | Wavetable | — | The waves; sine, triangle, saw and square when not connected. |
| position | Number | 0 | Where across the waves a note rests, 0 to 1. |
| sweep | Number | 0.6 | How far the envelope moves the position at its peak. |
| cutoff | Number | 6000 | The lowpass cutoff, hertz. |
| attack | Number | 0.01 | Seconds to rise. |
| decay | Number | 0.4 | Seconds to settle. |
| sustain | Number | 0.6 | The level held, 0 to 1. |
| release | Number | 0.3 | Seconds to die away. |
| gain | Number | 0.4 | The voice's level. |
Returns
| Instrument | Instrument |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Instruments
- Package
- Music