Apr/100
ChucK: mind-bending programming language of the day
I've recently started teaching myself a new programming language: ChucK. You can read a paper by the authors that gives a quick outline of some of the salient features of the language:
Wang, G., Cook, P. R. (2003). ChucK: a concurrent, on-the-fly audio programming language. In Proceedings of International Computer Music Conference, pages 219–226
I'm a bit of a stranger to concurrent programming, I'm just starting to get my feet wet really. The interesting thing about ChucK is that it is strongly timed. You can control time directly by manipulating a global now variable:
1::second => now; //Advances time by 1 second.
You can connect up audio signals using the ChucK operator, =>, then when time advances, you get sound. For example, this program will play a sine wave for 10 seconds:
SinOsc => dac;
10::second => now;
So in some ways, ChucK resembles VHDL you are building up a set of connections and rules for those connections. Also similar to VHDL, you can adjust time.
The really mind-bending part comes with the concurrency though. You can run multiple 'shreds' at once, where time is independently controlled in each shred. ChucK schedules all the times right down to the sample so that they all happen at the times you specify.
I'm a bit disappointed to see some of the bread-and-butter programming language features are still in development: there are no asserts, you have to use a command line option to import/#include a file.
But it's fun!
Peter