Score:
Filter:
Classes | Control | Server > NRT | External Control > OSC

Score : Object

score of timed OSC commands
Source: Score.sc

Description

Score encapsulates a list of timed OSC commands and provides some methods for using it, as well as support for the creation of binary OSC files for non-realtime synthesis. See Non-Realtime Synthesis (NRT) for more details.

The list should be in the following format, with times in ascending order. Bundles are okay.

For NRT synthesis the final event should a dummy event, after which synthesis will cease. It is thus important that this event be timed to allow previous events to complete.

Score scheduling defaults to TempoClock. A setting of TempoClock.default.tempo = 1 (60 beats per minute), may be used to express score events in seconds if desired.

Class Methods

Score.new(list)

returns a new Score object with the supplied list.

Arguments:

list

can be an Array, a List, or similar object.

Score.newFromFile(path)

as *new, but reads the list in from a text file.

Arguments:

path

a String indicating the path of the file. The file must contain a valid SC expression.

Score.play(list, server)

as *new but immediately plays it. (See also the instance method below.)

Arguments:

list

the list.

server

If no value is supplied it will play on the default Server.

Score.playFromFile(path, server)

as *play, but reads the list from a file.

Score.write(list, oscFilePath, clock)

a convenience method to create a binary OSC file for NRT synthesis. Does not create an instance.

Arguments:

list

the list.

oscFilePath

a String containing the desired path of the OSC file.

clock

Use clock as a tempo base. TempoClock.default is used if clock is nil.

Score.writeFromFile(path, oscFilePath, clock)

as *write but reads the list from a file.

Arguments:

path

a path to a file with a list.

oscFilePath

a String containing the desired path of the OSC file.

clock

Use clock as a tempo base. TempoClock.default is used if clock is nil.

Score.recordNRT(list, oscFilePath, outputFilePath, inputFilePath, sampleRate: 44100, headerFormat: "AIFF", sampleFormat: "int16", options, completionString: "", duration, action)

a convenience method to synthesize list in non-realtime. This method writes an OSC file to oscFilePath (you have to do your own cleanup if desired) and then starts a server app to synthesize it. For details on valid headerFormats and sampleFormats see SoundFile. Use TempoClock.default as a tempo base. Does not return an instance.

Arguments:

list

the list.

oscFilePath

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

outputFilePath

the path of the resultant soundfile.

inputFilePath

an optional path for an input soundfile.

sampleRate

the sample rate at which synthesis will occur.

headerFormat

the header format of the output file. The default is 'AIFF'.

sampleFormat

the sample format of the output file. The default is 'int16'.

options

an instance of ServerOptions. If not supplied the options of the default Server will be used.

completionString
duration
action

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

Inherited class methods

Undocumented class methods

Score.options

Score.options = value

Score.program

Score.program = value

Instance Methods

.play(server, clock, quant: 0.0)

play the list on server, use clock as a tempo base and quantize start time to quant. If server is nil, then on the default server. TempoClock.default if clock is nil. now if quant is 0.

.stop

stop playing.

.write(oscFilePath, clock)

create a binary OSC file for NRT synthesis from the list. Use clock as a tempo base. TempoClock.default if clock is nil.

.score

.score = value

get or set the list.

.add(bundle)

adds bundle to the list.

.sort

sort the score time order. This is recommended to do before recordNRT or write when you are not sure about the packet order.

.recordNRT(oscFilePath, outputFilePath, inputFilePath, sampleRate: 44100, headerFormat: "AIFF", sampleFormat: "int16", options, completionString: "", duration, action)

synthesize the score in non-realtime. For details of the arguments see *recordNRT above.

.saveToFile(path)

save the score list as a text file to path.

Inherited instance methods

Undocumented instance methods

.asScore

.endTime

.section(start: 0, end, configevents)

.startTime

.writeOSCFile(path, from, to, clock)

Examples

NRT Examples

From the command line, the file can then be rendered from within the build directory:

Score also provides methods to do all this more directly:

Real-time Examples

creating Score from a pattern