Wednesday, May 30, 2012

The Basics (for Macs) - Downloading ChucK for someone who has never even heard of "The Terminal"

Downloading the files from the site

So, clearly, to begin working with ChucK, one needs to download it. This might be complicated for someone who has never worked with the Terminal before. So I'm going to try to spell this out as best I can, in simple terms.

To start, we need to find the terminal. It might be best for students to keep the shortcut to it on the dock, or on their desktop. The terminal is located in the Utilities folder.

Once the students have all located the terminal, it is up to the professor to decide whether she will use Smith accounts, or just have the students log in normally. This post will assume she is not using the accounts, however (if they are used), the steps will be identical except for the different directory names.

The students should then download the executable version of ChucK from this link: http://chuck.cs.princeton.edu/release/. The executable version can be found in the MacOS X section of the page. Directly underneath this link is the miniAudicle download. Students should also download this link.

Two files should now appear in the Downloads folder: chuck-1.2.1.3.tgz and miniAudicle-0.2.0a.dmg.

PART I: Making it work on the terminal

1.) Click on the file chuck-1.2.1.3.tgz
2.) Somewhere in the Downloads folder, another folder titled chuck-1.2.1.3-exe should appear

3a.) At the date of this post, the ChucK files you download from this link are not completely compatible with MacOS Lion. There is a fix for this:
  1. Copy and paste this link into your browser: https://lists.cs.princeton.edu/pipermail/chuck-users/2011-August/006329.html
  2. Click on the first link on the page ( ChucK (Mac OS X Universal command line executable): https://ccrma.stanford.edu/~spencer/chuck/chuck-1.2.1.4-beta-1.tgz )
  3. That file (chuck-1.2.1.4-beta-1.tgz) should now appear in the Downloads folder
  4. Click that file. Somewhere in the Download folder (depending on the amount of files in it, students might have to look around for it) an icon that looks like a black screen with green writing in the top left corner should appear, with the name "chuck". **This is identical to the icon/file in the "bin" folder which is inside of the chuck-1.2.1.3-exe folder (I'll call this the "Chuck Folder" from now on), except that it has a patch that fixes the bug.**
  5. Expand the Chuck Folder inside of Downloads by clicking the grey arrow next to its icon. Now, underneath the Chuck Folder, all of the sub-folders (aka sub-directories) should be visible, including one called "bin". If you expand bin as well, by clicking the grey arrow next to it, you should see the original "chuck" icon/file I mentioned in step 4.
  6. Drag the icon which appeared in step 4 (the one with the patch) into the "bin" folder you just expanded. Make sure this file is named "chuck", and not "chuck 2" or "chuck 3" etc. If you do this right, a message will pop up asking if you'd like to replace the original "chuck" file. Click "replace" (or the equivalent to "yes").
  7. You will know if you did this right only after you finish the rest of the steps in this part. Don't worry if you didn't - you are able to go back and make it work later, too.
3b.) Bring up the terminal.
4.) Type in "cd Downloads" and press enter. This is the terminal's version of opening the finder and clicking on the "Downloads" folder. To see all of the files in the folder, type in "ls". You should see the name chuck-1.2.1.3-exe somewhere in the list of files.
5.) Type in "cd chuck-1.2.1.3-exe" to open this folder. You can type in "ls" again if you're curious about what files/sub-directories are in this folder.
6.) Type in "cd bin". For future reference, you can type in "cd Downloads/chuck-1.2.1.3-exe/bin/" to do steps 4-6 in one step.

**The rest of this tutorial is reiterating the Install instructions found here.**

7.) Type in "sudo cp chuck /usr/bin/". You should be prompted for your password, along with a warning message. Ignore the message, and type in your password.
8.) Type in "sudo chmod 755 /usr/bin/chuck". If you're prompted for your password again, type it in.
9.) Everything should now be ready to go on the terminal! Here are two checks I suggest doing to see if everything is in working order:
  1. Type in "chuck". You should get the following output: 
    [chuck]: no input files... (try --help)
    
    
  2. Go back to the "chuck-1.2.1.3-exe" folder. If you are still in the "bin" directory, just type "cd ../". If you are elsewhere, type "cd", then "cd Downloads/chuck-1.2.1.3-exe".
  3. Type in "cd examples" to open the examples directory.
  4. Type in "chuck otf_05.ck". You should hear random tones generated by this ChucK program. If you do, congratulations - you did it! If you don't, and you have MacOS Lion, you probably didn't copy the "chuck" file with the patch properly. You should retry the steps in 3a, or ask the professor/a teaching assistant for help.
Part II: Downloading the miniAudicle

This part will be a lot easier that Part I.

1.) Click on the file miniAudicle-0.2.0a.dmg which should still be located in your Downloads folder.
2.) If you get a warning message about it being an application downloaded from the internet, ignore the warning and open the package anyway.

3a.) IF YOU ARE NOT RUNNING MacOS Lion:

A device with the name "miniAudicle-0.2.0" should pop up (if it doesn't, look for it in the "Devices" section of the finder - in the side bar on the left). Drag and drop the "miniAudicle" icon inside the device folder onto your Desktop or the Dock

3b.) IF YOU ARE RUNNING MacOS Lion:
  1. Copy and paste this link into your browser: https://lists.cs.princeton.edu/pipermail/chuck-users/2011-August/006329.html
  2. Click the second link on the page ( miniAudicle (Mac OS X Universal binary): https://ccrma.stanford.edu/~spencer/chuck/miniAudicle-0.2.1-beta-1.tgz )
  3. That file (miniAudicle-0.2.1-beta-1.tgz) should now appear in the Downloads folder
  4. Click on it. Somewhere in the Downloads folder, an icon that looks like this: "=>" in green with an orange square outline should appear, with the name "miniAudicle".
  5. Drag and drop this "miniAudicle" icon onto your Desktop or the Dock
4.) Open up the icon you just moved.
5.) Test it out with one of the example programs from the Chuck Folder. To do this, click "File > Open File" and find the examples in your Chuck Folder (this is the same folder as step 9.3 above). Open any one (or more!) that you like.
6.) Back in miniAudicle, click "ChucK > Start Virtual Machine"
7.) In each of the example ChucK files you opened, click the "Add Shred" button locted at the top left (it's a green plus sign)
8.) If you did it right, you should hear the random tones. If don't, and you have MacOS Lion, you probably didn't open the patched version of miniAudicle. You should retry the steps in part 3b, or ask the professor/a teaching assistant for help.

That should cover everything you need to know about downloading ChucK on a Mac. The PC tutorial is coming next.

-Julia


1 comment: