Divooka Reference

Live Music

9 nodes

On this page 9

Add Live Track

Function

Adds a track to a live session: another pattern on another instrument, in time with the rest from the next cycle.

Signature
AddTrack -> Live Session
    session: Live Session
    pattern: Pattern
    instrument: Instrument
    name: Text
    gain: Number
LiveSession AddTrack(
    LiveSession session,
    Pattern pattern,
    Instrument instrument,
    string name = "bass",
    double gain = 1)

Parameters

nametypedefaultdescription
sessionLive Session—The session.
patternPattern—What the track plays.
instrumentInstrument—What plays it; the default SoundFont's piano when not connected.
nameTextbassWhat to call the track, for Update Live.
gainNumber1The track's level.

Returns

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

Record Live

Function

Starts recording what a live session plays, from the next block.

Signature
Record(session: Live Session) -> Live Session
LiveSession Record(LiveSession session)

Parameters

nametypedefaultdescription
sessionLive Session—The session.

Returns

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

Render Live

Function

Runs the live engine offline: a pattern on an instrument for some cycles, rendered exactly as the device would hear it, into a clip.

Signature
Render -> AudioBuffer
    pattern: Pattern
    instrument: Instrument
    beatsPerMinute: Number
    cycles: Integer
    cycleBeats: Number
    tail: Number
    sampleRate: Integer
AudioBuffer Render(
    Pattern pattern,
    Instrument instrument,
    double beatsPerMinute = 120,
    int cycles = 4,
    double cycleBeats = 4,
    double tail = 1,
    int sampleRate = 44100)

Parameters

nametypedefaultdescription
patternPattern—What to play.
instrumentInstrument—What plays it; the default SoundFont's piano when not connected.
beatsPerMinuteNumber120The tempo.
cyclesInteger4How many cycles.
cycleBeatsNumber4Beats a cycle lasts.
tailNumber1Seconds after the last cycle, for the sound to ring out.
sampleRateInteger44100Output rate.

Returns

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

Set Live Tempo

Function

Changes a live session's tempo while it plays.

Signature
SetTempo -> Live Session
    session: Live Session
    beatsPerMinute: Number
LiveSession SetTempo(
    LiveSession session,
    double beatsPerMinute = 120)

Parameters

nametypedefaultdescription
sessionLive Session—The session.
beatsPerMinuteNumber120The new tempo.

Returns

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

Set Live Track Level

Function

Sets one track's level while it plays; 0 mutes it.

Signature
SetTrackGain -> Live Session
    session: Live Session
    track: Text
    gain: Number
LiveSession SetTrackGain(
    LiveSession session,
    string track = "",
    double gain = 1)

Parameters

nametypedefaultdescription
sessionLive Session—The session.
trackText—Which track; the first when empty.
gainNumber1The level.

Returns

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

Start Live

Function

Starts playing a pattern on the audio device, looping until it is stopped.

Signature
Start -> Live Session
    pattern: Pattern
    instrument: Instrument
    beatsPerMinute: Number
    cycleBeats: Number
LiveSession Start(
    Pattern pattern,
    Instrument instrument,
    double beatsPerMinute = 120,
    double cycleBeats = 4)

Parameters

nametypedefaultdescription
patternPattern—What to play.
instrumentInstrument—What plays it; the default SoundFont's piano when not connected. FM instruments play offline only.
beatsPerMinuteNumber120The tempo.
cycleBeatsNumber4Beats a cycle of the pattern lasts; 4 is a bar of 4/4.

Returns

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

Stop Live

Function

Stops a live session.

Signature
Stop(session: Live Session)
void Stop(LiveSession session)

Parameters

nametypedefaultdescription
sessionLive Session—The session.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Live Music
Package
Music

Stop Recording

Function

Stops recording a live session and gives back what was heard since Record Live, as a clip for the mixer or a file.

Signature
StopRecording(session: Live Session) -> AudioBuffer
AudioBuffer StopRecording(LiveSession session)

Parameters

nametypedefaultdescription
sessionLive Session—The session.

Returns

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

Update Live

Function

Swaps what a track of a live session plays without stopping it, on the same beat grid: at the start of the next cycle unless told otherwise, so a phrase is never cut off halfway.

Signature
Update -> Live Session
    session: Live Session
    pattern: Pattern
    track: Text
    quantize: Live Quantize
LiveSession Update(
    LiveSession session,
    Pattern pattern,
    string track = "",
    LiveQuantize quantize = LiveQuantize.Cycle)

Parameters

nametypedefaultdescription
sessionLive Session—The session.
patternPattern—The new pattern.
trackText—Which track; the first when empty.
quantizeLive QuantizeCycleWhen the new pattern takes over.

Returns

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