AbstractPlayer:
Filter:
Classes (extension) | Libraries > crucial > Players

AbstractPlayer : AbstractFunction : Object
ExtensionExtension

the base class for all Players : a playable object

Description

Players are things that can play. The AbstractPlayer interface encapsulates each of the steps to load an object, get its resources onto the server (eg. loading buffers, populating lookup tables) , to play at precise times, stop and free its resources when finished.

Players may have one synth or many or even none. They may hold groups, busses and buffers in its instance variables.

Players have an output spec and some of them have inputs and input specs.

If they have editable parameters then the framework supports saving and loading of the player object in compile string document format.

Class Methods

AbstractPlayer.bundleClass

AbstractPlayer.bundleClass = value

AbstractPlayer.bundle(server, atTime, buildFunction)

Arguments:

server
atTime

see atTime

buildFunction

AbstractPlayer.ar( ... args)

Arguments:

... args

AbstractPlayer.kr( ... args)

Arguments:

... args

AbstractPlayer.annotate(thing, note)

Arguments:

thing
note

AbstractPlayer.getAnnotation(thing)

Arguments:

thing

AbstractPlayer.removeAnnotation(thing)

Arguments:

thing

AbstractPlayer.initClass

AbstractPlayer.load(obj, warnIfNotFound: true)

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc

Arguments:

obj
warnIfNotFound

AbstractPlayer.enpath(obj)

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc

Arguments:

obj

Inherited class methods

Instance Methods

.path

.path = p

if loaded or saved, the player knows its path

Arguments:

p

.synth

.group

.group = g

Arguments:

g

.server

.patchOut

.status

.play(group, atTime, bus)

boots the server, prepares the player for play (loading resources like samples etc.) and spawns the player

all args are optional

Arguments:

group

a Server (will use the root node) a Group nil (default server's root node)

atTime

see atTime

bus

bus - (Bus,Integer,Nil) a specific Bus to play on, otherwise will default to the main audio outs

.prPlay(atTime, bus, timeOfRequest)

Arguments:

atTime

see atTime

bus
timeOfRequest

.prSetStatus(newStatus)

Arguments:

newStatus

.isPrepared

.readyForPlay

.prepareForPlay(group, private: false, bus)

this loads the synthDef to the server for the player and all of its children, and allocates any resources such as buffers, loading sound files etc.

Arguments:

group

group - a Server, a Group or Nil

private

isPrivate: a public bus is one of the main audio outputs of your soundcard. a private bus is one that will be patched and mixed further down the line. When makePatchOut is called on the top player (the one that actually was sent .play) it plays to a public (main audio output), and any internal children are told to allocate and play onto a private bus.

bus

bus - a specific Bus to play on. this will cause isPrivate to be ignored

.prepareToBundle(agroup, bundle, private: false, bus)

Arguments:

agroup
bundle
private
bus

.makeResourcesToBundle

.prepareChildrenToBundle(bundle)

Arguments:

bundle

.loadDefFileToBundle(bundle, server)

Arguments:

bundle
server

.defaultAtTime

.loadBuffersToBundle

.makePatchOut(agroup, private: false, bus, bundle)

Arguments:

agroup
private
bus
bundle

.topMakePatchOut(agroup, private: false, bus)

Arguments:

agroup
private
bus

.setPatchOut(po)

Arguments:

po

.spawn(atTime, timeOfRequest)

assumes the player has been prepared. see prepareForPlay

Arguments:

atTime

see atTime

timeOfRequest

.spawnOn(group, bus, atTime, timeOfRequest)

Arguments:

group
bus
atTime

see atTime

timeOfRequest

.spawnToBundle(bundle, selector: 'addToTailMsg')

Arguments:

bundle
selector

.spawnOnToBundle(agroup, bus, bundle)

Arguments:

agroup
bus
bundle

.didSpawn

.isPlaying

.cmdPeriod

.onPlay(func, timeout, listener, oneShot: true, throwErrorOnTimeout)

Arguments:

func
timeout
listener
oneShot
throwErrorOnTimeout

.onStop(func, timeout, listener, oneShot: true, throwErrorOnTimeout)

Arguments:

func
timeout
listener
oneShot
throwErrorOnTimeout

.onReady(func, timeout, listener, oneShot: true, throwErrorOnTimeout)

Arguments:

func
timeout
listener
oneShot
throwErrorOnTimeout

.freeOnStop

.prOn(status, func, timeout, listener, oneShot: true, throwErrorOnTimeout)

Arguments:

status
func
timeout
listener
oneShot
throwErrorOnTimeout

.stop(atTime)

stops playing but does not deallocate any resources (buffers etc.) You need to .free to deallocate it

Arguments:

atTime

see atTime

.stopToBundle(bundle)

Arguments:

bundle

.didStop

.release(releaseTime, atTime)

call release on the synth, with the releaseTime then calls stop on the player, so even if the synthDef does not have a \gate input, it will function the same as stop after a short delay.

Arguments:

releaseTime
atTime

.releaseToBundle(releaseTime, bundle)

Arguments:

releaseTime
bundle

.free(atTime)

frees all allocated resources (buffers etc.) if it is playing then it also stops it

Arguments:

atTime

see atTime

.freeToBundle(bundle)

Arguments:

bundle

.freeResourcesToBundle

.didFree

.freeSynthToBundle(bundle)

Arguments:

bundle

.freePatchOutToBundle(bundle)

Arguments:

bundle

.record(path, endBeat, onComplete, recHeaderFormat, recSampleFormat, atTime)

Arguments:

path
endBeat
onComplete
recHeaderFormat
recSampleFormat
atTime

see atTime

.busIndex

.bus

.bus = b

Arguments:

b

.asSynthDef

.writeDefFile(dir)

Arguments:

dir

.synthDefArgs

.defName

.rate

.numChannels

.spec

.addToSynthDef(synthDef, name)

Arguments:

synthDef
name

.synthArg

.instrArgFromControl(control)

Arguments:

control

.ar

.kr

.value

.valueArray

.plot(duration: 5.0, bounds)

Arguments:

duration
bounds

.connectTo(hasInput)

Arguments:

hasInput

.connectToInputAt(player, inputIndex: 0)

Arguments:

player
inputIndex

.connectToPatchIn(patchIn, needsValueSetNow: true)

Arguments:

patchIn
needsValueSetNow

.disconnect

.children

for players that hold other players or objects, return those children player classes should implement where appropriate. a Patch has its args as children SFP has its underlying object as child

using this.children.do({arg item; .... }) can save you from having to muck up the Player class with extra methods.

.deepDo(function)

do to allChildren

Arguments:

function

.allChildren

and all your children's children, and their children...

.composeUnaryOp(operator)

Arguments:

operator

.composeBinaryOp(operator, pattern)

Arguments:

operator
pattern

.reverseComposeBinaryOp(operator, pattern)

Arguments:

operator
pattern

.beatDuration

.timeDuration

.embedInStream(inval)

Arguments:

inval

.delta

.name

.name = value

if loaded or saved then the name is the filename, else its the normal asString for an object (eg. "a Patch")

.asString

.save(apath)

Arguments:

apath

.didSaveAs(apath)

Arguments:

apath

.asCompileString

.storeParamsOn(stream)

Arguments:

stream

.simplifyStoreArgs(args)

Arguments:

args

.annotate(thing, note)

Arguments:

thing
note

.changed(what ... moreArgs)

Arguments:

what
... moreArgs

.copy

.guiClass

.addToDefName

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Instr/instrSupport.sc

.proxyControlClass

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/JITLibCrucialWrappers/wrapCXForNodeProxy.sc

.wrapInFader(bus)

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/JITLibCrucialWrappers/wrapCXForNodeProxy.sc

Arguments:

bus

.releaseAndFreeToBundle(releaseTime: 0.0, bundle)

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/JITLibCrucialWrappers/wrapCXForNodeProxy.sc

Arguments:

releaseTime
bundle

.enpath

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc

.loadDocument

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc

.didLoadFromPath(argpath)

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc

Arguments:

argpath

.load(obj, warnIfNotFound: true)

From extension in /home/stefan/.local/share/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc

Arguments:

obj
warnIfNotFound

.busReport: METHOD NOT FOUND!

Arguments:

f
slogan

.asKAsset: METHOD NOT FOUND!

.swapperApp: METHOD NOT FOUND!

Arguments:

sb

.wigglyness: METHOD NOT FOUND!

Inherited instance methods

Undocumented instance methods

.setGroupToBundle(g, b)

.subGroups