SuperCollider programming language
Encyclopedia
SuperCollider is an environment and programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 originally released in 1996 by James McCartney for real-time
Real-time operating system
A real-time operating system is an operating system intended to serve real-time application requests.A key characteristic of a RTOS is the level of its consistency concerning the amount of time it takes to accept and complete an application's task; the variability is jitter...

 audio synthesis and algorithmic composition
Algorithmic composition
Algorithmic composition is the technique of using algorithms to create music.Algorithms have been used to compose music for centuries; the procedures used to plot voice-leading in Western counterpoint, for example, can often be reduced to algorithmic determinacy...

.

Since then it has been evolving into a system used and further developed by both scientists and artists working with sound. It is an efficient and expressive dynamic programming language
Dynamic programming language
Dynamic programming language is a term used broadly in computer science to describe a class of high-level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all...

 which makes it an interesting framework for acoustic research
Acoustics
Acoustics is the interdisciplinary science that deals with the study of all mechanical waves in gases, liquids, and solids including vibration, sound, ultrasound and infrasound. A scientist who works in the field of acoustics is an acoustician while someone working in the field of acoustics...

, algorithmic music
Algorithmic composition
Algorithmic composition is the technique of using algorithms to create music.Algorithms have been used to compose music for centuries; the procedures used to plot voice-leading in Western counterpoint, for example, can often be reduced to algorithmic determinacy...

 and interactive programming
Interactive programming
Interactive programming is the procedure of writing parts of a program while it is already active. This focuses on the program text as the main interface for a running process, rather than an interactive application, where the program is designed in development cycles and used thereafter...

.

Released under the terms of the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

 in 2002, SuperCollider is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

.
The major release (3.4) was released in July 2010.

Architecture

Since version 3 the SuperCollider environment is split into a server
Server (computing)
In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients"...

, scsynth, and a client
Client (computing)
A client is an application or system that accesses a service made available by a server. The server is often on another computer system, in which case the client accesses the service by way of a network....

, sclang, that communicate using OSC (Open Sound Control).

SC Language combines the object oriented structure of Smalltalk
Smalltalk
Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." It was designed and created in part for educational use, more so for constructionist...

 and features from functional programming languages with a C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 family syntax.

The SC Server application supports a simple C plugin API making it easy to write efficient sound algorithms (unit generator
Unit generator
Unit generators are the basic formal units in many MUSIC-N-style computer music programming languages. They are sometimes called opcodes , though this expression is not accurate in that these are not machine-level instructions.Unit generators form the building blocks for designing synthesis and...

s) which can then be combined into graphs of calculations. Because all external control in the server happens via OSC, it is possible to use it with other languages or applications.

The SuperCollider synthesis server (scsynth)

SuperCollider's sound generation is bundled into an optimised command-line executable (named scsynth). In most cases it is controlled from within the SuperCollider programming language, but it can be used independently. The audio server has the following features:
  • Open Sound Control access
  • Simple ANSI C
    ANSI C
    ANSI C refers to the family of successive standards published by the American National Standards Institute for the C programming language. Software developers writing in C are encouraged to conform to the standards, as doing so aids portability between compilers.-History and outlook:The first...

     plugin API
  • Supports any number of input and output channels, including massively multichannel setups
  • Gives access to an ordered tree structure of synthesis nodes which define the order of execution
  • Bus system which allows to dynamically restructure the signal flow
  • Buffers for writing and reading
  • Calculation at different rates depending on the needs: audio rate, control rate, demand rate

The SuperCollider programming language (sclang)

The SuperCollider programming language is related to Smalltalk
Smalltalk
Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." It was designed and created in part for educational use, more so for constructionist...

 and functional languages, with a C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 family syntax. Its architecture strikes a balance between the needs of realtime computation and the flexibility and simplicity of an abstract language. Like many functional languages, it implements functions as first class
First class (computing)
In database modeling, a first class item is one that has an identity independent of any other item. The identity allows the item to persist when its attributes change, and allows other items to claim relationships with the item....

 objects, which may be composed
Function composition
In mathematics, function composition is the application of one function to the results of another. For instance, the functions and can be composed by computing the output of g when it has an argument of f instead of x...

. Functions and methods may have default argument values, variable length argument lists and may be called with any order keyword arguments. Closures
Closure (computer science)
In computer science, a closure is a function together with a referencing environment for the non-local variables of that function. A closure allows a function to access variables outside its typical scope. Such a function is said to be "closed over" its free variables...

 are lexical, scope
Scope (programming)
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics...

 is both lexical and dynamic. Further features typical of functional languages, like closure creation via partial application (explicit currying
Currying
In mathematics and computer science, currying is the technique of transforming a function that takes multiple arguments in such a way that it can be called as a chain of functions each with a single argument...

), tail call
Tail call
In computer science, a tail call is a subroutine call that happens inside another procedure and that produces a return value, which is then immediately returned by the calling procedure. The call site is then said to be in tail position, i.e. at the end of the calling procedure. If a subroutine...

 optimization, list comprehensions and coroutines are supported. Specifics include the implicit expansion of tuples and the stateless pattern system. Its constant time message lookup and real time garbage collection
Garbage collection (computer science)
In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program...

 allows large systems to be efficient and to handle signal processing flexibly.

By supporting methods of reflective
Reflection (computer science)
In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior at runtime....

, conversational
Interactive programming
Interactive programming is the procedure of writing parts of a program while it is already active. This focuses on the program text as the main interface for a running process, rather than an interactive application, where the program is designed in development cycles and used thereafter...

 and literate programming
Literate programming
Literate programming is an approach to programming introduced by Donald Knuth as an alternative to the structured programming paradigm of the 1970s....

, SuperCollider makes it relatively easy to find new sound algorithms and to develop custom software as well as custom frameworks. With regards to domain specific knowledge, it is both general (e.g. it allows to represent properties such as time and pitch in variable degrees of abstraction) and copious of example implementations for specific purposes.

GUI system

The SuperCollider language allows users to construct cross-platform graphical user interfaces for applications. The standard class library with user interface
User interface
The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

 components may be extended by a number of available frameworks. For interactive programming, the system supports programmatic access to rich text code files. It may be used to generate vector graphics
Vector graphics
Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon, which are all based on mathematical expressions, to represent images in computer graphics...

 algorithmically.

Clients

Because the server is controlled using Open Sound Control (OSC), a variety of applications can be used to control the server. SuperCollider language environments (see below) are typically used, but other OSC-aware systems can be used such as Pure Data
Pure Data
Pure Data is a visual programming language developed by Miller Puckette in the 1990s for creating interactive computer music and multimedia works. While Puckette is the main author of the program, Pd is an open source project with a large developer base working on new extensions to it. It is...

.

"Third-party" clients for the SuperCollider server exist, including rsc3, a Scheme client, hsc3, based on Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

 and Overtone, based on Clojure
Clojure
Clojure |closure]]") is a recent dialect of the Lisp programming language created by Rich Hickey. It is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming....

. These are distinct from the development environments mentioned below because they do not provide an interface to SuperCollider's programming language, instead they communicate directly with the audio server and provide their own approaches to facilitating user expression.

Supported operating systems

SuperCollider runs under Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

, Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 and FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

.
The Windows version, however, tends to lag behind the others since most development is based on Mac and Linux.
For each of these operating systems there are multiple language-editing environments and clients that can be used with SuperCollider (see below).

SuperCollider is also available on a Live CD
Live CD
A live CD, live DVD, or live disc is a CD or DVD containing a bootable computer operating system. Live CDs are unique in that they have the ability to run a complete, modern operating system on a computer lacking mutable secondary storage, such as a hard disk drive...

 called pure:dyne
Pure:dyne
puredyne is a live Linux distribution based on Ubuntu and Debian Live and dedicated to live audio-and-visual processing and streaming. It focuses on the Pure Data audio synthesis system as well as SuperCollider, Csound and others, plus live video-processing systems such as Processing and Fluxus...

 (a GNU/Linux distribution based on Debian
Debian
Debian is a computer operating system composed of software packages released as free and open source software primarily under the GNU General Public License along with other free software licenses. Debian GNU/Linux, which includes the GNU OS tools and Linux kernel, is a popular and influential...

).

Editing environments

The Mac version of SuperCollider is most commonly used from within its own Mac-specific (Cocoa
Cocoa (API)
Cocoa is Apple's native object-oriented application programming interface for the Mac OS X operating system and—along with the Cocoa Touch extension for gesture recognition and animation—for applications for the iOS operating system, used on Apple devices such as the iPhone, the iPod Touch, and...

) interface; and the Windows version comes with a (cross-platform) Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

-based development environment (named PsyCollider). Alternatively, SuperCollider code can be developed and run from a number of common development environments
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 such as:
  • Emacs
    Emacs
    Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...

     (Linux, Mac, Windows)
  • Vim
    Vim (text editor)
    Vim is a text editor written by Bram Moolenaar and first released publicly in 1991. Based on the vi editor common to Unix-like systems, Vim is designed for use both from a command line interface and as a standalone application in a graphical user interface...

     (Linux, Mac)
  • Eclipse
    Eclipse (software)
    Eclipse is a multi-language software development environment comprising an integrated development environment and an extensible plug-in system...

     (Linux, Mac, Windows)
  • gedit
    Gedit
    gedit is a text editor for the GNOME desktop environment, Mac OS X and Microsoft Windows. Designed as a general purpose text editor, gedit emphasizes simplicity and ease of use...

     (Linux)
  • Kate
    Kate (text editor)
    In computing, Kate is a text editor by KDE. The name Kate is an acronym for KDE Advanced Text Editor.-History:Kate has been part of KDE Software Compilation since release 2.2 in 2001. Because of the KParts technology, it is possible to embed Kate as an editing component in other KDE applications...

     (Linux)


For each of the above environments, a plugin enables the real-time execution of SuperCollider code and interaction with the audio server.

Code examples


// print "Hello world!"
"Hello world!".postln;



// play a mixture of pink noise and an 800 Hz sine tone
{ SinOsc.ar(800, 0, 0.1) + PinkNoise.ar(0.01) }.play;



// modulate a sine frequency and a noise amplitude with another sine
// whose frequency depends on the horizontal cursor position
{
var x = SinOsc.ar(MouseX.kr(1, 100));
SinOsc.ar(300 * x + 800, 0, 0.1)
+
PinkNoise.ar(0.1 * x + 0.1)
}.play;



// list iteration: create a collection of indices multiplied by their values
[1, 2, 5, 10, -3].collect {
arg item, i;
item * i;
};



// factorial function
f = {
arg x;
if(x

0) { 1 } { f.(x-1) * x }
};

Live coding
As a versatile dynamic programming language
Dynamic programming language
Dynamic programming language is a term used broadly in computer science to describe a class of high-level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all...

, SuperCollider can be used for live coding
Live coding
Live coding is a performance practice centred upon the use of improvised interactive programming and real-time computing in creating sound and image based digital media. Live coding is particularly prevalent in computer music, combining algorithmic composition with improvisation...

, i.e. performances which involve the performer modifying and executing code on-the-fly. Specific kinds of proxies
Proxy pattern
In computer programming, the proxy pattern is a software design pattern.A proxy, in its most general form, is a class functioning as an interface to something else...

serve as high level placeholders for synthesis objects which can be swapped in and out or modified at runtime. Environments allow sharing and modification of objects and process declarations over networks. Various extension libraries support different abstraction and access to sound objects, e.g. dewdrop_lib allows for the live creation and modification of pseudo-classes and -objects.
External links
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK