vivid-supercollider-0.4.1.2: Implementation of SuperCollider server specifications

Safe HaskellNone
LanguageHaskell2010

Vivid.SC.Server.Commands

Contents

Synopsis

Documentation

quit :: OSC Source #

subsection:: /quit

Quit program. Exits the synthesis server.

definitionlist:: ## Asynchronous. || Replies to sender with strong::/done:: just before completion. ::

data DumpOSCMode Source #

subsection:: /dumpOSC Display incoming OSC messages. table:: ## strong::int:: || code :: Turns on and off printing of the contents of incoming Open Sound Control messages. This is useful when debugging your command stream.

sync :: SyncId -> OSC Source #

subsection:: /sync Notify when async commands have completed. table:: ## strong::int:: || a unique number identifying this command. :: Replies with a strong::/synced:: message when all asynchronous commands received before this one have completed. The reply will contain the sent unique ID.

definitionlist:: ## Asynchronous. || Replies to sender with strong:: /synced, ID :: when complete. ::

clearSched :: OSC Source #

subsection:: /clearSched

Clear all scheduled bundles. Removes all bundles from the scheduling queue.

d_recv :: [LiteralSynthDef] -> Maybe OSC -> OSC Source #

subsection:: /d_recv Receive a synth definition file. table:: ## strong::bytes:: || buffer of data. ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Loads a file of synth definitions from a buffer in the message. Resident definitions with the same names are overwritten.

definitionlist:: ## Asynchronous. || Replies to sender with strong::/done:: when complete. ::

Send Synth Definitions to the server.

The second argument is an optional message to execute on completion.

d_load :: FilePath -> Maybe OSC -> OSC Source #

subsection:: /d_load Load synth definition. table:: ## strong::string:: || pathname of file. Can be a pattern like code:: "synthdefs/perc-*" :: ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Loads a file of synth definitions. Resident definitions with the same names are overwritten.

definitionlist:: ## Asynchronous. || Replies to sender with strong::/done:: when complete. ::

d_loadDir :: FilePath -> Maybe OSC -> OSC Source #

subsection:: /d_loadDir Load a directory of synth definitions. table:: ## strong::string:: || pathname of directory. ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Loads a directory of synth definitions files. Resident definitions with the same names are overwritten.

definitionlist:: ## Asynchronous. || Replies to sender with strong::/done:: when complete. ::

n_free :: NodeId -> OSC Source #

subsection:: /n_free Delete a node. table:: ## N * strong::int:: || node ID ::

Stops a node abruptly, removes it from its group, and frees its memory. A list of node IDs may be specified. Using this method can cause a click if the node is not silent at the time it is freed.

n_run :: NodeId -> Bool -> OSC Source #

subsection:: /n_run Turn node on or off. table:: ## N * || table:: ## strong::int:: || node ID ## strong::int:: || run flag :: :: list:: ## If the run flag set to zero then the node will not be executed. ## If the run flag is set back to one, then it will be executed. :: Using this method to start and stop nodes can cause a click if the node is not silent at the time run flag is toggled.

n_set :: NodeId -> [(String, Either Int32 Float)] -> OSC Source #

subsection:: /n_set Set a node's control value(s). table:: ## strong::int:: || node ID ## N * || table:: ## strong::int:: or strong::string:: || a control index or name ## strong::float:: or strong::int:: || a control value :: ::

Takes a list of pairs of control indices and values and sets the controls to those values. If the node is a group, then it sets the controls of every node in the group.

This message now supports array type tags ($[ and $]) in the control/value component of the OSC message. Arrayed control values are applied in the manner of n_setn (i.e., sequentially starting at the indexed or named control).

addActionInt :: Integral i => AddAction -> i Source #

section:: Synth Commands

subsection:: /s_new Create a new synth. table:: ## strong::string:: || synth definition name ## strong::int:: || synth ID ## strong::int:: || add action (0,1,2, 3 or 4 see below) ## strong::int:: || add target ID ## N * || table:: ## strong::int:: or strong::string:: || a control index or name ## strong::float:: or strong::int:: or strong::string::|| floating point and integer arguments are interpreted as control value. a symbol argument consisting of the letter c or a (for control or audio) followed by the bus's index. :: ::

Create a new synth from a synth definition, give it an ID, and add it to the tree of nodes. There are four ways to add the node to the tree as determined by the add action argument which is defined as follows: definitionlist:: ## add actions: || table:: ## 0 || add the new node to the the head of the group specified by the add target ID. ## 1 || add the new node to the the tail of the group specified by the add target ID. ## 2 || add the new node just before the node specified by the add target ID. ## 3 || add the new node just after the node specified by the add target ID. ## 4 || the new node replaces the node specified by the add target ID. The target node is freed. :: ::

g_new :: NodeId -> AddAction -> NodeId -> OSC Source #

section:: Group Commands

subsection:: /g_new Create a new group. table:: ## N * || table:: ## strong::int:: || new group ID ## strong::int:: || add action (0,1,2, 3 or 4 see below) ## strong::int:: || add target ID :: ::

Create a new group and add it to the tree of nodes. There are four ways to add the group to the tree as determined by the add action argument which is defined as follows (the same as for strong::/s_new::): definitionlist:: ## add actions: || table:: ## 0 || add the new group to the the head of the group specified by the add target ID. ## 1 || add the new group to the the tail of the group specified by the add target ID. ## 2 || add the new group just before the node specified by the add target ID. ## 3 || add the new group just after the node specified by the add target ID. ## 4 || the new node replaces the node specified by the add target ID. The target node is freed. :: :: Multiple groups may be created in one command by adding arguments.

p_new :: NodeId -> AddAction -> NodeId -> OSC Source #

subsection:: /p_new Create a new parallel group. table:: ## N * || table:: ## strong::int:: || new group ID ## strong::int:: || add action (0,1,2, 3 or 4 see below) ## strong::int:: || add target ID :: :: Create a new parallel group and add it to the tree of nodes. Parallel groups are relaxed groups, their child nodes are evaluated in unspecified order. There are four ways to add the group to the tree as determined by the add action argument which is defined as follows (the same as for strong::/s_new::): definitionlist:: ## add actions: || table:: ## 0 || add the new group to the the head of the group specified by the add target ID. ## 1 || add the new group to the the tail of the group specified by the add target ID. ## 2 || add the new group just before the node specified by the add target ID. ## 3 || add the new group just after the node specified by the add target ID. ## 4 || the new node replaces the node specified by the add target ID. The target node is freed. :: :: Multiple groups may be created in one command by adding arguments.

g_freeAll :: [NodeId] -> OSC Source #

subsection:: /g_freeAll Delete all nodes in a group. table:: ## N * strong::int:: || group ID(s) :: Frees all nodes in the group. A list of groups may be specified.

Buffer commands

b_alloc :: BufferId -> Int32 -> Int32 -> Maybe OSC -> OSC Source #

section:: Buffer Commands

Buffers are stored in a global array, indexed by integers starting at zero.

subsection:: /b_alloc Allocate buffer space. table:: ## strong::int:: || buffer number ## strong::int:: || number of frames ## strong::int:: || number of channels (optional. default = 1 channel) ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Allocates zero filled buffer to number of channels and samples. definitionlist:: ## Asynchronous. || Replies to sender with strong::done b_alloc bufNum:: when complete. ::

Second and third arguments are number of frames and number of channels, respectively

b_allocRead :: BufferId -> FilePath -> Int32 -> Maybe Int32 -> Maybe OSC -> OSC Source #

subsection:: /b_allocRead Allocate buffer space and read a sound file. table:: ## strong::int:: || buffer number ## strong::string:: || path name of a sound file. ## strong::int:: || starting frame in file (optional. default = 0) ## strong::int:: || number of frames to read (optional. default = 0, see below) ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Allocates buffer to number of channels of file and number of samples requested, or fewer if sound file is smaller than requested. Reads sound file data from the given starting frame in the file. If the number of frames argument is less than or equal to zero, the entire file is read. definitionlist:: ## Asynchronous. || Replies to sender with strong::done b_allocRead bufNum:: when complete. ::

The first Int32 is the starting frame to read (often this is zero); the second is an optional number of frames to read (Nothing means the rest of the file is read)

b_zero :: BufferId -> Maybe OSC -> OSC Source #

subsection:: /b_zero Zero sample data. table:: ## strong::int:: || buffer number ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Sets all samples in the buffer to zero. definitionlist:: ## Asynchronous. || Replies to sender with strong::done b_zero bufNum:: when complete. ::

b_free :: BufferId -> Maybe OSC -> OSC Source #

subsection:: /b_free Free buffer data. table:: ## strong::int:: || buffer number ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: Frees buffer space allocated for this buffer. definitionlist:: ## Asynchronous. || Replies to sender with strong::done b_free bufNum:: when complete. ::

b_close :: BufferId -> Maybe OSC -> OSC Source #

subsection:: /b_close Close soundfile. table:: ## strong::int:: || buffer number ## strong::bytes:: || an OSC message to execute upon completion. (optional) :: After using a buffer with link::Classes/DiskOut::, close the soundfile and write header information. definitionlist:: ## Asynchronous. || Replies to sender with strong::done b_close bufNum:: when complete. ::

b_query :: [BufferId] -> OSC Source #

subsection:: /b_query Get buffer info. table:: ## N * strong::int:: || buffer number(s) ::

Responds to the sender with a strong::b_info:: message. The arguments to b_info are as follows: table:: ## N * || table:: ## strong::int:: || buffer number ## strong::int:: || number of frames ## strong::int:: || number of channels ## strong::float:: || sample rate :: ::

Since: vivid-0.4.1

b_write :: BufferId -> FilePath -> String -> String -> Maybe Int32 -> Int32 -> Bool -> Maybe OSC -> OSC Source #

subsection:: /b_write Write sound file data. table:: ## strong::int:: || buffer number ## strong::string:: || path name of a sound file. ## strong::string:: || header format. ## strong::string:: || sample format. ## strong::int:: || number of frames to write (optional. default = -1, see below) ## strong::int:: || starting frame in buffer (optional. default = 0) ## strong::int:: || leave file open (optional. default = 0) ## strong::bytes:: || an OSC message to execute upon completion. (optional) ::

Write a buffer as a sound file. definitionlist:: ## Header format is one of: || "aiff", "next", "wav", "ircam"", "raw" ## Sample format is one of: || "int8", "int16", "int24", "int32", "float", "double", "mulaw", "alaw" :: Not all combinations of header format and sample format are possible. If number of frames is less than zero, all samples from the starting frame to the end of the buffer are written. If opening a file to be used by DiskOut ugen then you will want to set "leave file open" to one, otherwise set it to zero. If "leave file open" is set to one then the file is created, but no frames are written until the DiskOut ugen does so. definitionlist:: ## Asynchronous. || Replies to sender with strong::done b_write bufNum:: when complete. ::

First String is header format (e.g. "wav"), second String is sample format (e.g. "float"). The (Maybe Int32) is number of frames to write (Nothing writes to the end of the buffer), the Int32 that follows it is the start frame (which is often zero). The Bool is whether to leave the file open.

More details (e.g. the available header and sample formats) are available in the SuperCollider docs.