ChucK
Encyclopedia
ChucK is a concurrent, strongly timed audio 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....

 for real-time synthesis, composition, and performance, which runs on Mac OS X, 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...

, Microsoft 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 iPhone/iPad. It is designed to favor readability and flexibility for the programmer over other considerations such as raw performance. It natively supports deterministic concurrency
Concurrency (computer science)
In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other...

 and multiple, simultaneous, dynamic control rates. Another key feature is the ability to add, remove, and modify code on the fly
On the fly
-Colloquial usage:In colloquial use, on the fly means something created when needed. The phrase is used to mean:# something that was not planned ahead# changes that are made during the execution of same activity: ex tempore, impromptu.-Automotive usage:...

, while the program is running, without stopping or restarting. It has a highly precise timing/concurrency model, allowing for arbitrarily fine granularity. It offers composers and researchers a powerful and flexible programming tool for building and experimenting with complex audio synthesis programs, and real-time interactive control.

ChucK is distributed freely 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....

 on 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...

 and Microsoft 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...

. On iPhone/iPad, ChiP (ChucK for iPhone) is distributed under a limited, closed source license, and is not currently licensed to the public. However, "the core team would like to explores (sic) ways to open ChiP by creating a beneficial environment for everyone".

Language features

The ChucK programming language is a loosely C-like object-oriented language, with strong static typing.

ChucK is distinguished by the following characteristics:
  • Direct support for real-time audio synthesis
    Synthesizer
    A synthesizer is an electronic instrument capable of producing sounds by generating electrical signals of different frequencies. These electrical signals are played through a loudspeaker or set of headphones...

  • A powerful and simple concurrent programming model
  • A unified timing mechanism for multi-rate event and control processing.
  • A language syntax that encourages left-to-right syntax and semantics within program statements.
  • Precision timing: a strongly-timed sample-synchronous timing model.
  • Programs are dynamically compiled to ChucK virtual machine
    Virtual machine
    A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

     bytecode.
  • A runtime environment that supports on-the-fly programming
    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...

    .


ChucK standard libraries provide:
  • MIDI input and output.
  • Real-time control via the Open Sound Control protocol.
  • Synthesis Toolkit
    Synthesis Toolkit
    The Synthesis Toolkit is an open source API for real time audio synthesis with an emphasis on classes to facilitate the development of physical modelling synthesizers. It is written in C++ and is written and maintained by Perry Cook at Princeton University and Gary Scavone at CCRMA...

     unit generators.

Code example

The following is a simple ChucK program that generates sound and music:

// our signal graph (patch)
SinOsc s => JCRev r => dac;
// set gain
.2 => s.gain;
// set dry/wet mix
.1 => r.mix;

// an array of pitch classes (in half steps)
[ 0, 2, 4, 7, 9, 11 ] @=> int hi[];

// infinite time loop
while( true )
{
// choose a note, shift registers, convert to frequency
Std.mtof( 45 + Std.rand2(0,3) * 12 +
hi[Std.rand2(0,hi.cap-1)] ) => s.freq;

// advance time by 120 ms
120::ms => now;
}

Uses

ChucK has been used in performances by the Princeton Laptop Orchestra (PLOrk) and for developing Smule
Smule
Smule is an American software and video game developer and publisher headquartered in Palo Alto, California. Smule develops interactive "sonic" applications for the iPhone and other technology platforms...

 applications, including their ocarina
Ocarina
The ocarina is an ancient flute-like wind instrument. Variations do exist, but a typical ocarina is an enclosed space with four to twelve finger holes and a mouthpiece that projects from the body...

 emulator. PLOrk organizers attribute some the uniqueness of their performances to the live coding they can perform with ChucK.

Seemingly independent coverage

  • Graham Morrison, (2009) Generate choons with Chuck. Tired of the same old music in the charts, we create our own music from a series of pseudo random numbers. Linux Format
    Linux Format
    Linux Format was the UK's first Linux-specific magazine, and is currently the best-selling Linux title in the UK. It is also exported to many countries worldwide. It is published by Future Publishing...

    issue 125
  • Alan Blackwell and Nick Collins, The Programming Language as a Musical Instrument in P. Romero, J. Good, E. Acosta Chaparro & S. Bryant (Eds). Proc. PPIG 17, pp. 120-130

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK