Coffin Dance Music Using Arduino

by EDISON SCIENCE CORNER in Circuits > Arduino

1814 Views, 1 Favorites, 0 Comments

Coffin Dance Music Using Arduino

2020-07-09_08-32-20.jpg

In this tutorial I am how you can use an Arduino to make music using just with a speaker (no MP3 module required). First watch this video tutorial

Watch This Video Tutorial

Astronomia coffin dance music with Arduino | Arduino music | DIY

Hardware Needed

IMG_20200529_171500-01.jpeg

1.an Arduino

2.A speaker or a buzzer

Circuit Diagram

20200709_075522.jpg
IMG_20200529_171531-02.jpeg

Just connect one wire of the speaker to D8 of the arduino and other end to grond of arduino

How Does It Work?

The Arduino in this circuit creates tones of different frequencies and plays it through the speaker connected to it. The variation of the frequency of the tone(pitch) with correct timings(rhythm) creates music. The Arduino generates a signal and outputs it through the Digital pin 8. This drives the speaker connected to the pin to create sound.In this tutorial, I have programmed the Arduino to play a song ‘Astronomia coffin dance’.

How I Made Melody[ ] and NoteDurations[ ] of This Song:

IMG_20200530_203029.jpg

If you take a look at the program, you can find two int arrays: melody[ ] and noteDurations[ ]. The first array contains the notes and the second array contains its corresponding durations. I wrote down the musical notes of this song first and then wrote the melody[ ] array with that.

Then I wrote noteDurations[ ] according to the length of each music note. Here 8 = quarter note, 4 = 8th note, etc. A higher value gives longer duration notes. The note and its corresponding duration is what is there in melody[ ] and noteDurations[ ] respectively. You can modify those and create any song according to your ideas

Code and Library