ChucK : Programming Guide

On-the-fly Programming Commands

version: 1.5.x.x (numchucks)


On-the-fly Programming Commands

These are used for on-the-fly programming (see http://on-the-fly.cs.princeton.edu). By default, this requires that a ChucK virtual machine be already running on the localhost. It communicates via sockets to add/remove/replace shreds in the VM, and to query VM state. The simplest way to set up a ChucK virtual machine to accept these commands is by starting an empty VM with --loop:

 %> chuck --loop

this will start a VM, looping (and advancing time), waiting for incoming commands. Successive invocations of 'chuck' with the appropriate commands will communicate with this listener VM.

(for remote operations over TCP, see below)


--add / +
adds new shreds from source files to the listener VM. this process then exits. for example:

 %> chuck + foo.ck bar.ck

integrates foo.ck and bar.ck into the listener VM. the shreds are internally responsible for finding about the timing and other shreds via the timing mechanism and vm interface.

--remove / -
removes existing shreds from the VM by ID. how to find out about the id? (see --status below) for example:

 %> chuck - 2 3 8

removes shred 2, 3, 8.

--replace / =
replace existing shred with a new shred. for example:

 %> chuck = 2 foo.ck

replaces shred 2 with foo.ck

--status / ^
queries the status of the VM - output on the listener VM. for example:

 %> chuck ^

this prints the internal shred start at the listener VM, something like:

 [chuck](VM): status (now == 0h:2m:34s) ...
   [shred id]: 1  [source]: foo.ck  [sporked]: 21.43s ago 
   [shred id]: 2  [source]: bar.ck  [sporked]: 28.37s ago

--time
prints out the value of now on the listener VM. for example:

 %> chuck --time

something like:

 [chuck](VM): the value of now:
    now = 403457 (samp)
        = 9.148685 (second)
        = 0.152478 (minute)
        = 0.002541 (hour)
        = 0.000106 (day)
        = 0.000015 (week)

--kill
semi-gracefully kills the listener VM - removes all shreds first.



--remote / @
specifies where to send the on-the-fly command. must appear in the command line before any on-the-fly commands. for example:

 %> chuck @192.168.1.1 + foo.ck bar.ck
    (or)
 %> chuck @foo.bar.com -p8888 + foo.ck bar.ck

sends foo.ck and bar.ck to VM at 192.168.1.1 or foo.bar.com:8888



return to Documentation Home


chuck | soundlab | cs | music | ccrma