Final Project in Processing
Synthesizer
For my final project, I knew I wanted to do was create a new interface for sound creation. I wanted to combine what I learned about Processing with what I knew about programming sound.
This interface starts out as a blank gray canvas. There are two modes accesible to the user: draw and edit mode. They are reached by pressing ‘1’ (draw) and ‘2’(edit) on the keyboard. Also there is a toggle for muting the sound by pressing ‘m’ on the keyboard.
Draw mode: When in draw mode, the user can click to create circles. The location of where the user chooses to place the circle is important. The x values of the canvas correspond to pitch, with x = 0 being the lowest pitch, and x = width of the screen being highest pitch. This isn’t perfect; right now it is a linear scale mapped to frequencies, meaning every pixel increase is an equal pitch increase (e.g. x0 = 20Hz pitch, x2 = 120 Hz, x3 = 220 Hz). The linear scale means that the canvas has more high pitches than low, as opposed to equal distribution. Ideally, it should be a logarithmic scale because that’s how frequency works (x0 = 20Hz, x1 = 40Hz, x2 = 80Hz; these pitches increase by a factor of 2). The y values of the canvas correspond to amplitude, with y = 0 being 0 amplitude, and y = canvas height being 1 amplitude.
Edit mode: When in edit mode, the user can click and drag circles, and delete individual circles by pressing ‘backspace’ when a circle is highlighted (mouse over the circle), or clearing the canvas by pressing ‘delete’. When moving the circle position, the pitch and amplitude change accordingly.
The basic structure that this program uses is that each circle is an object. Each circle object has a pitch, amplitude, and XY position. Every time the user draws a new circle, a new circle object is added to an ArrayList. When in edit mode, there are tests to see if mouse position is over a circle, and when an object is selected, it correctly accesses the circle that is chosen by accessing the corresponding element value in the ArrayList.
I really enjoyed doing this project. I have previous knowledge of music programming in Pure Data (visual programming geared towards sound production), so I’m really comfortable with the properties of sounds and how to do certain things with sound; it was a bit different using the minim library (audio) in Processing, but the learning experience was cool. Making the GUI and making it interact in the way I wanted to was tough; there were so many bugs I had to work through, but I am pleased with the way it turned out.
In the future, I hope to add more features to this (such as a fellow student suggesting that when a circle is dragged, when released it still moves with a certain velocity) as well as clean up the code (it’s really messy right now) and see if I can make the code more efficient (I’m sure there are plenty of ways, I just wanted to make sure I could get the program to work before making it more efficient).
Despite not really being a programmer (I know Pure Data pretty well, and took an intro to Java series last year) with enough time and interest, it was possible to turn my idea into a working program. Plus, I changed my attitude towards programming. Previous to taking this class, I had developed a sort of a hate towards programming (not including Pure Data; I think the visual programming aspect makes it more interesting). My Java classes were so boring, and the assignments I had to program were not that appealing to me, on top of them taking forever to do! But with Processing, I feel like when programming is geared towards an artistic output, it becomes way more fun as I get to create an interactive visual experience that can be accompanied by many things (such as sound). It’s like solving a puzzle to create something that I envision. It’s really cool. I think I will continue to explore the possibilites of Processing, as well as refine the projects I’ve already done.



