PLOrk Asgn2 Details
Up and ChucKing!
- Don't Panic (and have fun)!
- If you have questions, email us directly or post to plork-175!
Under 'System Preferences' and then 'Sound':
- make sure edirol is the default output audio device
- if you want to use the built-in mic for input, make sure 'built-in' mic is the default input device
To control volume, use the knobs on the 2-channel amplifier (DA-70-2).
- This is really ghetto, and we hope to fix it soon.
- We have found that a 9 o' clock setting (or less) is tolerable for the knobs.
Open a Terminal from the dock. This starts in your home directory. For example, on the machine 'boom', the prompt may look like:
See if ChucK exists. Type 'chuck' in the terminal. You should see the following message:
boom:~ boom$ chuck [chuck]: no input files... (try --help)
This is the correct behavior, it's simply telling us that we have not supplied any programs for chuck to run. If you like, you can see the help output by typing 'chuck --help':
boom:~ boom$ chuck --help usage: chuck --[options|commands] [+-=^] file1 file2 file3 ... [options] = halt|loop|audio|silent|dump|nodump|about| srate<N>|bufsize<N>|bufnum<N>|dac<N>|adc<N>| remote<hostname>|port<N>|verbose<N>|probe| block|callback [commands] = add|remove|replace|status|time|kill [+-=^] = shortcuts for add, remove, replace, status chuck version: 18.104.22.168 (dracula) http://chuck.cs.princeton.edu/
For now, you don't need to worry about any of these options. But this help output may be useful later on.
Let's run some examples and hopefully hear some sound. First, let's navigate to the examples directory. Don't worry if you haven't used a command line interface before - just remember: don't panic, it's easy once you get use to it. And we will be here to provide support.
To change to a directory, we use the 'cd' (change directory) commmand. For example, let's go to the examples directory.
boom:~ boom$ cd PLOrk/chuck/week/02/examples/
Now the prompt should display that you are there:
You can also find out where you are by typing 'pwd' (I have no idea what this stands for) and you can you move to the home directory by simply typing 'cd' or 'cd ~' (the ~ represents path to your home directory).
Now, let's see what files are in the current directory by typing 'ls' (for uh list I think):
$ ls (you should see a list of files)
Okay! Let's play something. Type 'chuck' followed by the name of the program you want to run. For example:
$ chuck foo.ck
$ chuck foo
(the .ck is automatically appended)
You should be hearing the unmistakable sound that computers make (in the old SCI-FI movies).
Some programs go on indefinitely. To stop them, hit 'ctrl-c'. Hopefully chuck will actually stop. If not, turn down the volume and hit 'ctrl-c' a couple more times.
running programs in parallel
ChucK is a current programming language, which means you can run different parts of a program in parallel. For example, if we listen to moe.ck, larry.ck, and curly.ck separately:
$ chuck moe (hit ctrl-c to stop)
$ chuck larry (hit ctrl-c to stop)
$ chuck curly (hit ctrl-c to stop)
We hear them individually. We can also tell chuck to run them in parallel:
$ chuck moe larry curly (hit ctrl-c to stop)
This should play them "together". Without necessarily understanding any of the code, can you guess why they sound the way they do when played together? (hint: moe larry and currly and nearly identical except for one or two differences)
(to see/edit the files, use 'pico' or 'plork_edit')
$ plork_edit moe.ck
Try a few more examples, and take a glance at the code - don't worry about understanding the code, we will learn ChucK step-by-step later.
$ chuck foo $ chuck whirl $ chuck moe $ chuck larry $ chuck curly
$ chuck moe larry curly $ chuck otf_01 $ chuck otf_01 otf_02 otf_03 otf_04 $ chuck otf_01 otf_06 $ chuck otf_0*
$ chuck sndbuf
no sound (but useful):
$ chuck demo0 (shows timing) $ chuck demo1 (shows loops)
$ chuck adc (speak into mic) $ chuck i-robot (speak into mic) $ chuck ring.ck (speak into mic)
some STK instruments:
$ chuck rhodey $ chuck shake-o-matic $ chuck mode-o-simple $ chuck mandolin $ chuck mand-o-matic $ chuck band-o-matic
- ChucK + OTF Programming + Audicle: http://chuck.cs.princeton.edu/
- Join mailing lists (optional): http://chuck.cs.princeton.edu/community.html (join 'chuck' and 'chuck-users' for Q/A)
- Language specification: http://chuck.cs.princeton.edu/doc/language/
- Learn ChucK: http://chuck.cs.princeton.edu/doc/learn/
- post or email us!