Synthesis: Invent a music instrument

Yuetian Wang
4 min readNov 16, 2021

--

Group members: Benal Johnson, Jack Delarosa, Alex Gao, Yuetian Wang, Rita Ling, Kathy Yuting Wang, Faezeh Taghva

Description

In these two weeks, we did our last lab, which aims to use what we learned from the class, including input devices, output devices, mechanics, during this semester to create a musical instrument. After brainstorming, we decided to make an instrument that’s composed of three parts: the Guitar Disc, the Foot Mat, and the Photocell Volume Controller. The way this instrument works is that it is collaborative: the guitar disc only spins if someone is interacting with the foot mat. The photocell volume controller is an enclosure around the photocell that controls the volume of the sounds emitted from the Foot Mat. There are different laser-etched slides that users can insert into the enclosure to occlude the light, which creates variance in the level of sound.

Components

  • Guitar string & pick
  • Yoga mat
  • Plywood (for laser cutting)
  • Screw
  • Footmat
  • Arduino
  • Wires
  • Breadboard
  • Resistors
  • FSRs
  • Photocell
  • Clear arcylic

Part 1- Foot mat

Alex + Kathy

Foot mat is our first instrument. To make it, we used the yoga mat and put two FSR under the yoga mat. When people stand on the yoga mat, the footsteps can be sensed by the FSRs. Each FSR activates a different drum sound through Processing and Audacity, and moves the servo controlling the guitar disc in a different direction. In this way, a walking motion can create a boom-bap beat while also plucking the guitar strings in a different order with each beat. For demonstration, however, we may not actually put this under a mat, since we’re worried about the consistency of the FSRs, especially under high pressure.

Other explorations: Previously, the code calculated the BPM of the FSRs and would control the rotation speed of a DC motor based on that. However, this exploration proved fruitless when the guitar string instrument (presented in part 2) was found to not work well with a DC motor, so we switched last minute to a simpler servo version (code still included, but commented out). We also explored using Processing’s Client() library to send messages to a Python server to do BPM analysis.

Part 2- Guitar Disc Instrument

Benny + Faezeh

The guitar disc is composed of two parts, the guitar turntable and guitar pick.

To make the guitar turntable, we laser-cut a round plate, and cut small holes on the periphery of the plate where screws can tighten on. Meanwhile, we put some screws around the center of the plate, and then installed some strings between the screws on the center and edges of the plate. These strings are all wound tight and have different lengths to create different frequencies of sound.

Under the plate is a DC motor that make the guitar turntable spin. When the turntable spins, the pick plucks the strings, and strings of different lengths emit various sounds of different frequencies.

We ended up changing out the DC motor for a servo after realizing that the DC motor is overtorqued by the weight of the turntable. We quickly redesigned the plate

Part 3 Photocell Volume Controller

Benny

To make the photocell volume controller, we laser-cut a box as the enclosure and laser cut and etched some different plates to occlude or show the light. Different plates increase or decrease the volume of the FSR mat instrument based on which plate is inserted into the enclosure.

Code

Not included is the modification of the StandardFirmata sketch; it requires manually setting the “maxServos” variable to >=1; otherwise, Processing will not be able to find any servos.

Also not included is the sourcing for the drum effect mp3s; they were just download from a drum effects website and cut to 200ms in Audacity.

```

import processing.sound.*;

import processing.serial.*;

import cc.arduino.*;

import processing.net.*;

Arduino arduino;

//put your audio file name here

String snareAudio = “snare.mp3”;

String kickAudio = “kick.mp3”;

String snarePath = sketchPath(snareAudio);

int snareDelay = 250;

String kickPath = sketchPath(kickAudio);

int kickDelay = 250;

SoundFile snareFile;

SoundFile kickFile;

float overallVolume = 0.5;

int photocellValue;

int timer = millis();

int numBeats = 0;

int bpm = 60;

int servoAngle = 0;

//runs once when the app first starts

void setup() {

arduino = new Arduino(this, Arduino.list()[0], 57600);

snareFile = new SoundFile(this, snareAudio);

kickFile = new SoundFile(this, kickAudio);

//myClient = new Client(this, “127.0.0.1”, 8888);

for (int i = 0; i <= 13; i++)

if (i == 4) {

arduino.pinMode(4, Arduino.SERVO);

} else {

arduino.pinMode(i, Arduino.INPUT);

}

}

//runs all the time, this is the main app loop

void draw() {

photocellValue = arduino.analogRead(2);

overallVolume = map(photocellValue, 210, 500, 0.0, 1.0);

//if (millis() — timer > 5000){

// bpm = numBeats*6;

// numBeats = 0;

// timer = millis();

//}

if ((arduino.analogRead(1) > 500) && !snareFile.isPlaying()){

snareFile.amp(overallVolume);

snareFile.play();

arduino.servoWrite(4, 180);

servoAngle = servoAngle — 10;

//numBeats++;

}

if ((arduino.analogRead(0) > 500) && !kickFile.isPlaying()){

kickFile.amp(overallVolume);

kickFile.play();

arduino.servoWrite(4, 0);

servoAngle = servoAngle + 10;

//numBeats++;

}

}

```

Videos

--

--