— AlexiaKay

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:
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);

sensorValue2 = analogRead(sensorPin2);
int mappedForce2 = map(sensorValue2, 0, 1023, 0, 255);

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


Link to P5 code

Submit comment