Coke melodies

Inspired by the ICM+PCom synthesis I wanted to create a coke piano since I am a huge fan of coca-cola. I used melodies from coke ads and coke jingles as well as the characteristic sound of a coke can being opened and poured in a glass. I sticked a pressure sensor on each can so every time one presses the sensor a different coke sound is played. Unfortunately, the sound that was playing from P5 was a little bit distorted and replayed the sound 2 times on top of each other. I tried increasing the delay and it helped a little bit but not completely.

Coke melodies with arduino from ALEXIA KYRIAKOPOULOU on Vimeo.

int sensorPin = A0; // select the input pin for the potentiometer
int sensorPin2= A1;
int sensorPin3 = A2;
// select the pin for the LED
int sensorValue; // variable to store the value coming from the sensor
int sensorValue2;
int sensorValue3;

void setup() {
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
pinMode(sensorPin, INPUT);
pinMode(sensorPin2, INPUT);
pinMode(sensorPin3, INPUT);
}

void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
int mappedForce = map(sensorValue, 0, 1023, 0, 255);
Serial.print(mappedForce);
Serial.print(“,”);

sensorValue2 = analogRead(sensorPin2);
int mappedForce2 = map(sensorValue2, 0, 1023, 0, 255);
Serial.print(mappedForce2);
Serial.print(“,”);

sensorValue3 = analogRead(sensorPin3);
int mappedForce3 = map(sensorValue3, 0, 1023, 0, 255);
Serial.println(mappedForce3);

delay(1500);

Link to P5 code

Leave a Reply

Your email address will not be published. Required fields are marked *