[chuck-users] chuck beginner

Ge Wang gewang at CS.Princeton.EDU
Tue Oct 18 11:49:05 EDT 2005

Hi Favio!

> 1. In your ChucK Tutorial, you write as follows...
> "Given any number of source files that uses the timing mechanism above,...."

The mechanism here is one that simply chucks a duration to 'now':

  // advance time by 100 ms
  100::ms => now;

Time in the language specification:


The idea is that as long as each individual program component deals with its 
own time, chuck can automatically run them concurrently and with sample-
synchronous precision.

There are other ways of advancing time, such as with events:


> 2. Is it possible to trigger ChucK with MIDI?

It sure is - in the new release, check out gomidi.ck and gomidi2.ck in 
the examples/midi/ folder.  They only print out the messages, but it is very 
straightforward to add code to control synthesis and other parameters with 
them.  Also, fire up polyfony.ck and polyfony2.ck, which takes notein 
messages, such as from a keyboard.  The only "trick" to running them is that 
you must specify the midi device to open - and you can find this number using 
chuck --probe.

For example, in polyfony.ck:

  // device to open (see: chuck --probe)
  1 => int device;

If you see that the device you want to use (chuck --probe) is 3, then change 
the 1 to 3, save the file, and run it.

Quite a few folks here have been using MIDI in ChucK.  They can likely provide 
more and better usage examples.

Hope this helps.


This mail sent through IMP: http://horde.org/imp/

More information about the chuck-users mailing list