Songs
7 nodes
On this page 7
Instrument Map
FunctionAn instrument map: what plays the drums and what plays every program not mapped. Map Instrument adds programs to it.
Map(fallback: Instrument, drums: Instrument) -> Instrument Map
InstrumentMap Map(Instrument fallback, Instrument drums)
Parameters
| name | type | default | description |
|---|---|---|---|
| fallback | Instrument | — | What plays any program not mapped; the default SoundFont's preset for it when not connected. |
| drums | Instrument | — | What plays the drums; the default SoundFont's kit when not connected. |
Returns
| Map | Instrument Map |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Songs
- Package
- Music
Map Instrument
FunctionA map with one more program given its own instrument: the song's bass on a synth, its strings on a sampler.
MapInstrument -> Instrument Map
map: Instrument Map
program: General Midi Instrument
instrument: InstrumentInstrumentMap MapInstrument(
InstrumentMap map,
GeneralMidiInstrument program,
Instrument instrument)Parameters
| name | type | default | description |
|---|---|---|---|
| map | Instrument Map | — | The map so far; an empty one when not connected. |
| program | General Midi Instrument | — | The program the song names. |
| instrument | Instrument | — | What plays it. |
Returns
| Map | Instrument Map |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Songs
- Package
- Music
MIDI Song Parts
FunctionA MIDI file played part by part, at its own tempo.
MidiSongParts -> Song Part Array
MIDI: MidiDocument
map: Instrument Map
tail: Number
sampleRate: IntegerSongPart[] MidiSongParts(
MidiDocument midi,
InstrumentMap map,
double tail = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| MIDI | MidiDocument | — | The MIDI document. |
| map | Instrument Map | — | The instrument map. |
| tail | Number | 1 | Seconds after the last note. |
| sampleRate | Integer | 44100 | Output rate. |
Returns
| Parts | Song Part Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Songs
- Package
- Music
MIDI Tempo
FunctionThe tempo a MIDI file starts at, for playing music read from it with From MIDI at the speed it was written.
MidiTempo(MIDI: MidiDocument) -> Number
double MidiTempo(MidiDocument midi)
Parameters
| name | type | default | description |
|---|---|---|---|
| MIDI | MidiDocument | — | The MIDI document. |
Returns
| Tempo | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Songs
- Package
- Music
Play MIDI Song
FunctionA MIDI file played as it is written - its own tempo changes and program changes - with every instrument on what the map gives it.
PlayMidiSong -> AudioBuffer
MIDI: MidiDocument
map: Instrument Map
tail: Number
sampleRate: IntegerAudioBuffer PlayMidiSong(
MidiDocument midi,
InstrumentMap map,
double tail = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| MIDI | MidiDocument | — | The MIDI document. |
| map | Instrument Map | — | The instrument map; every program on the default SoundFont when not connected. |
| 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
- Songs
- Package
- Music
Play Song
FunctionA piece of music played with every instrument it names, each on what the map gives it.
PlaySong -> AudioBuffer
music: Music
map: Instrument Map
beatsPerMinute: Number
tail: Number
sampleRate: IntegerAudioBuffer PlaySong(
Music music,
InstrumentMap map,
double beatsPerMinute = 120,
double tail = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| music | Music | — | The piece. |
| map | Instrument Map | — | The instrument map; every program on the default SoundFont when not connected. |
| 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
- Songs
- Package
- Music
Song Parts
FunctionA piece of music played part by part: one clip for each instrument it names and one for its drums, all as long as the song, ready for Arrange Song or a Mix Track each.
SongParts -> Song Part Array
music: Music
map: Instrument Map
beatsPerMinute: Number
tail: Number
sampleRate: IntegerSongPart[] SongParts(
Music music,
InstrumentMap map,
double beatsPerMinute = 120,
double tail = 1,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| music | Music | — | The piece. |
| map | Instrument Map | — | The instrument map. |
| beatsPerMinute | Number | 120 | Quarter notes a minute. |
| tail | Number | 1 | Seconds after the last note. |
| sampleRate | Integer | 44100 | Output rate. |
Returns
| Parts | Song Part Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Songs
- Package
- Music