BusPlug:
Filter:
Classes | JITLib > NodeProxy | Live Coding

BusPlug : AbstractFunction : Object

a listener on a bus
Source: BusPlug.sc
Subclasses: NodeProxy

Description

A BusPlug is represents a listener on a private Bus that makes it easy to play back to multiple channels. It is mainly in use as a superclass of NodeProxy, but it can be used for general channel routings as well. Most methods are documented in the NodeProxy helpfile.

Class Methods

BusPlug.new(server)

Create a new (neutral) instance on the given server

BusPlug.for(bus)

Create an instance with a given Bus.

BusPlug.audio(server, numChannels)

Create a new audio rate instance on the given server

BusPlug.control(server, numChannels)

Create a new audio rate instance on the given server

BusPlug.defaultNumAudio

BusPlug.defaultNumAudio = value

Default number of channels when initializing in audio rate and no specific number is given (default: 2).

BusPlug.defaultNumControl

BusPlug.defaultNumControl = value

Default number of channels when initializing in control rate and no specific number is given (default: 1).

BusPlug.defaultReshaping

BusPlug.defaultReshaping = value

default reshaping behaviour for BusPlug and its sublass NodeProxy. See: -reshaping

Inherited class methods

Instance Methods

.server

Return the server that the BusPlug runs on.

.clear

Free the bus, end the monitor

Making copies

.copy

copies the hidden internal state to make the new BusPlug independent of the old, running on a new Bus. By design, the Monitor is copied, but is not running (use play to start it in the same configuration). If needed, you can also copy the Monitor only (see: NodeProxy: -copy).

.copyState(proxy)

Copy the internal settings of one proxy into another. Old state is cleared, the bus is freed.

Arguments:

proxy

The object whose internal state is being copied.

.reshaping

.reshaping = value

Determines how to behave when -initBus is called. Current options:

In UGen graphs and Patterns

.ar(numChannels, offset: 0, clip: 'wrap')

.kr(numChannels, offset: 0, clip: 'wrap')

Return a link to numChannels of my output. If uninitialized, creates a matching bus. Normally, ar defaults to stereo, kr to mono. This can be set in the classvars: *defaultNumAudio, *defaultNumControl

For consistency, it always returns an array of signals when no numChannels are given. To make it a single ugen output, use cumChannels = 1 . See also: InBus.

Arguments:

numChannels

Number of channels returned. If the receiver is neutral or reshaping is elastic, initialize it to this number. If this is more than the available channels, use the clip behaviour (below). If set to 1, it will return an instance of InBus, otherwise an Array of one or more instances of InBus.

offset

Channel offset when reading a bus that has more channels than numChannels, cross fading between adjacent channels.

clip

If set to 'wrap', exceeding channels will wrap around, if set to 'clip', repeat the last one.

.asUGenInput

Returns the appropriate output to read from the BusPlug bus (an InBus UGen)

.embedInStream(inval)

Returns the map argument for the bus, if the bus has multiple channels, it will return an array of map args.

.asControlInput

Returns the map argument for the bus, just like -embedInStream

Monitoring and Routing

.isPlaying

Returns true if server is running and bus not nil. NodeProxy this returns true if the group is playing.

.isMonitoring

Returns true if monitor is playing

.play(out, numChannels, group, multi: false, vol, fadeTime, addAction)

Play from a bus index with a number of channels to another index with a number of channels, within a Group (i.e. a target group or server).

Arguments:

out

bus index

numChannels

number of channels to output. If BusPlug is neutral or reshaping is elastic, initialize it to this number. If this is more than the available channels, wrap around. If this is not given, and reshaping is elastic, it will automatically expand.

group

target Group or Server in which to play the monitor synths.

multi

keep old playback links and add new one

vol

overall volume at which to monitor

fadeTime

fade in / fade out time

addAction

Where in the node tree to play the monitor synths

.playN(outs, amps, ins, vol, fadeTime, group, addAction)

Play back on non-contiguous channels. See: Monitor and playN

Arguments:

outs

array of destination channels (or single value)

amps

array of amplitudes for each channel (or single value)

ins

array of source channel offsets within the bus (or single value)

vol

Overall volume (multiplied by amps)

fadeTime

array of fadeTimes (or single value) for fade in / fade out

group

target Group or Server in which to play the monitor synths.

addAction

Where in the node tree to play the monitor synths

.stop(fadeTime, reset: false)

stop to play out public channels.

Arguments:

fadeTime

decay time for this action

reset

if set to true, reset all monitor state. Otherwise, the previous play arguments are kept.

.monitor

.monitor = value

returns the current monitor (see Monitor)

Bus changes

These methods are a little numerous, because they are important for implementing NodeProxy behavior. Mostly the methods -bus and -initBus will be sufficient in normal use.

NOTE: The old bus is freed when a new bus is made.

.isNeutral

Returns true if no bus has been initialized so far.

.bus

.bus = inBus

Set or get the bus. If BusPlug monitor is playing, restart the monitor to adequately play back the new bus.

.setBus(inBus)

set the bus object by passing a Bus.

NOTE: you have to stop and play explicitly

.defineBus(rate: 'audio', numChannels)

make a new bus for the BusPlug with a given rate and number of channels.

.initBus(rate, numChannels)

Make a new bus only if necessary. This depends on the current bus and the -reshaping mode.

Returns:

Boolean (true if successful).

Inherited instance methods

Undocumented instance methods

.asBus

.asMap

.asNodeArg

.asOSCArgEmbeddedArray(array)

From extension in /usr/local/share/SuperCollider/SCClassLibrary/JITLib/ProxySpace/NodeMap.sc

.asStream

.busArg

.composeBinaryOp(aSelector, something)

.composeNAryOp(aSelector, anArgList)

.composeUnaryOp(aSelector)

.fadeTime

.fixedBus

.freeBus

.homeServer

.index

.initMonitor(vol)

.monitorGroup

.monitorIndex

.nodeMapMapsToControl

From extension in /usr/local/share/SuperCollider/SCClassLibrary/JITLib/ProxySpace/wrapForNodeProxy.sc

.numChannels

.parentGroup

.parentGroup = value

.plot(duration: 0.01, bounds, minval, maxval, separately: false)

.prepareOutput

.quant

.rate

.reverseComposeBinaryOp(aSelector, something)

.scope(bufsize: 4096, zoom)

.serverQuit

.shared

.value(something)

.vol

.vol = val

.wakeUp

Examples