ChucK

ChucK è un linguaggio di programmazione concorrente, strongly-timed per la sintesi audio in tempo reale, composizione e live performance[1], che può essere installato su Linux, MacOS X, Microsoft Windows e iOS.

Supporta la concorrenza deterministica e control rate multipli, simultanei e dinamici.

Offre la possibilità di eseguire live coding, aggiungendo, rimuovendo e modificando il codice in tempo reale, durante l'esecuzione del programma. Utilizza un preciso modello di sincronizzazione e concorrenza ed offre a compositori e ricercatori un potente mezzo per la realizzazione di programmi di sintesi audio complessi e controllabili in tempo reale[2].

ChucK è stato realizzato da Ge Wang sotto la guida di Perry R. Cook[3].

È distribuito gratuitamente sotto i termini della GNU General Public License (Linux, Microsoft Windows e MacOS X). Su iPhone e iPad, ChiP (ChucK for iPhone) è distribuito sotto una licenza limitata e non open source, e non è disponibile al pubblico[4].

Caratteristiche del linguaggio

ChucK è un linguaggio di programmazione orientato agli oggetti simile al linguaggio C, con tipizzazione forte.

ChucK si distingue per le seguenti caratteristiche[5]:

  • Supporto per la sintesi audio in tempo reale
  • Potente e semplice modello di programmazione concorrente
  • Meccanismo di sincronizzazione che permette il controllo di eventi e processi a velocità diverse
  • Modello di sincronizzazione definito strongly-timed
  • Compilazione dinamica dei programmi in bytecode da parte della virtual machine
  • Un ambiente runtime che supporta la programmazione on-the-fly
  • L'operatore ChucK (=>), utilizzato per connettere UGens (unit generators), assegnazioni di variabili, etc.

Le librerie standard supportano:

  • MIDI input e output
  • Open Sound Control
  • Synthesis Toolkit

Esempi

Il seguente è un semplice programma che genera una melodia random, utilizzando un oscillatore sinusoidale:

 // our signal graph (patch)
 SinOsc f => dac;
 // set gain
 .3 => f.gain;
 // an array of pitch classes (in half steps)
 [ 0, 2, 4, 6, 9, 10 ] @=> int hi[];
 
 // infinite loop
 while( true )
 {
     // choose a note, shift registers, convert to frequency
     Std.mtof( 65 + Std.rand2(0,1) * 43 +
         hi[Std.rand2(0,hi.cap()-1)] ) => f.freq;
 
     // advance time by 120 ms
     120::ms => now;
 }

Utilizzo

ChucK è stato utilizzato dalla Princeton Laptop Orchestra (PLOrk) e per lo sviluppo di alcune applicazioni della compagnia americana Smule, tra cui il simulatore di ocarina[6] PLOrk organizers attribute some of the uniqueness of their performances to the live coding they can perform with ChucK.[7].

Note

  1. ^ (EN) Ge Wang, The ChucK Audio Programming Language: A Strongly-timed and On-the-fly Environ/mentality, Princeton University, 2008. URL consultato il 17 gennaio 2021.
  2. ^ ChucK : Strongly-timed, Concurrent, and On-the-fly Music Programming Language, su chuck.cs.princeton.edu. URL consultato il 6 settembre 2013.
    «...offers composers, researchers, and performers a powerful programming tool for building and experimenting with complex audio synthesis/analysis programs, and real-time interactive music.»
  3. ^ R. T. Dean, The Oxford handbook of computer music, Oxford Handbooks in Music Series, Oxford University Press US, 2009, p. 57, ISBN 0-19-533161-3.
  4. ^ Ge Wang, ChucKian greetings and updates!, in chuck-users mailing list, Princeton University. URL consultato il 24 maggio 2011.
  5. ^ Wang, G. and P. Cook, ChucK: A concurrent, on-the-fly audio programming language (PDF), in Proceedings of the International Computer Music Conference, 2003.
  6. ^ Peter Kirn, Interview: Smule's Ge Wang on iPhone Apps, Ocarinas, and Democratizing Music Tech, in Create Digital Music, 22 luglio 2009. URL consultato il 24 maggio 2011.
  7. ^ Brittany Petersen, Laptop Orchestra Makes (Sound) Waves, PC Magazine, 11 giugno 2008. URL consultato il 17 gennaio 2021 (archiviato dall'url originale l'11 luglio 2017).
    «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.»

Bibliografia

  • Wang, G., Artful Design: Technology in Search of the Sublime, Stanford University Press, 2018, ISBN 978-1503600522.
  • G. Wang, P. Cook e S. Salazar, ChucK: A strongly-timed computer music language (PDF), in Computer Music Journal, 2015.
  • G. Wang, The ChucK Audio Programming Language, in PhD Thesis, Princeton University., 2008.
  • G Wang, R Fiebrink e P Cook, Combining analysis and synthesis in the ChucK programming language (PDF), in Proceedings of the International Computer Music Conference, 2007.
  • G Wang, A. Misra, A Kapur e P Cook, Yeah ChucK it! => Dynamic, controllable, interface mapping (PDF), in Proceedings of the International Conference on New Interfaces for Musical Expression, 2005.
  • G. Wang, P. Cook e A Misra, Designing and implementing the ChucK programming language (PDF), in Proceedings of the International Computer Music Conference, 2005.
  • G. Wang e P. Cook, The Audicle: A context-sensitive, on-the-fly audio programming environ/mentality (PDF), in In Proceedings of the International Computer Music Conference, 2004.
  • G. Wang e P. Cook, On-the-fly programming: Using code as an expressive musical instrument (PDF), in Proceedings of the International Conference on New Interfaces for Musical Expression, 2004.
  • G. Wang e P. Cook, ChucK: A concurrent, on-the-fly audio programming language (PDF), in Proceedings of the International Computer Music Conference, 2003.
  • 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 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
  • R. T. Dean (a cura di), The Oxford Handbook of Computer Music, Oxford University Press, 2009, pp. 27 and 580, ISBN 978-0-19-533161-5.
  Portale Software libero: accedi alle voci di Wikipedia che trattano di software libero