cindy321
Published © CC0

Reverse Headphones

I took earmuffs and modified it to play the chorus of "Say So" (by Doja Cat) when a button is pressed.

BeginnerFull instructions provided322
Reverse Headphones

Things used in this project

Story

Read more

Schematics

Schematics

Code

Reverse Headphones ("Say So")

Arduino
//Say So by Doja Cat

int buzzer = A3;
int buttonPin = A4;

int NOTE_B3 = 247;
int NOTE_C4 = 262;
int NOTE_CS4 = 277;
int NOTE_D4 = 294;
int NOTE_DS4 = 311;
int NOTE_E4 = 330;
int NOTE_F4 = 349;
int NOTE_FS4 = 370;
int NOTE_G4 = 392; 
int NOTE_GS4 = 415;
int NOTE_A4 = 440;
int NOTE_AS4 = 466;
int NOTE_B4 = 494;
int NOTE_C5 = 523;
int NOTE_CS5 = 554;
int NOTE_D5 = 587;
int NOTE_DS5 = 622;
int NOTE_E5 = 659;
int NOTE_F5 = 698;
int NOTE_FS5 = 740;
int NOTE_G5 = 784;
int NOTE_GS5 = 831;
int NOTE_A5 = 880;



//note length here

int whole = 2100;

int sixteenth = whole/16;
int eighth = whole/8;
int quarter = whole/4;
int half = whole/2;
int beat = 15;



void setup()
{
  // Set the buzzer pin to be an output:
  
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(buzzer, OUTPUT);
}

void loop()
{
  int buttonState;
  int switchState;

  // Read and save the states of the button and switch:

  buttonState = digitalRead(buttonPin);

  if (buttonState == LOW) // Check to see if buttonState is LOW (pressed) 
  {


  //Day to night to morning
  
  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(sixteenth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(sixteenth);





//Keep with me in the moment

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(sixteenth);

  tone(buzzer,NOTE_B3);
  delay(eighth);





  //I'd let you had I known it

  noTone(buzzer);
  delay(sixteenth);
  
  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(sixteenth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);
  





//Why don't you say so?

  noTone(buzzer);
  delay(sixteenth);
  
  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(quarter);

  tone(buzzer,NOTE_CS4);
  delay(quarter);
  
  noTone(buzzer);
  delay(quarter);





//Didn't even notice

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(sixteenth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(sixteenth);



//No punches left to roll with

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(sixteenth);

  tone(buzzer,NOTE_B3);
  delay(eighth);





  //You've got to keep me focused
  
  noTone(buzzer);
  delay(sixteenth);
  
  tone(buzzer,NOTE_FS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_E4);
  delay(sixteenth);

  tone(buzzer,NOTE_CS4);
  delay(eighth);



  //Why don't you say so?

  noTone(buzzer);
  delay(sixteenth);
  
  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  noTone(buzzer);
  delay(beat);

  tone(buzzer,NOTE_E4);
  delay(eighth);

  tone(buzzer,NOTE_FS4);
  delay(quarter);

  tone(buzzer,NOTE_CS4);
  delay(quarter);
  
  noTone(buzzer);
  delay(quarter);

}

 else
  {
    digitalWrite(buzzer,LOW); // If buttonState is HIGH (unpressed), turn off the buzzer
  }
}

Credits

cindy321
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.