ChucK : Programming Guide

Command-line Options

version: 1.5.x.x (chai)

chuck command-line options:
chuck --[options|commands] [+-=^] file1 file2 file3 ...
   [options] = halt|loop|audio|silent|dump|nodump|about|probe
   [commands] = add|remove|replace|remove.all|status|time
       [+-=^] = shortcuts for add, remove, replace, status

(run 'chuck --about' to print the above information)


[source ChucK files]:
ChucK can run one or more programs in parallel. The programmer only needs to specify a list of programs on the command line, and chuck will compile and run them all concurrently in the VM. Each input source file (.ck suffix) will be run as a separate 'shred' (strongly-timed ChucK process) in the VM. They can 'spork' additional shreds and interact with existing shreds. Due to the ChucK timing mechanism, shreds don't necessarily need to know about each other in order to be precisely 'shreduled' in time - they only need to attend to their own behavior with respect with time. For example:

 %> chuck

Addtionally, shreds can be added/removed/replaced manually at run-time, using on-the-fly programming commands (skip ahead!).


--about / --help
prints ChucK usage message, with the ChucK URL.

prints version information.

--halt / -h
(on by default) - sets the vm to halt and exit if there are no more shreds in the VM.

--loop / -l
sets the ChucK VM to continue executing even if there no shreds currently in the VM. This effectively runs a local "chuck server" allowing shreds to be added/remove/replaced on-the-fly from a second terminal window or from a different machine. Note it is perfectly valid to specify this option without any input files. For example:
 %> chuck --loop

the above will 'time-loop' the VM, waiting for incoming shreds.

--audio / -a
(on by default) - enable real-time audio output

--silent / -s

disables real-time audio output - computations in the VM is not changed, except that the actual timing is no longer clocked by real-time audio. Timing manipulations (such as operations on 'now') still function logically in full. This is useful for rendering audio to file. Also, it can be handy for running a non-audio program.

--log(N) / --verbose(N) / -v(N)
sets the report level to (N). 0 is none, 10 is all, default is 1. Set higher levels to see more detailed information regarding ChucK’s internal operation.

sets the internal sample rate to (N) Hz. by default, ChucK runs at 44100Hz on macOS and Windows, and 48000Hz on linux/ALSA. even if the VM is running in --silent mode, the sample rate is still used by some unit generaters to compute audio, this is important for computing samples and writing to file. Not all sample rates are supported by all devices.

sets the internal audio buffer size to (N) sample frames. larger buffer size often reduce audio artifacts due to system/program timing. smaller buffers reduce audio latency. The default is 512. If (N) is not a power of 2, the next power of 2 larger than (N) is used. For example:

 %> chuck --bufsize:950

this will implicitly set the buffer size to 1024.

Choose a specific driver to use by name. Drivers tend to be platform-specific between Linux (ALSA, Pulse, Jack), Windows (DirectSound, WASPI, ASIO), and macOS (CoreAudio).

opens audio output device #(N) for real-time audio. by default, (N) is 0.

opens audio input device #(N) for real-time audio input. by default, (N) is 0.

--channels(N) / -c(N)
opens (N) number of input and output channels on the audio device. by default, (N) is 2.

--in(N) / -i(N)
opens (N) number of input channels on the audio device. by default (N) is 2.

--out(N) / -o(N)
opens (N) number of output channels on the audio device. by default (N) is 2.

--remote(hostname) / @(hostname)
sets the hostname to connect to if accompanied by the on-the-fly programming commands.
(host) can be name or ip of the host. default is (localhost).

--port(N) / -p(N)
sets the port to listen on if not used with on-the-fly programming commands.
sets the port to connect to if used with on-the-fly programming commands.

probes the system for all audio devices and MIDI devices, and prints them.

probes your system for chugins, and verify chugin versions between chugins and the host. Also see: --chugin-path for default chugins search paths.

(default: auto) specifies whether ChucK should automatically load ChuGins (auto) or disable ChuGin loading (off).

adds (path) to the list of paths searched for ChuGin to load. Any file ending in .chug (chugins) and .ck (chuck files to pre-load) in the ChuGin path are loaded when chuck is run. Each platform has its default chugins search paths:
  /Library/Application Support/ChucK/chugins
  ~/Library/Application Support/ChucK/chugins


  C:\Program Files\ChucK\chugins
  C:\Program Files (x86)\ChucK\chugins

loads a specific ChuGin at the location specified by (filename). This can be used to load ChuGins not in the default list of paths (see --chugin-path).

specifies whether chuck should output ANSI color codes for TTY terminal. (See example)

disables ANSI color codes for TTY terminal; same as --color:off

if this flag is specified with argument, chuck will attempt to write its process ID to the given file upon startup, and then remove that file upon shutdown. This assists external process supervision (through tools like monit,etc) for long-running installations that need auto-rebooting, instant kill switches for live performances, and other programmatic external process control.

specifies whether chuck should listen for incoming OTF commands (e.g., add, replace, remove, etc.).

disables listening for incoming OTF commands; same as --cmd-listener:off

utilizes a callback system for real-time audio (default).

--blocking (no longer available)
utilizes blocking behavior for real-time audio.

--deprecate:{stop|warn|ignore} (default: warn) specifies how to handle deprecated classes, UGens, and functions. "stop" will cause a program to not compile if it uses any deprecated features. "warn" will issue a warning. "ignore" will cause the program to compile normally without complaint. For example, $ chuck --deprecate:stop will cause chuck to stop compilation if uses any deprecated features.

--dump / +d
dumps the virtual instructions emitted to the console (stderr), for all the files after this flag on the command line, until a 'nodump' is encountered (see below). For example:

 %> chuck +d

this command will dump the virtual ChucK instructions for (only), with argument values, to the console. --dump can be used in conjunction with --nodump to selectively dump files.

--nodump / -d
(this is the default) ceases the dumping of virtual instructions for files that comes after this flag on the command line, until a "dump" is encountered (see above). For example:

 %> chuck +d -d +d

will dump, then — but not

These are useful internally for debugging ChucK itself. Or if one is curious about what the ChucK virtual machine.

runs chuck in interactive (shell) mode. Can dymically run code specified within { }, for example:

 chuck %> { <<< "hello there" >>>; } 

For the origins of ChucK shell, see this 2006 paper.

(from here, we go to)
On-the-fly Programming Commands

(or return to the)
Documentation Home

chuck | soundlab | cs | music | ccrma