Good Vibes

Made by Diana Sun

To create a new way to experience music and to bring surprises into making music

Created: December 21st, 2015

0

Good Vibes is a project about creating a new and fun way to experience music. The product is a vest with many vibration motors sewed within, and each of them are a part of a variety of patterns that are activated by different sounds. Each sound is linked to either a sequence of vibrations or a combination of different motors that activate simultaneously. The chosen sounds are not the typical notes found in musical instruments, but rather a collage of different sounds, making the audible experience a new one as well. When a user presses a key on the launchpad, processing determines which key was pressed, and plays the right audio file and sends an output to the right motors. 

From this project I learned 1) that sewing a vest is harder than it seems 2)how to connect a Novation launchpad to processing 3)how to use the minim library

If I had 3 more weeks to remake my project, I think it would be fun to have 2 vests, to be used by friends. One friend would control the vest of the other person and vice versa. Not only would this still be a tactile way to experience sound but also a fun way to interact with friends and create music together.

0
Good Vibes
Diana Sun - https://vimeo.com/149779917
0
import processing.serial.*;
import org.firmata.*;
import cc.arduino.*;

import themidibus.*;
import ddf.minim.*;

//to play multiple tracks simultaneously
Minim minim2;
Minim minim3;
Minim minim4;
Minim minim5;
Minim minim6;
Minim minim7;
Minim minim8;
Minim minim9;
Minim minim10;
Minim minim11;

//name of audioplayers
AudioPlayer player2;
AudioPlayer player3;
AudioPlayer player4;
AudioPlayer player5;
AudioPlayer player6;
AudioPlayer player7;
AudioPlayer player8;
AudioPlayer player9;
AudioPlayer player10;
AudioPlayer player11;

MidiBus myBus;       //name of minibus

Arduino myarduino;   //name of arduino

void setup() {
  size(400, 400, P3D);
  background(#D7FFCE);
  
  println(Arduino.list());
  myarduino = new Arduino(this, Arduino.list()[0], 57600);
  
  myarduino.pinMode(2, Arduino.OUTPUT);                       //output pin 6
  myarduino.pinMode(3, Arduino.OUTPUT);
  myarduino.pinMode(4, Arduino.OUTPUT);
  myarduino.pinMode(5, Arduino.OUTPUT);
  myarduino.pinMode(6, Arduino.OUTPUT);
  myarduino.pinMode(7, Arduino.OUTPUT);
  myarduino.pinMode(8, Arduino.OUTPUT);
  myarduino.pinMode(9, Arduino.OUTPUT);
  myarduino.pinMode(10, Arduino.OUTPUT);
  myarduino.pinMode(11, Arduino.OUTPUT);
  myarduino.pinMode(12, Arduino.OUTPUT);
  myarduino.pinMode(13, Arduino.OUTPUT);
  
  MidiBus.list(); // List all available Midi devices on STDOUT. This will show each device's index and name.
  
  // Either you can
  //                   Parent In Out
  //                     |    |  |
  //myBus = new MidiBus(this, 0, 1); // Create a new MidiBus using the device index to select the Midi input and output devices respectively.

  // or you can ...
  //                   Parent         In                   Out
  //                     |            |                     |
  //myBus = new MidiBus(this, "IncomingDeviceName", "OutgoingDeviceName"); // Create a new MidiBus using the device names to select the Midi input and output devices respectively.

  // or for testing you could ...
  //                 Parent  In        Out
  //                   |     |          |
  myBus = new MidiBus(this, "Launchpad Mini", "Launchpad Mini"); // Create a new MidiBus with no input device and the default Java Sound Synthesizer as the output device.

  minim2 = new Minim(this);
  minim3 = new Minim(this);
  minim4 = new Minim(this);
  minim5 = new Minim(this);
  minim6 = new Minim(this);
  minim7 = new Minim(this);
  minim8 = new Minim(this);
  minim9 = new Minim(this);
  minim10 = new Minim(this);
  minim11 = new Minim(this);
  player2 = minim2.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound2.mp3");    //file 1
  player3 = minim3.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound3.mp3");
  player4 = minim4.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound4.mp3");
  player5 = minim5.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound5.mp3");
  player6 = minim6.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound6.mp3");
  player7 = minim7.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound7.mp3");
  player8 = minim8.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound8.mp3");
  player9 = minim9.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound9.mp3");
  player10= minim10.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound10.mp3");
  player11= minim11.loadFile("/Users/Diana/Dropbox/College/Junior Year/Making Things Interactive/BasicYAAS/sounds/sound11.mp3");

}

int value = 90;

void draw() {
  int channel = 0;
  int pitch = 60;
  int velocity = 127;
                                                //blink a note
  //myBus.sendNoteOn(channel, pitch, velocity); // Send a Midi noteOn
  //delay(200);
  //myBus.sendNoteOff(channel, pitch, velocity); // Send a Midi nodeOff

  int number = 0;

  myBus.sendControllerChange(channel, number, value); //Send a controllerChange
  delay(1000);
  background(#D7FFCE);
  stroke(#0C51AF);
  for(int i = 0; i < player2.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player2.bufferSize(), 0, width );
    float x2 = map( i+1, 0, player2.bufferSize(), 0, width );
    line( x1, 50 + player2.left.get(i)*50, x2, 50 + player2.left.get(i+1)*50 );
    line( x1, 150 + player2.right.get(i)*50, x2, 150 + player2.right.get(i+1)*50 );
  }
}

void noteOn(int channel, int pitch, int velocity) {
  // Receive a noteOn
  int value=90;
  println();
  println("Note On:");
  println("--------");
  println("Channel:"+channel);
  println("Pitch:"+pitch);
  println("Velocity:"+velocity);
  myBus.sendNoteOn(channel, pitch, velocity); // Send a controllerChange
  
  if (pitch == 0 || pitch == 18 || pitch == 36 || pitch == 54  || pitch == 80 || pitch == 98 || pitch == 116) {
    player2.play();
    player2.rewind();
    player2.loop();
    
    myarduino.digitalWrite(8, Arduino.HIGH);    // Turn vibe motor on
  }  
  
  if (pitch == 1 || pitch == 19 || pitch == 37 || pitch == 55 || pitch == 81 || pitch == 99 || pitch == 117) {
    player3.play();
    player3.rewind();
    player3.loop();
    
    myarduino.digitalWrite(7, Arduino.HIGH);    // Turn vibe motor on
    delay(200);
    myarduino.digitalWrite(7, Arduino.LOW);
    myarduino.digitalWrite(8, Arduino.HIGH);
    delay(200);
    myarduino.digitalWrite(8, Arduino.LOW);
    myarduino.digitalWrite(11, Arduino.HIGH);
    delay(200);
    myarduino.digitalWrite(11, Arduino.LOW);
    myarduino.digitalWrite(12, Arduino.HIGH);
  }  
  
  if (pitch == 2 || pitch == 20 || pitch == 38 || pitch == 64 || pitch == 82 || pitch == 100 || pitch == 118) {
    player4.play();
    player4.rewind();
    player4.loop();
    
    myarduino.digitalWrite(3, Arduino.HIGH);
    myarduino.digitalWrite(13, Arduino.HIGH);
  }  
  
  if (pitch == 3 || pitch == 21 || pitch == 39 || pitch == 65 || pitch == 83 || pitch == 101 || pitch == 119) {
    player5.play();
    player5.rewind();
    player5.loop();
    
    myarduino.digitalWrite(4, Arduino.HIGH);    // Turn vibe motor on
    delay(200);
    myarduino.digitalWrite(4, Arduino.LOW);
    myarduino.digitalWrite(5, Arduino.HIGH);
    delay(200);
    myarduino.digitalWrite(5, Arduino.LOW);
  }  
  
  if (pitch == 4 || pitch == 22 || pitch == 48 || pitch == 66 || pitch == 84 || pitch == 102) {
    player6.play();
    player6.rewind();
    player6.loop();
    
    myarduino.digitalWrite(2, Arduino.HIGH);
    myarduino.digitalWrite(10, Arduino.HIGH);
  }  
  
  if (pitch == 5 || pitch == 23 || pitch == 49 || pitch == 67 || pitch == 85 || pitch == 103) {
    player7.play();
    player7.rewind();
    player7.loop();
    
    myarduino.digitalWrite(6, Arduino.HIGH);
    myarduino.digitalWrite(7, Arduino.HIGH);
    myarduino.digitalWrite(5, Arduino.HIGH);
    myarduino.digitalWrite(13, Arduino.HIGH);
  }  
  
  if (pitch == 6 || pitch == 32 || pitch == 50 || pitch == 68 || pitch == 86 || pitch == 112) {
    player8.play();
    player8.rewind();
    player8.loop();
    
    myarduino.digitalWrite(9, Arduino.HIGH);
  }  
  
  if (pitch == 7 || pitch == 33 || pitch == 51 || pitch == 69 || pitch == 87 || pitch == 113) {
    player9.play();
    player9.rewind();
    player9.loop();
    
    myarduino.digitalWrite(3, Arduino.HIGH);    
    delay(200);
    myarduino.digitalWrite(3, Arduino.LOW);
    myarduino.digitalWrite(9, Arduino.HIGH);
    delay(200);
    myarduino.digitalWrite(9, Arduino.LOW);
  }  
  
  if (pitch == 16 || pitch == 34 || pitch == 52 || pitch == 70 || pitch == 96 || pitch == 114) {
    player10.play();
    player10.rewind();
    player10.loop();
    
    myarduino.digitalWrite(11, Arduino.HIGH);
  }  
  
  if (pitch == 17 || pitch == 35 || pitch == 53 || pitch == 71 || pitch == 97 || pitch == 115) {
    player11.play();
    player11.rewind();
    player11.loop();
    
    myarduino.digitalWrite(9, Arduino.HIGH);    
    delay(200);
    myarduino.digitalWrite(9, Arduino.LOW);
    myarduino.digitalWrite(11, Arduino.HIGH);
    delay(200);
    myarduino.digitalWrite(11, Arduino.LOW);
  }  
}

void noteOff(int channel, int pitch, int velocity) {
  // Receive a noteOff
  println();
  println("Note Off:");
  println("--------");
  println("Channel:"+channel);
  println("Pitch:"+pitch);
  println("Velocity:"+velocity);
  myBus.sendNoteOff(channel, pitch, velocity); // Send a Midi nodeOff
  if (pitch == 0 || pitch == 18 || pitch == 36 || pitch == 54  || pitch == 80 || pitch == 98 || pitch == 116) {
    player2.pause();
    myarduino.digitalWrite(8, Arduino.LOW);      //Turn vibe off
  }
  if (pitch == 1 || pitch == 19 || pitch == 37 || pitch == 55 || pitch == 81 || pitch == 99 || pitch == 117) {
    player3.pause();
    myarduino.digitalWrite(7, Arduino.LOW);    
    myarduino.digitalWrite(8, Arduino.LOW); 
    myarduino.digitalWrite(11, Arduino.LOW); 
    myarduino.digitalWrite(12, Arduino.LOW); 
  }
  
  if (pitch == 2 || pitch == 20 || pitch == 38 || pitch == 64 || pitch == 82 || pitch == 100 || pitch == 118) {
    player4.pause();
    
    myarduino.digitalWrite(3, Arduino.LOW);
    myarduino.digitalWrite(13, Arduino.LOW);
  }  
  
  if (pitch == 3 || pitch == 21 || pitch == 39 || pitch == 65 || pitch == 83 || pitch == 101 || pitch == 119) {
    player5.pause();
    
    myarduino.digitalWrite(4, Arduino.LOW);
    myarduino.digitalWrite(5, Arduino.LOW);
  }  
  
  if (pitch == 4 || pitch == 22 || pitch == 48 || pitch == 66 || pitch == 84 || pitch == 102) {
    player6.pause();
    
    myarduino.digitalWrite(2, Arduino.LOW);
    myarduino.digitalWrite(10, Arduino.LOW);
  }  
  
  if (pitch == 5 || pitch == 23 || pitch == 49 || pitch == 67 || pitch == 85 || pitch == 103) {
    player7.pause();
    
    myarduino.digitalWrite(6, Arduino.LOW);
    myarduino.digitalWrite(7, Arduino.LOW);
    myarduino.digitalWrite(5, Arduino.LOW);
    myarduino.digitalWrite(13, Arduino.LOW);
  }
  
  if (pitch == 6 || pitch == 32 || pitch == 50 || pitch == 68 || pitch == 86 || pitch == 112) {
    player8.pause();
    
    myarduino.digitalWrite(9, Arduino.LOW);
  }  
  
  if (pitch == 7 || pitch == 33 || pitch == 51 || pitch == 69 || pitch == 87 || pitch == 113) {
    player9.pause();
    
    myarduino.digitalWrite(3, Arduino.LOW);
    myarduino.digitalWrite(9, Arduino.LOW);
  }  
  
  if (pitch == 16 || pitch == 34 || pitch == 52 || pitch == 70 || pitch == 96 || pitch == 114) {
    player10.pause();
    
    myarduino.digitalWrite(11, Arduino.LOW);
  }  
  
  if (pitch == 17 || pitch == 35 || pitch == 53 || pitch == 71 || pitch == 97 || pitch == 115) {
    player11.pause();
    
    myarduino.digitalWrite(9, Arduino.LOW);
    myarduino.digitalWrite(11, Arduino.LOW);
  }  
}

void controllerChange(int channel, int number, int value) {
  // Receive a controllerChange
  println();
  println("Controller Change:");
  println("--------");
  println("Channel:"+channel);
  println("Number:"+number);
  println("Value:"+value);
}

void delay(int time) {
  int current = millis();
  while (millis () < current+time) Thread.yield();
}
Click to Expand
x
Share this Project

Courses

48-739 Making Things Interactive

· 0 members

Making Things Interactive (MTI) is a studio course based on physical prototyping and computing. You will develop novel sensing, interaction and display techniques through projects and short assignm...more


About

To create a new way to experience music and to bring surprises into making music