From CSWiki
Revision as of 01:32, 9 May 2009 by Adrian.kwok (talk | contribs) (How to Play)

Jump to: navigation, search

Adrian's Final Project

Welcome to Adrian's MUS 314 Project Wiki Page!


This project grew out of the desire to build an instrument that was based off of some sort of goal-oriented game. Eventually through some brainstorming I developed a graphical model where a start state (in this case a grid of 256 black squares) is converted into a goal state (a grid of 256 white squares). The rules of the game are simple, every click of the mouse causes an "explosion" around that point on the screen, changing the colors by a predetermined rule. Ultimately I added a number of other features, including the ability to lighten or darken the entire screen, change the explosion pattern and reset the screen to either the goal or start states.

Built off of the graphical interface is a simple sonic representation of the gameplay. The start state is represented by 3 StkInstruments (in the version either Clarinets or Flutes) that are set to dissonant relative frequencies. Their frequencies are directly related to the total "darkness" of the screen, so the goal state has them in perfect unison. In this way I envisioned a piece using this instrument to represent the logical problem solving of its players, each seeking to make his/her sound as pure as possible. In light of this clear goal I steered clear of making the individual sounds too complicated or to have additional voices present, in my instrument everything presented is directly controlled by the user and his/her actions.


All of the relevant code for this project can be found here

How to Play

To run Dark Matter open both the Chuck and Processing files and run both (you need to download Chuck, the MiniAudicle and Processing). Ensure that the virtual machine is running if you are having problems running the Chuck file. Once the Processing file is running you should see a screen like this. Note that this doesn't necessarily mean everything is good to go, the GUI could run without the sound component.

To start Dark Matter you have to click one of the two instruments. There are two choices, a clarinet and a flute. The buttons labeled as such naturally control the instrument playing. Dark Matter will not produce sound until one of these instruments is initially selected.

Click a random spot on the grid. A cool pattern like this should appear. Now observe that there is a cool scrollbar-like thing under the grid on the left side. This bar controls the style of the pattern that appears on the screen (technical language we call this an "explosion" in Dark Matter speak yo). Play with the various options, you should get different gradient patterns like this. Notice that the sound changes whenever you change the makeup of the screen. What is happening in the background is whenever you click, the program is immediately recalculating the total "darkness" of the screen and adjusting the frequencies of the 3 sound sources accordingly. They will converge on the same value when the screen is perfectly white.

If you can't wait to see what that sounds like, there's a cool option with the button labeled "white" that will set the entire screen to white. The button labeled "black" naturally changes the entire screen back to black. Sometimes for pieces it's more musically appropriate to start with a white screen, to make this change just set the screen to white before picking your initial instrument. Say we started with a white screen and made some patterns of different styles. Now we decide we want to make the entire screen lighter. We can do so by clicking the "lighter" button

Black and White

I wrote a piece called "Black and White", which demonstrates the various features of the instrument. A video of me playing "Black and White" can be found here


This project represents my own work in accordance with University regulations. As stated in the individual files, code was borrowed with permission from the Processing programming language website and examples by Rebecca Fiebrink and Dan Trueman. Special thanks to Rebecca for her help.

What to include on your project page

  • A description of your project
  • Your code
    • If it's short, you can make a new page for it like this one
    • Or, if there's a lot of it, put it in a .zip file so that people can upload it.
  • Instructions on how to run your code
  • A sound or video recording of your piece. Going lo-fi and using built-in webcam from another laptop (e.g. PLOrk machine in studio B) is fine. But for audio, if you're using chuck, best to use for writing chuck's output directly to a file.
    • See directions above on putting it on your network drive and linking to it