CtkScore:
Filter:
Ctk/Classes (extension) | Libraries > CTK

CtkScore
ExtensionExtension

Score of OSC commands for non-real-time rendering, used with CTK objects
 

Description

Part of the Composer's Tool Kit (CTK) system. See Ctk for more details.

CtkScore enables rendering Scores with CTK objects. Examples below show how to populate an instance of CtkScore. The CtkScore can then be rendered in non-real-time (NRT), played or saved as a file. See also Non-Realtime Synthesis (NRT).

Class Methods

.new

Crete new instance of a CtkScore. Any number of initial events may be passed in at creation time.

Arguments:

... events

Events are instances of CtkNote, CtkGroup, CtkBuffer, CtkEvent, CtkControl or another CtkScore.

Instance Methods

.add

Add events to the score. Any number of events may be added.

Arguments:

... events

Events are instances of CtkNote, CtkGroup, CtkBuffer, CtkEvent, CtkControl or another CtkScore.

.write

Renders the CtkScore in non-real-time (NRT) mode

Arguments:

path

The output file path.

duration

The duration of the score. This defaults to 'nil' which will render the entire CtkScore.

sampleRate

The sample rate of the output file.

headerFormat

See SoundFile: -headerFormat

sampleFormat

See SoundFile: -sampleFormat

options

An instance of ServerOptions. This is useful e.g. for specifying number of channels in the output file: ServerOptions.new.numOutputBusChannels_(2)

action

A function to be evaluated once the NRT server has finished rendering its score.

inputFilePath

An optional path for an input soundfile.

oscFilePath

An optional path to which the binary OSC file will be written.

.play

Plays this instance of CtkScore in real-time (RT) on the server.

NOTE: When CtkScore.play is called, the CtkScore is rendered fully before performance starts which may cause a delay. Events that are instances of CtkBuffer are also allocated to the Server before performance starts to ensure they are ready for use. This, too, may cause a delay.

Arguments:

server

The sever on which to play the score.

clock

An optional clock and quant to be used as a tempo base.

quant
startPoint
endPoint

.score

Returns:

the Score that is created as part of CtkScore.

.copy

Make a copy of this score

Returns:

a copy of this score

.offset

Set an offset for this score, useful whem mergin multiple scores

Arguments:

duration

Offset in seconds

.saveToFile

Saves the Score associated with this instance of CtkScore.

Arguments:

path

'path' to save to

.items

Returns:

An array of all events in the CtkScore.

Examples