Graffathon 2019

Getting started with Processing, Rocket and Moonlander

This is a step-by step tutorial on how to set up Processing, Rocket and Moonlander to build your very first demo. At the bottom of the page, you can find links to some resources, such as inspiration and royalty-free music. If you're stuck, the organizing team can help, and you're always welcome to ask for help in the Telegram group.

Processing

Processing is a free, open-source programming language aimed at visual artists. To get started with Processing, head to the downloads page, pick the version for your operating system and extract the zip file to the folder you want.

Rocket and Moonlander

To synchronize your Processing sketch with music, you will need two tools: Rocket and Moonlander. Rocket is a system for synchronizing music and visuals, including a timeline editor ("tracker") and an API for reading values from the timeline. Moonlander is a Processing library that connects to Rocket.

You can get the Rocket editor for Windows and OS X here. For Linux, you can try this binary, or you can compile the Rocket editor yourself using qmake (see instructions here). You can also try this other editor which doesn't require Qt.

Once you've got a copy of Rocket, you will need to install two libraries for Processing. To play back audio, Moonlander requires the minim library. It can be installed directly from Processing through the menu Sketch -> Import Library -> Add Library. Next, download the latest version of Moonlander from here and extract the folder Moonlander from the zip file to your Processing libraries folder:

Note that you have to start processing at least once for this folder to exist. If you can't find the folder, open the Processing preferences and check the "Sketchbook location" setting.

At this point, you should be all set! To get started, launch Processing and the Rocket editor, and add Moonlander to your sketch. You can e.g. try the Moonlander example here.

Whenever you have a line like double x = moonlander.getValue("foo") in your sketch, the column foo will appear in the Rocket editor. Type numbers into the cells ("keyframes") and press space to play back the timeline. To change how the values between two keyframes are interpolated, press i - the interpolation mode is indicated by a colored line. The rest of the keyboard shortcuts are listed on Github.

Exporting and submitting your entry

The entries are submitted to the party management system. Please follow the instructions in the PMS for the file name convention.

A Processing sketch can be submitted by just zipping the sources (the folder containing the .pde files), we can run it directly from the Processing IDE. Remember to set your demo to full screen mode with fullScreen() and hide the mouse cursor with noCursor() in setup(). Remember to test your demo on the compo machine!

It is highly recommended to upload a screenshot of your production to the PMS. We know from previous experience that people tend to not remember which demo is called what, and demos without a screenshot tend to get way less points in the voting.

If you want to e.g. send the sketch to your friends, it can be exported as an executable from Processing through the menu File -> Export application. For this to work, everything you want to be exported along with the program (such as the music and the syncdata.rocket file) need to be put in the folder data next to the .pde file and the references to the files need to be updated as well. For most people, this means that you need to change moonlander.initWithSoundtrack(this, "song.mp3", BPM) to moonlander.initWithSoundtrack(this, "data/song.mp3", BPM), and moonlander.start() to moonlander.start("localhost", 1338, "data/syncdata.rocket"). Note that bundling Java with the executable creates a large file (around 200MB), but this might be necessary to make it work stand-alone.

Some resources

Royalty-free music

When downloading music made by someone else, remember to always check the license. In particular, the CC-NoDerivatives license explicitly forbids using CC-ND licensed music as part of a demo.