UChain:
Filter:
Unit-Lib/Classes (extension) | UnitLib

UChain
ExtensionExtension

a group of U units

Description

A Uchain represents a groups of units (U) that together make up one audio chain where the audio output of one unit can be routed to subsequent units.The routing is done using private busses and the units are played together in one Group. Units in this context can be thought of as effects or plugins in a DAW, although almost the full flexibility of SuperCollider is still available. To get input from and output to other units in the chain the UIn and UOut pseudo-ugens are used. These ugens create automatic names for controls that allow changing the private bus number. This then allows easy re-patching of the units from a gui.

There should be only one chain playing per Server at a time, although it is not impossible to play multiple instancesof at once.

Event

UChain implements the UEvent interface, therefore it has a startTime, track, duration, muted, releaseSelf variables.

The startTime determines when the UChain will start playing in a score, and the duration when it will stop. If the releaseSelf variable is set to True, then UChain will release itself using the doneAction of the envelope of one of the units (It is assumed that one of the units has the capability to free the UChain). If releaseSelf is False, then it will be the task that is playing the score that will free the UChain when it has finished playing. The difference between the two mode is that, if releaseSelf is true, when the score is paused, the chain will continue to play and will be freed, unaffected by the fact that the score is paused, on the other hand if it is false, then while the score is paused the chain will also not be freeed, and will only resume couting the time until the end of the envelope when the score is unpaused.

GUI

There is a GUI for the UChain class, implemented by UChainGUI which can be invoked using the UChain: -gui method. Most parameters of the UChain can be set from the gui:

Class Methods

.verbose

post debugging messages

.groupDict

Returns the groupDict of type Event[UChain,Array[Group]]. The keys are instances of UChain and the values the corresponding Groups.

Returns:

Event[UChain,Array[Group]]

.new

Creates a new UChain from the arguments given.

Syntaxes for UChain creation:

Example of UChain instantiation:

Arguments:

... args

Returns:

UChain

Instance Methods

.units

Set the units of the UChain

Arguments:

newUnits

A collection of Us.

.muted

Determines if event will be played or not in a score.

Arguments:

bool

.name

Returns a string composed from the units held by the chain.

Returns:

String

.duplicate

Create a duplicate of the instance.

Returns:

UChain

.canFreeSynth

Returns a boolean indicating if the UChain contains a unit that can free the group due to it's doneAction.

Returns:

Boolean

.eventSustain

The time from the begging of the event until the moment when the chain should be released (to start the fade out).

Returns:

Float

.fadeOut

Set fade out time.

Arguments:

fadeOut

A Float bigger then zero.

.fadeIn

Set fade in time.

Arguments:

fadeIn

A Float bigger then zero.

.fadeTimes

Returns:

Array of type [fadeIn,fadeOut]

.useSndFileDur

(describe method here)

Returns:

(returnvalue)

.getMaxDurUnit

(describe method here)

Returns:

(returnvalue)

.duration

(describe method here)

Arguments:

dur

(describe argument here)

Returns:

(returnvalue)

.releaseSelf

(describe method here)

Arguments:

bool

(describe argument here)

Returns:

(returnvalue)

.dur

(describe method here)

Arguments:

x

(describe argument here)

Returns:

(returnvalue)

.gain

(describe method here)

Arguments:

gain

(describe argument here)

Returns:

(returnvalue)

.mute

(describe method here)

Returns:

(returnvalue)

.unmute

(describe method here)

Returns:

(returnvalue)

.setGain

(describe method here)

Arguments:

gain

(describe argument here)

Returns:

(returnvalue)

.getGain

(describe method here)

Returns:

(returnvalue)

.setDoneAction

(describe method here)

Returns:

(returnvalue)

.trimEnd

(describe method here)

Arguments:

newEnd

(describe argument here)

removeFade

(describe argument here)

Returns:

(returnvalue)

.cutEnd

(describe method here)

Arguments:

newEnd

(describe argument here)

removeFade

(describe argument here)

Returns:

(returnvalue)

.trimStart

(describe method here)

Arguments:

newStart

(describe argument here)

removeFade

(describe argument here)

Returns:

(returnvalue)

.cutStart

(describe method here)

Arguments:

newStart

(describe argument here)

belongsToFolder

(describe argument here)

removeFade

(describe argument here)

Returns:

(returnvalue)

.groups

(describe method here)

Arguments:

groups

(describe argument here)

Returns:

(returnvalue)

.addGroup

(describe method here)

Arguments:

group

(describe argument here)

Returns:

(returnvalue)

.removeGroup

(describe method here)

Arguments:

group

(describe argument here)

Returns:

(returnvalue)

.makeGroupAndSynth

(describe method here)

Arguments:

target

(describe argument here)

startPos

(describe argument here)

Returns:

(returnvalue)

.makeBundle

(describe method here)

Arguments:

targets

(describe argument here)

startPos

(describe argument here)

Returns:

(returnvalue)

.start

(describe method here)

Arguments:

target

(describe argument here)

startPos

(describe argument here)

latency

(describe argument here)

Returns:

(returnvalue)

.free

free synths

.stop

free synths

.release

free synths by releasing the envelope in the duration give by the argument.

Arguments:

time

.shouldPlayOn

(describe method here)

Arguments:

target

(describe argument here)

Returns:

(returnvalue)

.apxCPU

(describe method here)

Arguments:

target

(describe argument here)

Returns:

(returnvalue)

.prepare

Prepare units.

Arguments:

target

A collection of targets.

startPos

Offset in seconds from the start of the event.

action

Action to perform when preparation is done.

.prepareAndStart

Prepare and start UChain.

Arguments:

target

A collection of targets.

startPos

Offset in seconds from the start of the event.

.waitTime

Time in seconds needed to prepare this UChain.

.prepareWaitAndStart

Start preparation, then wait during waitTime seconds, and finally start the UChain.

Arguments:

target

A collection of targets.

startPos

Offset in seconds from the start of the event.

.dispose

Calls .dispose on each unit. This will dispose of Buffers or other resources opened.

.at

Array support for accessing units.

.last

Array support for accessing units.

.first

Array support for accessing units.

.add

Add unit to chian. Unit is added in after other units.

.addAll

Add all units in collection to UChain.

Arguments:

inUnits

Collection with units.

.put

Place unit at index.

Arguments:

index

Int

unit

U

.insert

Insert unit at index.

Arguments:

index

Int

unit

U

.removeAt

Remove unit at index.

Arguments:

index

Int

<<

Returns new UChain with the units from 'uchain' added to this UChain.

Arguments:

uchain

UChain

Returns:

<|

Returns new UChain containing all the units of this UChain plus the unit passed in the argument.

Arguments:

unit

U

Returns:

.isFolder

Determine whether this object is a score.

Returns:

False

.getAllUChains

Returns this. This method is used to recursivly get all the UChains in a UScore.

Returns:

.gui

Create a GUI.

Arguments:

parent

A view

bounds

A Rect

Returns:

Examples