How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino

Hello there everyone, Pure Carbon is back with another Instructable. The last month I've been working hard to get my YouTube channel up and going. It has been hard, so I haven't been able to make as many Instructables as I used to and I apologize for that, but if you want to check out my channel click the link here:

https://www.youtube.com/channel/UCp1Iy_qqZl-TBWrwOIE5ALw

In this Instructable I will be showing you guys how to play the song Scary Monster and Nice Sprites on an Arduino if you've never heard the song before I recommend you go check out because it's awesome. If you've ever worked with Arduino before then this project will be easy for you. If not then the first thing you should do is go here and download the Arduino IDE software. This will allow you to upload the script that I wrote as well as write your own scripts. The next thing you'll have to do is purchase an Arduino. I recommend the uno which you can purchase here which will cost you about $25. If your feeling adventurous then I recommend purchasing the Funduino Mega which costs $15 and has way more pins, this is the one that I've been using and I have no complaints.

I hope you like this Instructable, be sure to follow to me for many more instructables like this one coming soon and go to my YouTube channel and subscribe to me there, also if you like this then be sure to favorite it. If you have any questions or comments then be sure to leave them below, I'm very good at responding and if I don't right away then just be patient and I will respond to you soon, thank you.

Step 1:

How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino

Here's what you will need to make this:

  • An Arduino (Uno, Mega, Micro, etc)
  • A small speaker (I used a piezo buzzer which can be purchased here)
  • A USB cable to upload the code to your arduino
  • The Arduino IDE software already installed on your computer

    Step 2:

    How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino
    How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino

    First to start you will need to connect the speaker to ground and pin 11 as shone in the picture. If you connect it to any other pins besides 11 it wont work, this step is very easy.

    Step 3:

    How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino

    Next copy The following:

    #include "pitches.h"

    int melody[] = {
    NOTE_E3, NOTE_E4, NOTE_D4, NOTE_E4, NOTE_G4, NOTE_D4, NOTE_B4, NOTE_A4, NOTE_G4, NOTE_D4, NOTE_D4, NOTE_C4, NOTE_B3, NOTE_G3, NOTE_E3, NOTE_D3, NOTE_E3, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_G4, NOTE_E4, NOTE_D5,
    NOTE_E4, NOTE_D4, NOTE_E4, NOTE_G4, NOTE_D4, NOTE_B4, NOTE_A4, NOTE_G4, NOTE_D4, NOTE_D4, NOTE_C4, NOTE_B3, NOTE_G3, NOTE_E3, NOTE_D3, NOTE_E3, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_G4, NOTE_E4, NOTE_D5,
    NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_G3, NOTE_A3, NOTE_B3, NOTE_D4, NOTE_B3, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_G3,NOTE_G3, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, NOTE_FS3, NOTE_E3,
    NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_G3, NOTE_A3, NOTE_B3, NOTE_D4, NOTE_B3, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_G3,NOTE_G3, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_G3,0,
    NOTE_E1, NOTE_A2, NOTE_E1, NOTE_E1, NOTE_E1, NOTE_E1,
    NOTE_E1, NOTE_A2, NOTE_E1, NOTE_E1, NOTE_E1, NOTE_E1,
    };

    int noteDurations[] = {
    6,6,6,6,3,6,6,6,6,3,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,
    6,6,6,3,6,6,6,6,3,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,
    6,6,6,2,2,6,6,6,6,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
    6,6,6,2,2,6,6,6,6,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,2,
    1,2,4,4,1,1,
    1,2,4,4,1,1,
    };
    void setup() {
    for (int thisNote = 0; thisNote < 120; thisNote++) {
    int noteDuration = 1000/noteDurations[thisNote];
    tone(11, melody[thisNote],noteDuration);
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    noTone(11);
    }
    }
    void loop() {
    }

    and paste it to the Arduino software.

    Step 4:

    How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino

    Next hook up your Arduino via USB, then click the upload button located in the top left corner. It will look like an arrow pointing towards the right side of your screen.

    Step 5:

    How to Play the Song Scary Monsters and Nice Sprites by Skrillex on an Arduino

    If everything went ok then you should see some lights flashing on the Arduino, this means that it worked and you should start to hear music playing. Thanks for checking out my Instructable, if you like this Instructable then be sure to favorite it and follow me for many more like this coming soon. Also subscribe to me on youtube here.

  •  
     

    Tag cloud

    make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel