CuePlayer:
Filter:
CuePlayer/Classes (extension) | Class

CuePlayer
ExtensionExtension

Organise and execute cues for real-time and mixed electronic works

Description

The CuePlayer is useful for real-time and mixed electronic works (possibly involving acoustic instruments) when the composer wishes to build a series of processes (cues) and execute them one after another during the course of a piece. The cues are initially organised into an Array, and later on they may be triggered via code, a GUI window or any device/software which outputs midi/osc data, such as a footpedal or a Digital Audio Workstation.

There are lots of features which make the CuePlayer useful for composing in-studio and performing on-stage electroacoustic works using SuperCollider. Please read below and go through this short CuePlayerTutorial for more information.

Class Methods

.new

Create a new CuePlayer instance

.globalClock

Returns the global clock. See useGlobalClock.

Instance Methods

.tempo

Set the tempo. Processes may be evaluated with reference to this clock.

Arguments:

bpm

Beats per minute.

Returns:

Beats per minute.

 

.put

Put cue at cue-number, replacing what is there.

This allows explicitly to create a cue at a specific cue-number. Simply construct your cue as a function and then assign it to a cue-number; (think of the cue-number as the index of the cue-list which holds all processes).

Arguments:

cueNumber

The cue-number to register the function.

Function

function

A compatible cue object; a Function, a CueInfo, or a String representing the path of an scd file returning one of the compatible objects.

timeline

An instance of Array with time - function pairs, (time is in beats or optionally in seconds). Alternatively a String representing the path of an scd file. The file must return an Array of time - function pairs, like [ 0, { }, 1, { } ]. See Timeline and the examples at the end of this document.

timelineOptions

An event of timeline options. See Timeline.

 

.add

Add a cue at the end of the cue-list.

Arguments:

function

A compatible cue object; a Function, a CueInfo, or a String representing the path of an scd file returning one of the compatible objects.

timeline

An instance of Array with time - function pairs, (time is in beats or optionally in seconds). Alternatively a String representing the path of an scd file. The file must return an Array of time - function pairs, like [ 0, { }, 1, { } ]. See Timeline and the examples at the end of this document.

timelineOptions

An event of timeline options. See Timeline.

 

.trigger

Trigger a cue.

Arguments:

cueNumber

An integer which corresponds to the function (cue) to evaluate.

.blockTrigger

Filter out triggers that occur too fast.

When the CuePlayer receives a new trigger within less time than the blockTrigger's value, it neglects it. This avoids the piece moving forward by mistake, for example when a footpedal is rapidly pressed twice by accident.

Arguments:

interval

A number. Default is 0.3 secs.

 

.setCurrent

Set current cue.

Arguments:

cueNumber

An integer which corresponds to the function (cue).

 

.next

Trigger next cue.

.hook

Register a function to be avaluated right before triggering a new cue. The function is passed in the cuePlayer as an argument.

.gui

Create a GUI window for the CuePlayer.

This method brings up a convenient window allowing the user to control the CuePlayer from a Graphic User Interface. Through the window the user can monitor input/output buses, trigger cues, use a timer and a metronome and control the server's level.

The CueInfo object is used to add descriptive text to cues (if needed) which may be subsequently displayed on screen using the gui method.

Arguments:

monitorInChannels

An integer (0 - 8) for creating input level meters.

monitorOutChannels

An integer (1 - 48) for creating output level meters.

options

An event of one or more options.

.midiTriggerNoteOn

Set up a midi-trigger on a given note and channel to trigger the next cue. This allows to evaluate sequential cues upon receiving a midi-note through a specified midi-channel. Default note is 60 (middle C) transmitted via channel 15. Bear in mind that the CuePlayer starts counting midi-channels from 1, (as opposed to 0). See also the CuePlayerTutorial.

Arguments:

note

The midi-note which the CuePlayer listens to in order to trigger the next cue.

channel

The midi-channel.

.midiTriggerVelocity

Set up a midi-trigger on a given note and channel to trigger a cue based on the note's velocity value. This allows to evaluate specific cues upon receiving a midi-note; the velocity (1-127) controls the cue-number. Default note is 60 (middle C) transmitted via channel 16. Bear in mind that the CuePlayer starts counting midi-channels from 1, (as opposed to 0). See also the CuePlayerTutorial.

Arguments:

note

The midi-note which the CuePlayer listens to.

channel

The midi-channel.

offset

Add a constant to the specified cue-number. Useful when more than 127 cues are needed.

.midiTriggerControl

Set up a midi-trigger on a given value of a midi-controller to trigger the next cue. This allows to evaluate sequential cues upon receiving a midi-control message from an external device (such as a foot-pedal) through a specified midi-channel. Default value is 0, controller-number is 64, transmitted via channel 1. Bear in mind that the CuePlayer starts counting midi-channels from 1 (as opposed to 0).

Arguments:

value

The value of the midi-controller which will trigger the next cue.

ccNum

The controller's number.

channel

The midi-channel.

.addMIDIFunc

Add a custom midi function.

Arguments:

midiFunc

An instance of MIDIFunc.

.clearMIDI

Clear all MIDI functions defined with midiTriggerNoteOn and midiTriggerVelocity.

.oscTrigger

Set up an Open Sound Control trigger. This allows to evaluate a cue upon receiving an OSC message. Default path is '/cueTrigger'. Default message is -1 which will trigger the next cue; any other positive integer will trigger the respective cue. See also the CuePlayerTutorial.

Arguments:

path

A Symbol indicating the path of the OSC address.

.freeOscTrigger

Free the OSC trigger mechanism.

.sendOSC

Send an open sound control message to a network address. See also the CuePlayerTutorial.

Arguments:

ip

The IP number, like "127.0.0.1".

port

The port number, like 57110.

msg

The message, like ["/play", 1].

.clock

Return the clock currently in use by this CuePlayer instance.

Returns:

A TempoClock instance.

 

.useGlobalClock

Use the common clock. This is a TempoClock used by all CuePlayer instances. Useful when multiple synced CuePlayers are needed.

NOTE: Current GUI implementation for this feature is under development.

.timelineRegister

The timelines are stored in a Dictionary that you can access from your CuePlayer instance using the cue number as the key.

.plot

Provides a visual representation of the selected timeline items. It is applicable only when using timelines. See put and add methods.

Arguments:

cueNumber

An integer. If a timeline is provided, it plots the items in the selected cue-number.

.enableLiveReload

Enable live reloading of scripts provided as path strings. See put and add methods.

.disableLiveReload

Disable live reloading of scripts provided as path strings. See put and add methods.

.guiInstance

Return the instnace of CuePlayerGUI used by this CuePlayer.

 

Examples