Final Project

So it’s finally time to create something cool out of what I learned this semester. For this project, I decided to build something that would ultimately help me in what I do: music production. As much as I love the flashy stuff Processing can do, I felt that Max would be the ideal platform for sound manipulation. I ended up learning a lot about Max in this Processing class, but hey, everything is useful at some point. Especially because all my music tech friends are total Max geeks and I feel left out. This was a great chance to learn Max and put something together that is both fun and useful. My idea was to create something that could augment the capabilities of keyboard instruments. When a key is pressed on a piano, there’s not much else that can be done to affect the sound. Unless you’re an experimental prepared piano artist, you’re limited to working with the sound of the hammers hitting the strings. When I was doing research for this project I remembered something I had seen a long time ago: piano keys with sensors that allow the player to create vibrato effects. What an awesome idea, I thought. If I could make my own DIY version of something like that I’d be very happy. So that’s what I tried. The first step was finding the right sensor for this type of application. A soft potentiometer, or simply soft pot, seemed to be a good choice. It is easy to install, relatively cheap, and fits perfectly with the hand gesture I want for my system. The soft pot outputs different voltages depending on where you press it along it’s length. It’s ideal for this type of finger movement as the user can ergonomically adjust the depth of the vibrato as she or he plays the keys. Another advantage to this potentiometer is that it comes with a self-adhesive back and is soft enough to cut to the exact size of my keyboard keys. Here’s what the soft pot looks like:


This project is just a test of my DIY vibrato system, so I started small. I only ordered four soft pots from Here’s how I hooked up them up on my Arduino Uno and key board:


The circuit is very simple: the 5V+ and gnd pins of each soft pot go to their respective lines on the breadboard, while the middle floating pin of each sensor goes into the Arduino’s analog input A0, A1, and A2. This allows me to write some code for the Arduino to read each analog input and transmit it serially to Max. Here’s what I wrote for the Arduino:

int softPot1 = A0;

int softPot2 = A1;

int softPot3 = A2;

void setup()


Serial.begin(9600); }

void loop()

{ Serial.print(analogRead(softPot1));

Serial.print(” “);


Serial.print(” “);




This code sends the voltage values of each pot in three columns, which are then decoded on Max’s side. Here’s what my Max patch looks like:

Screen Shot 2014-07-03 at 3.49.14 PM

IT WORKS! It still sounds pretty crude because I haven’t added an envelope generator to adjust the attack and decay of each note. It works polyphonically though, which is definitely a desirable feature for most music production (except 8-bit music for 1990s video games). It was a bit of a pain to get the polyphony and FM synthesizer working properly. Again, I barely knew how to do anything in Max before this project. And here it is, it works! This patch is also cool because it let’s the user define how much the serial values from Arduino affect the patch. If you use the full range of values from the stream, from 0 to 1023, the sensors changes the sounds drastically because it greatly increases the harmonicity ratio, or the ratio between the carrier frequency and modulating frequency. (For more info on FM synthesis: So besides creating vibrato effects with the low-frequency oscillator (LFO) of the FM synth, the user can increase the modulating frequency and create a great variety of harmonic sequences. Basically, this thing can make several different types of sound. All you gotta do is slide your finger up and down the keys — don’t forget to still press them down though, you’re still playing a keyboard!


Useless Box

My first Arduino controlled hardware is useless. Literally though. That’s the point of the box I built: it has a switch that turns on a servo, whose only purpose is to turn off the switch. Amazing right? I got inspiration from several Youtube videos of different “useless box” designs. Mine is pretty simple, it consists of a plastic box through which I drilled a couple holes to fit the switch and servo:


Then I soldered stuff just to feel legit:


And finally assembled the box and connected it to the breadboard/Arduino.



I also added a piezo speaker to give the useless box a bit more character. When the system turns itself off, the speaker on the breadboard plays a silly melody, which comes in one of Arduino’s sample programs. It adds another level of uselessness to the whole thing, and sounds pretty pathetic, which is ultimately funny.

The code for this Arduino pet trick is as follows:

#include <Servo.h> // add servo library
#include “pitches.h” // add pitches library (on a separate tab)


// array with the notes of the melody

int melody[] = {
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
Servo myServo; // initialize servo


//define servo variables

int pos = 0;
int inputPin = 2;
int val = 0;
void setup() {
pinMode(inputPin, INPUT);


void loop() {
val = digitalRead(inputPin);
if (val == HIGH){    // if statement that checks if switch is ON and activates servo
for(pos = 0; pos < 180; pos += 1){

// for loop to play the melody
for (int thisNote = 0; thisNote < 8; thisNote++) {

int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration); // tone function with designated pin, melody notes, and note duration variable

int pauseBetweenNotes = noteDuration * 1.30;

noTone(8); // stop tone

Here’s a video of the most useless of Arduino projects in action:


Sol LeWitt

Inspired by Sol LeWitt’s algorithms for creating his Wall Drawings (, I put together a simple Processing code that randomizes lines across the canvas. Although LeWitt’s algorithm is much more convoluted, my code simply scatters very long lines across Processing’s window to produce something that resembles LeWitt’s drawings. I tried to animate lines that would slide in and out of frame to produce the same effect. I tried for a long time until I was shown a simple workaround solution in class; this is my simple workaround for something I didn’t know how to create!


void setup() {
size(420, 420);

void draw() {
if (endx < 350) {

line(0, 0, random(10000,20000), random(10000,20000));



Wacky Clock Animation

This week I wrote my first (wacky) animation in Processing! My first idea was to build on last week’s sketch and make it animated. I wanted to turn my drum kit drawing into a set of buttons that play sampled drum sounds. It turned out to be slightly harder than I expected… So I moved on to another idea suggested in the assignment prompt: making a clock! I thought it would be interesting to make a clock that doesn’t keep time, just to be funny.

I first created pointers from the center of my animation that went everywhere with a random() function for the second XY coordinates of line(). Because it randomly created lines of different lengths it looked like I had both short and long pointers going everywhere. Getting wackier by the minute, pun intended. Then I thought the numbers should also do something weird, but first I had to figure out how to actually display numbers. I looked up how to load a font into your sketch, store it into a variable, and then use the textFont() and text() functions to display the numbers for my clock. I finally made the numbers move around randomly within a short range by setting up their coordinates with random() again. Why not make them change colors too? Very wacky. Finally, I realized my master/timepiece would only be completely with a wacky background, so I also made it change color randomly. I had to tone the colors and frame rate down to avoid potential epileptic seizures.


Here’s the code:


//Vitor Hirtsch
//Animation #1
//June 9, 2014


PFont font; //set up font
void setup(){
size(800,800); //size of window

font = loadFont(“Handwriting-Dakota-48.vlw”);
textFont(font, 150); //select font size


void draw(){
int bgd = color(random(200,255),random(200,255),random(200,255)); //randomize background colors

//clock circle
ellipse(width/2, height/2,width/1.1,height/1.1);

// animated numbers













//random pointers


Drum set sketch and the meaning of interactivity

The number of zombies has dramatically increased in the past few years, especially in cities like New York. They walk slowly, zigzaging on the sidewalk, their heads hanging down from their neck, until they eventually trip or bump into someone. But don’t worry, these zombies aren’t after brains, what they really care about is texting their fellow zombies or simply beating the hard level of a stupid game. It really baffles me how people cannot seem to stop looking at their phone even when they’re walking. Although it seems like it, I don’t think NYC has enough open holes on the street to make texting while walking a dangerous behavior… but oh my god, it’s so incredibly annoying. What makes people want to look at a tiny piece of glass all day? I would argue that we do that because we like interactivity (even when we’re about to fall into a manhole).

This Summer I decided to take “Introduction to Interactive Media” at NYU Tisch to better understand interactive systems and eventually come up with my own interactive design. The very first idea I was exposed to was the very definition of interactivity. What is it that makes something interactive? Have we been misusing this term and mislabeling things? How can basic programming skills and circuit building knowledge help us understand and develop truly interactive systems?

The first couple chapters of Chris Crawford’s “The Art of Interactive Design” give as tentative definition of what interactivity might be. It’s a tentative definition because the author himself says that there isn’t one correct definition of interactivity. For Crawford, the concept of interactivity can be approached from many angles. His main claim is that a truly interactive system must be composed of two actors, who go through three steps to achieve interactivity: listening, thinking, and speaking. These three main actions help us cross out a bunch of stuff from our list of interactive things. As Crawford argues, it became a common thing to label things as interactive to increase the value of certain objects, for example a carpet with the drawing of city. Kids can play on the carpet and pretend to navigate an imaginary city, but the carpet is neither listening, thinking, or speaking.

In programming terms, a system “listens” through an input, “thinks” with an algorithm that processes the input, and then “speaks” with an output. Crawford also points out that there are different levels of interactivity; some systems may be really good at acquiring input, some might have a more developed “brain” or algorithm, while others might give us several types of outputs. Some are great at everything, and those are at the top of the spectrum of interactivity.


And after all this rant about interactive stuff, enjoy my first sketch in Processing. It’s completely non-interactive:




// kick drum


strokeWeight(5); fill(200,100,0);


// tom 1





// tom 2





// floor tom





// snare





// Set cymbals to no stroke stroke

Weight(1); noStroke();

// hihat





// crash

cymbal fill(400,350,100);




// ride cymbal





// bench