Ops

object Ops

Importing the contents of this object adds imperative (side-effect) functions to resources such as synths, buses, buffers. In general these reflect the OSC messages defined for each object, and send them straight to the server. For example, a Synth has function newMsg which returns an OSC message to instantiate the synth of the server. After importing Ops, you will be able to directly launch a synth using SynthDef.play or Synth.play. You will be able to directly allocate and read buffers, and so forth.

Importing the contents of this object adds imperative (side-effect) functions to resources such as synths, buses, buffers. In general these reflect the OSC messages defined for each object, and send them straight to the server. For example, a Synth has function newMsg which returns an OSC message to instantiate the synth of the server. After importing Ops, you will be able to directly launch a synth using SynthDef.play or Synth.play. You will be able to directly allocate and read buffers, and so forth.

The reason why these functions are separated from the rest of the API is to allow other frameworks such as SoundProcesses to avoid side-effects which they handle differently (e.g., using STM).

class Object
trait Matchable
class Any

Type members

Classlikes

final class BufferConstructors(this: Buffer) extends AnyVal
final class BufferOps(b: Buffer) extends AnyVal
final class ControlBusOps(b: ControlBus) extends AnyVal
final class EnvOps(env: Env) extends AnyVal
final class GroupConstructors(this: Group) extends AnyVal
final class GroupOps(g: Group) extends AnyVal
final class NodeOps(n: Node) extends AnyVal
final class ServerOps(s: Server) extends AnyVal
final class SynthConstructors(this: Synth) extends AnyVal
final class SynthDefConstructors(this: SynthDef) extends AnyVal
final class SynthDefOps(d: SynthDef) extends AnyVal
final class SynthOps(n: Synth) extends AnyVal

Value members

Concrete methods

def graph[A](thunk: => A)(result: Result[A]): GraphFunction[A]

Constructs a GraphFunction, on which then for example play can be called.

Constructs a GraphFunction, on which then for example play can be called.

def play[A](thunk: => A)(`evidence$1`: Result[A]): Synth

Wraps the body of the thunk argument in a SynthGraph, adds an output UGen, and plays the graph on the default group of the default server.

Wraps the body of the thunk argument in a SynthGraph, adds an output UGen, and plays the graph on the default group of the default server.

Value Params
thunk

the thunk which produces the UGens to play

Returns

a reference to the spawned Synth

def playWith[A](target: Node, out: Int, fadeTime: Double, addAction: AddAction)(thunk: => A)(result: Result[A]): Synth

Wraps the body of the thunk argument in a SynthGraph, adds an output UGen, and plays the graph in a synth attached to a given target.

Wraps the body of the thunk argument in a SynthGraph, adds an output UGen, and plays the graph in a synth attached to a given target.

Value Params
addAction

the relation between the new synth and the target

fadeTime

if >= 0, specifies the fade-in time for a synthetically added amplitude envelope. if negative, avoids building an envelope.

out

audio bus index which is used for the synthetically generated Out UGen.

target

the target with respect to which to place the synth

thunk

the thunk which produces the UGens to play

Returns

a reference to the spawned Synth

Implicits

Implicits

implicit def groupOps[G](g: G)(view: G => Group): GroupOps

This allows conversions to Group so that something like Server.default.freeAll becomes possible.

This allows conversions to Group so that something like Server.default.freeAll becomes possible.

implicit def stringToControl(name: String): ControlProxyFactory

Allows the construction or named controls, for example via "freq".kr.

Allows the construction or named controls, for example via "freq".kr.