GlauberSantiago
Published © CC BY-NC

Brasileirinho tone

Arduino playing the Waldir Azevedo's musical theme "Brasileirinho" with the tone function and with a speaker.

BeginnerShowcase (no instructions)1,983
Brasileirinho tone

Things used in this project

Story

Read more

Schematics

https://www.tinkercad.com circuit

Code

Brasileirinho Tone

Arduino
To open the file with Arduino IDE.
/**
   Peça musical executada pela função Tone do Arduino. Execução monofônica. (Musical piece performed by Arduino Tone function. Monophonic playback.)
   Título(Title): Brasileirinho.
   Música (Music): Waldir Azevedo.
   Arranjo (Arrangement): Glauber Santiago.
   Circuito (Circuit): Autofalante de 8 ohm no pino 4 (8 ohm speaker on digital pin 8).
   MIDI-Arduino Sequencing code generator
   Courtesy of http://greenlightgo.org/projects/midi-to-arduino/
   A peça será executada uma vez apenas. Its will be executed once only.
 **/

#define msPerTick 0.4 //Andamento(Tempo)

void setup() {
  pinMode(4, OUTPUT);

  doPerformance();
}

void loop() {
}

void doPerformance() {
  tone(4, 494);

  delay(102 * msPerTick);

  noTone(4);

  delay(154 * msPerTick);

  tone(4, 494);

  delay(205 * msPerTick);

  noTone(4);

  delay(307 * msPerTick);

  tone(4, 494);

  delay(102 * msPerTick);

  noTone(4);

  delay(410 * msPerTick);

  tone(4, 392);

  delay(205 * msPerTick);

  noTone(4);

  delay(307 * msPerTick);

  tone(4, 494);

  delay(102 * msPerTick);

  noTone(4);

  delay(154 * msPerTick);

  tone(4, 587);

  delay(205 * msPerTick);

  noTone(4);

  delay(819 * msPerTick);

  tone(4, 294);

  delay(205 * msPerTick);

  noTone(4);

  delay(819 * msPerTick);

  tone(4, 147);

  delay(205 * msPerTick);

  noTone(4);

  delay(307 * msPerTick);

  tone(4, 988);

  delay(512 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(512 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(384 * msPerTick);

  tone(4, 196);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 196);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 196);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 196);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 196);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 196);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 294);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 880);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 831);

  delay(128 * msPerTick);

  tone(4, 392);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 233);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 294);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 233);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 294);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 233);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 294);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 233);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 294);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 196);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 185);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 165);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 196);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(128 * msPerTick);

  tone(4, 175);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 156);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 196);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 185);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 165);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 988);

  delay(128 * msPerTick);

  tone(4, 147);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 988);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 932);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 880);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 831);

  delay(128 * msPerTick);

  tone(4, 98);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 247);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 233);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 220);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 208);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 196);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 185);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 165);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 147);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 98);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 698);

  delay(128 * msPerTick);

  tone(4, 294);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 740);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 698);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 220);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 698);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 740);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 698);

  delay(128 * msPerTick);

  tone(4, 294);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 698);

  delay(128 * msPerTick);

  tone(4, 220);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 740);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 698);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 294);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 740);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 587);

  delay(128 * msPerTick);

  tone(4, 196);

  delay(128 * msPerTick);

  noTone(4);
  noTone(4);
  tone(4, 784);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 740);

  delay(256 * msPerTick);

  noTone(4);
  tone(4, 659);

  delay(256 * msPerTick);
...

This file has been truncated, please download it to see its full contents.

Credits

Glauber Santiago

Posted by GlauberSantiago

Comments

Please log in or sign up to comment.