Pete Miao's profile

IAT 320 Digital Conductor

The Original idea was to map the acceleration of the conductor's gestures in order to create a similar effect to conducting. However, as time went on, the limits on the program and what it can or can not do made this concept hard to do without a gyro. Through these difficulties, an epiphany came to mind: If music is considered an art form, would a conductor be considered an artist? My answer to this was yes. Furthermore, the gestures of the conductor are not sporatic, but meticulous like a painter. So with this correlation, another output was created, the screen.
When considering the kind of art that the gradient would be drawn as, I decided to go with a similar style to Georges Seurat, because of the way processing animates objects. In processing, the animation goes frame by frame, similar to Seurat's style of Pointillism, in which an image is created with meticulous dots of colour.
Sketches:
Conceptual Mapping
 
These are the form cross sections. Originally there was supposed to be a handle, but when building the physical tangible, I found that the plug for the cable can be used to hold the tangible in place. The form also required to be simple and reliable in order to make it look better and to ensure that the sensor can reliably give readings.
Compromises:
Overestimating the ability of processing 3s new sound library (which couldn't function for some reason), sound was played through minim. There was also the matter of what minim could and could not do. As minim was unable to speed or slow the tempo of the music, the decision was made to increase the sound of a part based on the acceleration of either side.
Arduino / processing code:
 
Arduino:
//from tutorial: https://www.arduino.cc/en/Tutorial/VirtualColorMixer
 
const int redPin = A0;      // sensor to control red color
const int greenPin = A1;    // sensor to control green color
const int bluePin = A2;     // sensor to control blue color
void setup() {
  Serial.begin(9600);
}
void loop() {
  Serial.print(analogRead(redPin));
  Serial.print(",");
  Serial.print(analogRead(greenPin));
  Serial.print(",");
  Serial.println(analogRead(bluePin));
 
}
 
Processing 3 code:
 
//minim library downloaded from processing 3 add library feature
//arduino to processing serial communication code from https://www.arduino.cc/en/Tutorial/VirtualColorMixer
//music converted from: http://www.kunstderfuge.com/sousa.htm
//MIDI file to MP3 file converter: http://www.conversion-tool.com/midi?id=23483c3f453e273a6a7af2692a7993d0bc205347#result
 
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
import processing.serial.*;
 
//music
Minim minim;
AudioPlayer v1;
AudioPlayer v2;
AudioPlayer v3;
boolean Volume;
 
//values from accelerometer
float redValue = 0;        // red value
float greenValue = 0;      // green value
float blueValue = 0;       // blue value
Serial myPort;
void setup() {
  size(800, 800);
 
  minim = new Minim(this);
  v1 = minim.loadFile("Sousa2.mp3");
  v2 = minim.loadFile("SousaBass.wav");
  v3 = minim.loadFile("SousaTreble.wav");
 
  v1.loop();
  v2.loop();
  v3.loop();
 
  // List all the available serial ports
  // if using Processing 2.1 or later, use Serial.printArray()
  println(Serial.list());
  // I know that the first port in the serial list on my mac
  // is always my  Arduino, so I open Serial.list()[0].
  // Open whatever port is the one you're using.
  myPort = new Serial(this, Serial.list()[1], 9600);
  // don't generate a serialEvent() unless you get a newline character:
  myPort.bufferUntil('\n');
}
void draw() {
  // modified from set background to set the color of the circles with the color values:
  fill(redValue, greenValue, blueValue);
  noStroke();
  ellipse(redValue*8,greenValue*8,80,80);
 
  //set volume (ironically, setVolume function doesn't work)
  v1.setGain(-20);
 
 // make both tracks louder
  if(greenValue >80){
    v2.setGain(-20);
    v3.setGain(1);
  } else {
    v2.setGain(-20);
    v3.setGain(-20);
  }
 
//increase volume of the bass
  if(redValue < 90 && greenValue < 80){
    v2.setGain(-20);
    v3.setGain(-10);
  }
 
  //increase volume of the treble
  if(redValue > 90 && greenValue <80){
    v2.setGain(-10);
    v3.setGain(-20);
  }
  
  //used to help calibrate values
  println(redValue);
  //println(greenValue);
  //println(blueValue);
 
}
void serialEvent(Serial myPort) {
  // get the ASCII string:
  String inString = myPort.readStringUntil('\n');
  if (inString != null) {
    // trim off any whitespace:
    inString = trim(inString);
    // split the string on the commas and convert the
    // resulting substrings into an integer array:
    float[] colors = float(split(inString, ","));
    // if the array has at least three elements, you know
    // you got the whole thing.  Put the numbers in the
    // color variables:
    if (colors.length >=3) {
      // map them to the range 0-255:
      redValue = map(colors[0], 0, 1023, 0, 255);
      greenValue = map(colors[1], 0, 1023, 0, 255);
      blueValue = map(colors[2], 0, 1023, 0, 255);
    }
  }
}
Final Form:
Future improvements:
 
If this project would be further developed, I would have replaced the accelerometer with a gyro/accelerometer hybrid for better control. I would also try to find a different arduino compatable program to play the music. I would also make it so that the x axis (horizontal) position would play a more effective role than this  current iteration. Instead of one song, I would create a playlist of songs, ranging from sad to funny tunes.
 
 
IAT 320 Digital Conductor
Published:

IAT 320 Digital Conductor

For IAT 320. Assignment 3.

Published:

Creative Fields