ConductorPlayer

 

related classes: Conductor, CVEvent

player classes: ActionPlayer, PatternPlayer, TaskPlayer, NodeProxyPlayer 

see also: NodeEvent

ConductorPlayer provides unified control for any collection of 'players', which are objects that 

respond to stop/play/pause/resume.  The player classes listed above adapt standard classes to this 

interface.


Groups, synths, control buses, and buffers can be controlled with Events.


The instance variable server can contain either a single Server or an array of Servers.  

ConductorPlayer bundles all of the OSC commands generated in response to stop/play/pause/resume 

for the servers in that variable.

Instance Variables

conductor the Conductor that is the context for its players

name the name is used in GUI display

server A server or array of servers, all of the OSC commands generated in response to 

stop/play/pause/resume are bundled for the server(s).

players the players controlled by the ConductorPlayer

Instance Methods

play

stop

pause

resume


add (player) A player is an object that respods to stop, play, pause, resume

remove(player)

action_ (playFunc, stopFunc, pauseFunc, resumeFunc)

Adds an ActionPlayer which responds to play, stop, pause, and resume by evaluating 

the corresponding function with the Conductor as currentEnvironment.

task_ (function, clock, quant)

Adds a TaskPlayer which plays the function within a task scheduled by the specified clock 

and quantization. (On stop, tasks that block on a message port are also be deleted.)

pattern_ (pattern, clock, event, quant)

Adds a PatternPlayer which plays the pattern with the specified event, clock and quantization.

group_ ( event, args)

The event is assigned CVEvent-groupEvent as its parent.

synth_ ( event, args)

The event is assigned CVEvent-synthEvent as its parent.

The argument args is an interleaved array of keys and CVs (or value). 

CVs can also be altered  before being sent to the server and combinations of CVs can

determine the value to be sent:

value  [freq: 440  ]

CV [freq: aCV  ]

altered CV [freq: [ aCV, aCV.midicps ] ]

combination [freq: [ [aCV, bCV], aCV.midicps + bCV] ]

function [freq: [ aCV, { aCV.midicps.value + 33.rand }]


The events use the same keys as note events in patterns. The keys server, group, and 

addAction and, for synths, instrument determine the group or synth. As in patterns, the

default values for these keys are 

server: Server.default, 

group: 1,

addAction: 0, 

instrument: 'default' 


Usually the node ID of the group or synth is dynamically allocated, but the key id can be set 

to set the id directly.  For group events, a new group  or collection of groups is created with the

specified id(s).  For synth events, no synths are created, but the control values determined by 

the event are sent to the specified id(s).

controlBus_ ( event, cvs)

The event can specify

server: aServer (defaults to Server.default)

index: (optional)

CVs is an array of CVs that are used to determine the value of consecutive buses

buffer_ ( event)

This event is designed primarily for small waveform buffers, it specifies:

server: aServer (defaults to Server.default)

cv: a CV that determines the values in the buffer

msg: A symbol that determines how the values are used to fill the buffer.

Is is one of: \sine1, \cheby, \wave, or \signa

display: anotherCV

An optional CV used to display the contents of the buffer (as received from the server) size: integer (defaults to 512 and should not exceed 1024).

makeBundles (function)

This is called by play,stop, pause and resume to bundle all of OSC commands sent to

any of the Servers listed in the instance variable server.


draw (window, name)

Draws the ConductorPlayer in a ConductorGUI.