Up N ChucKin
Up N' ChucKin' is a workshop tutorial written/compiled by Adam Tindale for beginning ChucKers. If you are an experienced ChucKist I encourage you to try and run one in your area.
Here is a suggested and tested course of study for the workshop.
What the Chuck?
Give an overview of ChucK. Sounds simple, but it can be difficult. Usually start from the abstract and then move to the specific. What are the benefits of using this language? That is what they want to know.
ChucK is strongly timed. Users can have sample accurate control over processes. This is very useful when matching phases or dealing with FFTs (a feature hopefully coming soon).
Concurrency. You can easily make multiple copies of programs. This is much easier than in some other languages.
On-the-fly-programming. How cool is this?
Simple syntax. Show some examples.
Good community. The mail list and the WIKI rock.
Lots of bugs. Seriously this is good. People can help fix them by reporting problems. If we don't know that it is broken we will never fix it! Reporting bugs is an important part of software development. It is a great way to get involved.
There are many other great things about ChucK. Talk about why you like it and how it is has helped you make music.
Getting ChucK installed
Take a gander to the ChucK release page for the latest versions of ChucK. You may want to only install the binary versions for simplicity. It is a good idea to show the compile process so they don't get scared off.
Running some examples
Go through the standard larry, curly and moe examples. Try running the patches in the examples directory, there are lots to choose from! Get them hooked. The real fun is about to begin.
Writing Your First Script
I like to go through a pretty standard drill to help newbies write ChucK code. Here we go.
What is the music equivalent of "Hello world"? A sinewave at 440. Lets make one in ChucK. First we need a sinewave. In ChucK we use the sinosc ugen. Now we ChucK it to the DAC. This makes a connection of a sinewave oscillator to the physical output. Just what we ordered.
Hold the phone. What is that s over there? Ok ok. ChucK allows you to create instances of Ugens and objects. This is great because you can address certain sinewaves and not others. You wouldn't want a bank of twenty sinewaves that only had one frequency? (maybe you would...) But, the point is that you need them all to have names in order to address them. In fact, that is the next thing we need to do!
Now we need to set the frequency of our sinewave to 440. No problem. ChucK works left to right. This can be strange if you have programmed in other languages before. You will get used to it. To set the frequency we send the float 440. (make sure you have the period!) to the freq parameter of s.
Now try saving this patch and then giving it to ChucK. If we were to save it as test.ck you would do this:
What happened? It seemed to do something and then came back to the prompt. This is the correct behaviour. We have not done a crucial step: manage time.
For simplicity we are going to have our program loop forever. To do this we will use a while loop. We will set the boolean condition to true and inside of the loop we will advance time by 1 second for every trip through the loop.
Everything should work just fine now. You should hear your sinewave poking out of your speakers. This is the first of many terrible noises you will make.
Opening The Gates
Alright. Now that we have a functioning program we are going to modify it just a little bit and make big changes. First, lets add some effects! We'll start simple and add a gain that we will call fx.
You can change the gain like so:
Alright, now our sinewave is softer. Cool but it could be cooler. Let's make two simple changes. If we change gain for JCRev and .gain for .mix then things will be much cooler.
Fool around with the .mix level and see what happens!
Next thing on the agenda, do something with time! Inside of our while loop lets change the frequency of the sinewave. We will use a random number generator to get this done.
Getting cooler. Try and adjust the unit of time and the mix parameter to make something better. Try adding multiple copies of this patch. See what happens when you add a copy, save over the file and then add it again. What do you notice?
At this point try swapping out JCRev for some of the other reverbs and sinosc for some of the other oscillators. Let them explore and guide them. This is a great way to transition into the next section.
Now it is time to show some advanced examples. Try to play up your strengths, show how you use ChucK for music, fun, synthesis, attacking your friend's computer... This will give the new ChucKers an idea of what is possible and some inspiration.
If you have any words of wisdom here is the place to put them. If you have found a certain "behaviour" that causes you trouble, let them know. We can all learn from each other's mistakes.
I like to mention the strengths and weaknesses of ChucK here. Then I reinforce where ChucK can be found: the website, the wiki, and some of the other excellent websites on ChucK.
Past (And Future) Workshops
May 24, 2005
Ge Wang, Ananya Misra, Perry Cook, Ajay Kapur and Adam Tindale
This was a great workshop. Twenty victims...er ChucKists. Over 4 hours of ChucK with lots of examples and controllers.
University of Victoria
May 5, 2005
Adam R. Tindale
A two hour session for 5 new ChucKers.
Februrary 6, 2005
A Toplap event. A 3 hour workshop and 2 performances.
November 17, 2005
Ge Wang + Phil Davidson
An informal session for new ChucKers. The first infection.