Английская Википедия:ChucK

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску

Шаблон:Short description Шаблон:Other uses Шаблон:Infobox programming language

ChucK is a concurrent, strongly timed audio programming language for real-time synthesis, composition, and performance,[1] which runs on Linux, Mac OS X, Microsoft Windows, and iOS. It is designed to favor readability and flexibility for the programmer over other considerations such as raw performance. It natively supports deterministic concurrency and multiple, simultaneous, dynamic control rates. Another key feature is the ability to live 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 complex audio synthesis programs, and real-time interactive control.[2]

ChucK was created and chiefly designed by Ge Wang as a graduate student working with Perry R. Cook.[3] ChucK is distributed freely under the terms of the GNU General Public License on Mac OS X, Linux and Microsoft Windows. On iPhone 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".[4]

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:[5]

  • Direct support for real-time audio synthesis
  • 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 bytecode.
  • A runtime environment that supports on-the-fly programming.
  • The ChucK Operator (=>) that can be used in several ways to "chuck" any ordered flow of data from left to right.

ChucK standard libraries provide:

  • MIDI input and output.
  • Open Sound Control support.
  • HID connectivity.
  • Unit generators (UGens) - ie oscillators, envelopes, synthesis toolkit ugens, filters, etc.
  • Unit analyzers (UAnae) - blocks that perform analysis functions on audio signals and/or metadata input, and produce metadata analysis results as output[6] - ie FFT/IFFT, Spectral Flux/Centroid, RMS, etc.
  • Serial IO capabilities - ie Arduino.
  • File IO capabilities.

Code example

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;
 }

Uses

ChucK has been used in performances by the Princeton Laptop Orchestra (PLOrk) and for developing Smule applications, including their ocarina emulator.[7] PLOrk organizers attribute some of the uniqueness of their performances to the live coding they can perform with ChucK.[8]

See also

Шаблон:Portal

References

Шаблон:Reflist

Further reading

Шаблон:Refbegin

Literature by its authors

Seemingly independent coverage

Шаблон:Refend

External links

  • ChucK homepage at Princeton University
  • ChucK mirror at Stanford University
  • ChucK FLOSS manual


Шаблон:Computer music