Here is what I did to get Chuck to run on the Raspberry Pi
A Raspberry Pi 2 is a powerful mini Linux computer that leverages and encourage home-grown hacking experiments. For my current project, I’m revisiting Chuck, a strongly-timed music programming language I have used before to loop and mix audios. This time round, I’ll be running it within the RAM-tight environment of the Pi.
Either you are controlling the Pi directly via a connected monitor, ssh’ing or VNC’ing from another computer, you will have to open up the terminal (called LX terminal on the Raspbian) and download a few things.
- alsa-lib-1.0.25.tar.bz2: http://www.alsa-project.org/main/index.php/Main_Page
- jackd: http://jackaudio.org/downloads/
- libsndfile-1.0.25.tar.gz: http://www.mega-nerd.com/libsndfile/
- chuck-126.96.36.199.tgz: http://chuck.cs.princeton.edu/
Download alsa-lib with
$ wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.29.tar.bz2
Decompress it and build the source
$ tar -xjf alsa-lib-1.0.29.tar.bz2
$ cd alsa-lib-1.0.29
$ sudo ./configure
$ sudo make
$ sudo make install
Do the same with libsnd
$ wget http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
$ tar -xvzf libsndfile-1.0.25
For Jackd, you can use apt-get to install. Make sure you use jackd2. It’s preferrable and jackd caused a pain for me on my latest Pi upgrade.
$ sudo apt-get install jackd2
Now, if you look at the Chuck download page, you’ll see some dependencies you need in place before compiling Chuck
It is very likely you already have gcc, make and yacc installed. If not, try using apt-get to install all. The above mentioned all contribute to a successful installation. I had a problem with Chuck complaining it lacks bison, so I installed that and everything worked. If lex isn’t found, try installing flex with apt-get.
Now just download and build Chuck from source just like you did with other dependencies
Now, get on the Pi and start the Jack server using Qjackctl (GUI controller for Jack Audio Kit) or run it on the command line with
$ jackd -d alsa
As the server is running, open another tab and go to Chuck’s examples directory and play some drum sample:
$ cd /usr/share/doc/chuck/examples && chuck otf_1.ck
Oh, and plug a speaker or headphone into RPi’s audio jack too. That’s the crucial part. ☺