| ChucK | |
|---|---|
![]() | |
| Paradigm | Multi-paradigm |
| Designed by | Ge Wang |
| First appeared | 2003; 23 years ago (2003)[1] |
| Stable release | |
| Typing discipline | Strong |
| OS | Cross-platform |
| License | Mac,Linux,Windows:GPL-2.0-or-later iOS: Closed Source (Not Public) |
| Website | chuck |
ChucK is a concurrent, strongly timed audioprogramming language for real-time synthesis, composition, and performance,[3]which runs onLinux,Mac OS X,Microsoft Windows, andiOS. It is designed to favor readability and flexibility for the programmer over other considerations such as raw performance. It natively supports deterministicconcurrency and multiple, simultaneous, dynamic control rates. Another key feature is the ability tolive code; adding, removing, and modifying code on the fly, 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 complexaudio synthesis programs, and real-time interactive control.[4]
ChucK was created and chiefly designed byGe Wang as a graduate student working withPerry R. Cook.[1] ChucK is distributed freely under the terms of theGNU General Public License onMac OS X,Linux andMicrosoft Windows. OniPhone and 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 has stated that it would like to explore "ways to open ChiP by creating a beneficial environment for everyone".[5]
The ChucK programming language is a loosely C-like object-oriented language, withstrong static typing.
ChucK is distinguished by the following characteristics:[6]
ChucK standard libraries provide:
The following is a simple ChucK program that generates sound and music:
// signal graph (patch) SinOsc s => JCRev r => dac; .2 => s.gain;// dry/wet mix (for reverb) .1 => r.mix;// an array of pitch classes (semitones) [ 0, 2, 4, 7, 9, 11 ] @=>int hi[];// do forever: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 120::ms =>now; }
ChucK has been used in performances by thePrinceton Laptop Orchestra (PLOrk) and for developingSmule applications, including theirocarinaemulator.[8]
PLOrk organizers attribute some of the uniqueness of their performances to thelive coding they can perform with ChucK.[9]
...offers composers, researchers, and performers a powerful programming tool for building and experimenting with complex audio synthesis/analysis programs, and real-time interactive music.
The other thing that set PLOrk apart from the beginning was its use of a text-based program called ChucK, developed by a Princeton graduate student. ChucK allows the user to code quickly—similar to live coding—and "on the fly" for a performance, allowing for the spontaneity and real-time interaction that is important in live music performance. "ChucK is the only language that I know of that was designed from the outset to facilitate that," Trueman says. The program is also "concurrent," meaning that it can handle many different processes going on at once. Its "innate sense of time" allows performers to communicate during live rehearsals and performances, he says, adding that many other laptop musicians probably use a program like Max/MSP (which PLOrk uses in addition to ChucK) or another widely available commercial program. Today some other laptop orchestras—including the Stanford Laptop Orchestra (SLOrk), which was directly inspired by PLOrk—also employ ChucK.