Difference between revisions of "ChucK OSX Install and Run"
Revision as of 17:45, 21 February 2006
The classic way to run ChucK is via Terminal/and the command line. If you haven't used the command line before, don't worry - you only need learn a few commands and can get a lot of mileage on those.
- Questions? mailing lists join 'chuck' and 'chuck-users'
- ChucK homepage
- ChucK wiki page
- context: [In the Beginning was the Command Line] by Neal Stephenson
Here we go:
1. download the OSX executable (something like chuck-1.2.x.x-exe.tgz). The browser may have automatically unzipped this file, leaving you with folder 'chuck-1.2.x.x-exe' somewhere (most likely on your Desktop?) If you don't see the this folder, let me know.
2. open Terminal, and navigate to the 'chuck-1.2.x.x-exe' folder/directory. The directory structure in Terminal mirrors the folder structure in Finder. We will be using the following commands:
pwd - prints what directory/folder you are in ls - prints the contents of the current diretory cd - change directory cp - copy file(s)
To navigate to the 'chuck-1.2.x.x-exe' directory (assuming it's on your desktop) if any part of this doesn't work or make sense, please let me know:
> pwd (this is optional, it will print out what directory you are in, something like /Users/yourname/ at the beginning.)
> ls (this is also optional, it will print out the files in your current directory.)
> cd Desktop (go into the 'Desktop' directory)
> ls (optional, it examines the contents of the directory, you should see chuck-1.2.x.x-exe)
> cd chuck-1.2.x.x-exe (note: replace x with the right numbers; go into the 'chuck-1.2.x.x-exe' directory)
> cd bin (go into the 'bin' directory)
> ls (optional, it examines the contents, you should see 'chuck' there)
> sudo cp chuck /usr/bin (enter your password - it should be the same as your login password on the computer) (this copies 'chuck' into /usr/bin, a common place for programs)
> sudo chmod 755 /usr/bin/chuck (this sets the appropriate permissions)
3. If things went well, chuck should be installed now. To test that, type 'chuck' in Terminal, you should see something like this:
> chuck [chuck]: no input files...
If you see this, that means chuck has been installed correctly. The 'no input files' just means we haven't given chuck anything to run yet.
4. To run a chuck program, let's navigate to the examples/ directory. Let's continue using the same Terminal as in step #2:
> cd .. (this moves one directory back, so if for example we were in directory foo/bar/, we should be in foo/ after this command)
> pwd (optional, should say we are now be back in a folder like /Users/yourname/Desktop/chuck-1.2.x.x-exe/)
> cd examples (move into the examples directory)
> ls (list the contents, you should see some files and other folders, files including otf_01.ck, otf_02.ck, ... etc.)
> chuck otf_06.ck (this runs the otf_06.ck program, you should hear something)
To quit the program, hold down the Ctrl and press C.
To run multiple files in parallel:
> chuck otf_01 otf_05 otf_06 (this runs the three programs in parallel. note the .ck at the end of the program name is optional)
(hit ctrl-c to to quit)
You can also try navigating into other directories (like stk/) using the 'cd' command and running programs in there. Remember to use 'cd ..' to move back out of a directory.
5. To look at the chuck program files, open them up in any text editor (like TextEdit or pico, a command line editor). The above encompasses a most of what we need to do in dealing with unix, the rest is chuck.
Questions? join mailing lists (join 'chuck' and 'chuck-users')