Project 2 – Kevin Darr

For this project, I used spectral analysis along with machine learning to create a system for chord recognition. The system works by writing FFT frequency bin amplitudes into a matrix, then taking “snapshots” of the matrix and outputting the snapshot as a list, then sending these lists to the ml.svm object for categorization. While the system could easily work with any audio source, for this demonstration I made a simple polyphonic synth using sawtooth oscillators and a MIDI controller to play chords for the system to analyze. The challenge with this project was devising a system for processing the data from the FFT matrix and molding it into a form that is usable by the SVM but still contains enough data to identify specific chord spectra. The algorithm is powerful enough to recognize, for example, the difference between a C major chord and a C minor chord, if given enough training data.

In this demonstration I show how to train the SVM and how to map new chords. At the end I show that the system is not aware that a chord played an octave higher is not recognized. This can be fixed easily by simply mapping one chord played in several octaves (for example play C major chords with roots C3, C4, and C5 as state 1, D3 D4 D5 state 2, etc.)

Continue reading

Final Project – Isha Iyer

For my final project I decided to explore more ways of using the leap motion sensor to control different elements of drawing. I made a game through which the coordinates of a hand are tracked to translate to both a rotation and resizing of a square to match up with a target square. When the squares are matched sufficiently, it moves to another one. I have attached a demo of me playing this.

I was also very interested in learning more about different uses for the machine learning patch. I trained the leap motion to detect three different hand gestures: a palm facing down, a fist and a “c” for camera. As shown in the demo below, when I make a “C” with my hand, I am able to take pictures with the camera. I can then use my left hand to distort the image taken. This distortion was influenced by this tutorial.

Here is a link to all the final files I used for this project including the machine learning data and model for convenience. I also have included all the gists below.

Draw Game:

ML patch:

Distortion Patch:

Adam J. Thompson – Final Project – Body Paint

Body Paint is the visual component of a commission from the Pittsburgh Children’s Museum in collaboration with three sound artists from the School of Drama.

The project is an interactive experience which uses the Kinect 2 to transform each participant’s head, hands, and feet into paintbrushes for drawing colored lines and figures in space. Each session lasts for one minute, following which the patch clears the canvas allowing a new user to take over and begin again.

Participants might attempt to draw representational shapes, or perhaps dance in space and see what patterns emerge from their movements.

The user’s head draws in green, the left hand in magenta, the right hand in red, the left foot in orange, and the right foot in blue.

Body Paint will be installed in the Museum in late January for a currently undefined period of time, free for participants to wander up to, discover, and to experience during their visit.

Visual documentation of the patch in presentation and patcher modes and a video recording of the results of my body drawing in space are below.

The Gist is here.

Project 2 – Magic 8 Ball – Alex Reed

For this project I wanted to explore the possibility for using voice to text to control Max. After a lot of research and trial and error I found that speech processing is better suited to other programs, like Processing or Google APIs. So the project transformed in to small “performance” piece, where with a little behind the scenes magic, the user can ask to know their future.

Here is a demo video:

And some screenshots:

Gist:

Project 1 – Willow Hong

For this project I explored the connection between movement and music, and essentially created my own theremin, which is an instrument that  controls the frequency and amplitude of sounds using hand movement.

I used Leap Motion sensor to read the absolute position of my left hand along the z (vertical) axis, and the range of that data stream is translated into 8 MIDI notes from C3 to C4. The velocities of my right ring finger are normalized and then mapped onto the computer system’s volume scale, so the faster my right hand moves, the higher the volume will be.

I also added a slowly rotating noise point cloud to create some visual atmosphere. The note change will be reflected in the color change of the visualization, and volume change will alter the cloud size.

Project 1 – Adrienne

For my project I wanted to see what I could do by modifying mesh points in a 3D model. This for me was an exploration of how Max reads 3D models, and I ended up with a crashing patch that took in a model, and distorted it using a .mov file. It used the normals of the model to extrude the vertices, and each point was being modified in accordance to the video. I eventually tried to use a pfft to get it to react to sound. It created really cool textures, but unfortunately I can’t get the patch to open. Below are screenshots of what I had.

I based this off of the duck distortion patch and this one I found on the internet:

https://www.dropbox.com/s/40nyha7vm2mqheb/extrusion.maxpat?dl=0

Project 1 – Arnav Luthra

For this project I tried making reactive visuals for rave music. There are two main components, the video of a 3D model dancing and an actual 3D model jumping around in space. The video is separated into R, G and B planes which are then moved around in sync with the music. The 3D model is distorted by a jit.catch on the signal and is bounced around on beat to the incoming audio.
The beat/bpm detection was done by an external object that was rather inaccurate but still created some cool visual effects.

One thing I really wanted to add to this project that would have made it a lot more interesting is having it fade in and out of these separate visual components based on the activity of the low-end. Since rave music is largely driven by kick drums, moments in a song where the kick drum or bass is absent are generally tense and dramatic. Being able to have the visuals correspond to this moment would have been really key. I tried to start this in measuring the difference in peakamps on beat with a low pass filtered signal but couldn’t find a meaningful delta. I then tried to simply map the amplitude of the filtered signal to the alpha channels of the layers but the 3D model would respond to a change in alpha values.

Overall, I think I could greatly improve on this project by more accurately measuring beats/bpm and getting the triggering/fading working. Below is a low-res recording of the visuals as well as the pasted patch.

 

<pre><code>
———-begin_max5_patcher———-
6063.3oc6cs0iiiak94N.4+ffQ+PR1pbyKhRT4gEU1cFjEXyrAHSxtOzUPAY
aUtT2xRZjjqK8fs+sGdQ2sjLsDksmKSRWkKcwj7iGdtwy4ve729ad2hUQu5k
tv3OZ7Qi28tejck2ItF+Juq3BuawN2WWG3lJdvE67RSc25s3l7al48Zl3Ffk
kWKb+N+v.uLwafJtZZ1aAdhGs7A82H96nUe5VGX8WOZeVw6CKtbra15m7C29
Ph25LYmFYiVBtwvjZw+EAv+IhcIi+YwKI+hxdK1S9FKVX7OE25++29a3+l8q
aTdrG58Bqqd3PO84G+JqcIcC.X0..JsG.vb..vTLjwPALPrTX7m5uMzMXwMC
9oIfQ8SeLIxCp8HHOfTIt.oWTxi+cCvRmoM5IiYwADKWbH9Elpvn2OLaN..u
WiSLbWk96d+iPiaMd+ine+jfC6o.Gll7eAANyL0PuKDfKcrLwXqx6D3G5sNZ
eXVCHXT.i4X.FGIST.nZUB15hfK1TapyLfKjoPvblvk9V7D649Y2cwecRqXL
sFOgAlHXcXYqvBlGChbytdQAywSFbUfBqeacfmApaP.pHHf5ADPJ.BPhTjhJ
7NuYdVOv5Td9O68UC28a7ilFT.FA8.VPAXgDHA0QcUtlAr3S9YKedchADQAF
NVfIo.JlNBBCnsDNnB1iRFFGANXc5G14lk3+5TIQ5UTxKI9YdFItO6gVtK5Y
CLv3SwdaOByiGiByR8+hneJn2UB1fUBr3eAgt6jO6eJwmqS8oyuwDuDZYYaR
YvpIbIxFaQQLMVLkzZ3yuj4zrn3YA6PfYD6.TIe6YF0FZs41fktouEtNwycy
j3TAGCSaHSaEqlngC75XAJDR3TzSylP3XbY.lHXXAMgJax7rHEyHXU2CdEW5
LFE53bo43NRNpsuTtKo2wtpxs6YrCFbdGyG64K.pI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STad
eNMfDcJBgKdpc9apePzgAP4gUkLsDjmrBM+KnLFeMwNk+0LQEAcNyTQPkjv.
0WHU.MOyQuIDoLjpGmqCU1vRbewGaqCHZQS09fgt8gBcGGHzCbXPevAAcd0k
QFCwsiM2xbZy8wWeyiWPHxik35UN0ZXBO5kEYiWQMbf.fNVvaZ7oV0BjFYe2
GaEt00SrtOVjZcUnWdmIycUqNhWfGu60nuXRfN1N2z4mZzgZ7VV1ND.ULBHT
HVL..VPjUqWpbn+feHeNrrvbPYuEfbSmeBVOR4yGLE41TyATSPpImnUaezOH
nrW2n9xTDf1K1l3twmOiUVAeDu.rnah.lP.5FYAgG5PkCTDl+oFE3D46gJwG
pXDU+Wc73kshCmLf+jXfCEXJ+jjxn4q4FtM+fz1t9Q.cbRD+fxr3nEeI1o5M
1mEUNJE2z14fJnTODTGYVTjkKroMH0BaWmFt8b29fL+z.+MkmJ7+3gzT89kU
Me1DyN1LSqNQraBup.0Nm.jctRIvMYxUtP+ENeCicQgQow7zjM+cyO50UXUl
MECME8VaG1.T7IpIjIX8fQ43oZOcxo5D6vbDu5G8RcSsP1lxkr1.BkJ+D0DO
GzqGiX86hBcWGsnGFU.nEvQvTC.gThjUK.iIlCSd4XaynptofrzwgfsvpxbC
bSseLJhQvPDi6P.HAPP.2gIDcWutMcHCA.NRhODxT9IL.vIMaLz5lFF3.EDS
T1BMnbVmMmaQutng4yVNN1lEexAdDpYH1FHHLnHaKrYNaHJx4piZl0qnBdGH
lrxbPg.wsW2c.wLarXJDR6XSIDa4mPHH57SQyeS1u9WvO87WS
———–end_max5_patcher———–
</code></pre>

Project 1- Alex

I like taking digital mediums and making them more accessible for untrained artists. I think that everyone should be able to mess around with computers and make cool stuff. For this project, I decided to make a physical interface for the media lab control patch Jesse gave us.

insert photo of the arduino I forgot to take here

Arduino control code

// constants won’t change. They’re used here to set pin numbers:
const int buttonOnePin = 3; // the number of the redlight pushbutton pin
const int ledOnePin = 9; // the number of the LED pin
const int buttonTwoPin = 4; // the number of the yellowlight pushbutton pin
const int ledTwoPin = 10; // the number of the LED pin
const int buttonThreePin = 5; // the number of the bluelight pushbutton pin
const int ledThreePin = 8; // the number of the LED pin

// variable buttons
int buttonOneState = 0; // variable for reading the pushbutton status
int buttonTwoState = 0;
int buttonThreeState = 0;

//variables knob
const int potPin = 3; // select the input pin for the potentiometer
int potVal = 0; // variable to store the value coming from the sensor
int mappedPotVal = 0;

//variables slider
const int slidePin = 0;
int slideVal = 0;
int mappedSlideVal = 0;

//variables for ir detector
const int irPin = 5;
int irVal = 0;
int mappedIrVal = 0;

//joystick
const int swPin = 2; // digital pin connected to switch output
const int xPin = 2; // analog pin connected to X output
const int yPin = 1; // analog pin connected to Y output

int xState = 0;
int yState = 0;
int mappedXState = 0;
int mappedYState = 0;

void setup() {
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledOnePin, OUTPUT);
pinMode(ledTwoPin, OUTPUT);
pinMode(ledThreePin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonOnePin, INPUT);
pinMode(buttonTwoPin, INPUT);
pinMode(buttonThreePin, INPUT);

}

void loop() {
// read the state of the pushbutton value:
buttonOneState = digitalRead(buttonOnePin);
buttonTwoState = digitalRead(buttonTwoPin);
buttonThreeState = digitalRead(buttonThreePin);

// check if the redlight pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonOneState == HIGH) {
// turn LED on:
digitalWrite(ledOnePin, HIGH);
} else {
// turn LED off:
digitalWrite(ledOnePin, LOW);
}

// check if the yellowlight pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonTwoState == HIGH) {
// turn LED on:
digitalWrite(ledTwoPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledTwoPin, LOW);
}

// check if the bluelight pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonThreeState == HIGH) {
// turn LED on:
digitalWrite(ledThreePin, HIGH);
} else {
// turn LED off:
digitalWrite(ledThreePin, LOW);
}

//check the turn potentiometer values, map them to the bay range
potVal = analogRead(potPin); // read the value from the potentiometer
mappedPotVal = map(potVal, 0, 1023, 1, 9);

//check the slide potentiometer values, map them to the saturation range
slideVal = analogRead(slidePin);
mappedSlideVal = map(slideVal, 0, 1023, 0, 255);

//check switch
xState = analogRead(xPin);
yState = analogRead(yPin);
mappedXState = map(xState, 0, 1023, 0, 255);
mappedYState = map(yState, 0, 1023, 0, 255);

//check the ir values
irVal = analogRead(irPin);
mappedIrVal = map(irVal, 0, 550, 0, 8);

Serial.print(buttonOneState);
Serial.print(” “);
Serial.print(buttonTwoState);
Serial.print(” “);
Serial.print(buttonThreeState);
Serial.print(” “);
Serial.print(mappedPotVal);
Serial.print(” “);
Serial.print(mappedSlideVal);
Serial.print(” “);
Serial.print(mappedXState);
Serial.print(” “);
Serial.print(mappedYState);
Serial.print(” “);
Serial.println(mappedIrVal);
delay(50);
}

Control patch

bpatcher edits

video of working is too big sorry

heres the gist

Project 1 – Kevin Darr

I decided to make use of the MIDI Fighter 3D midi controller with built in accelerometer to control the lighting system in the Media Lab. The Fighter is being utilized as a drum machine which has kick, snare, hi-hats, crash, and a series of bass notes. The accelerometer channels control the lights as well as some digital effects on the drum machine, including distortion and reverb. When sent MIDI notes on the correct channel, the MIDI Fighter lights up on the appropriate button with color dependent on the velocity of the note. I used Ableton Live to send these MIDI messages, as well as play the samples for the drum machine. To get control and MIDI messages into Max, I used ctlin and notein objects. When tilted left or right, the MIDI Fighter as well as the overhead lights turn red based on how far the device is tilted. The same is true for forwards and backwards, but blue instead of red. The snare drum triggers a flash from the UV LEDs, and the bass notes trigger a green flash.

 

I had trouble screen capturing audio and video at the same time, so here is a short audio example of a drumbeat I played on the MIDI Fighter.

 

And here is a video of what the patch looks like, with added pwindows to imagine howthe lights in the media lab would react.

Continue reading