Introduction: Arduino Chiptunes-Yet Again...Install an Arduino Library

I love chiptunes and so I had to have more. If you have read my Chiptunes Project you will know what I mean. 

Thank you to Drew Crawford for an awesome tune.

I will also teach you how to install an Arduino Library Code.

Here:





Step 1: Parts.

You will need:
3 1K resistors
1 Arduino Uno
1-3 Piezos/ Speakers
1 Audio Output Jack.
 
* I decided to make a shield but you don't have to. *

Step 2: Program and Install a Library

Take your Arduino and connect it to the computer.
  1. Unzip the zip file and inside, you should find two files. Ignore the demos for now.
  2. Go to bassdll.
  3. You should see 4 files. bassdll.cpp, bassdll.h, debug.cpp and debug.h. Basically if you see .cpp and .h files, take it as a library.
  4. Go outside the bassdll folder. Open your sketchbook folder and make a folder called libraries.
  5. Copy bassdll to the libraries folder in your sketchbook. 
  6. Now restart the Arduino IDE and go to Sketch-Import Library and then Contributed. Click on bassdll. If all went well, you should have two include statements at the top of your sketch. Now, close that sketch.
  7. Next, move demos to your sketchbook folder in your file browser.
  8. Open up the Arduino IDE and go to where you saved demos. Go to core2 and hit Verify.
  9.  It should compile correctly. Essentially, the code must be moved to your sketchbook folder and opened. The library helps it with defining things.
  10. Now, Upload.



Step 3: Build.

Follow the Fritzing schematic to build. The resistors should be 1k but they sadly are not. Fritzing does not have 1k resistors.

The 1k resistors are used to mix the output on one speaker. Otherwise, you could have three speakers/piezos.

I decided on a shield but that's optional.


Step 4: Listen.

When you power the Arduino up it should start playing. 

Hope you liked this ible and leave a comment if you have questions or, comments. :-)

Comments

author
kohellus made it! (author)2016-03-30

Had to make one, for the memories :) Added some leds too, always need some leds. but the audio was very quiet/low volume so i added an upgrade port for a lm386 amp. its detachable so i can use it for other projects too. great instructable thanks!

chiptunes.jpg
author
The Expert Noob made it! (author)2013-01-02

When compiling Im getting the following error:
core2:35: error: 'debug' was not declared in this scope

I did make sure the libraries were included. (opened the demo and compiled)

author
blinkyblinky made it! (author)blinkyblinky2013-01-02

Yep. I have gotten the same error before...most of my projects were written before Arduino 1.0 came out in which they made quite a few changes...this code hasn't been ported over to 1.0 and beyond. I still use Arduino 0022 for maximum compatibility but I do have 1.0.1 as well. With codes that are already written there are some required libraries that have changed names and some commands. Most notably, WProgam.h became, I believe Arduino.h...I have tried adding both libraries into the same Arduino folder but that failed...so I would just stick with an older version of Arduino...

I tried this at a friend's house and it totally failed giving the same exact problem. The code hasn't been ported over yet so just get your hands on an old copy of Arduino and program it from that.

author
The Expert Noob made it! (author)The Expert Noob2013-01-02

Thanks for the fast response. That was the problem. Now that I have it working I'll dig into the code and see what I can come up with.

author
blinkyblinky made it! (author)blinkyblinky2013-01-02

No problem.

author
mpacheco12 made it! (author)2012-09-29

Awesome project! but how can i listen to other songs? how can i convert maybe tetris theme to a playable format?

author
Bongmaster made it! (author)2012-03-01

how about an SD card holding ASCII files containing the tunes and having the arduino play them like a jukebox X3
would be kool to have some of the olde classics form c64 and the like ;)

author
blinkyblinky made it! (author)blinkyblinky2012-03-01

How about the waveshield from Adafruit?

author
Bongmaster made it! (author)Bongmaster2012-03-07

all u need is the sd reader, waveshield would be a bit much wont it?

author
blinkyblinky made it! (author)blinkyblinky2012-03-07

I'm not really that good of a code writer. I mean I am good but not good enough to write code with SD cards. I will try it out though...

author
powerman666 made it! (author)powerman6662012-08-29

I made an SD card program for arduino that just might do such a thing. https://www.instructables.com/id/Arduino-Tone-Generator-SD-Log-Then-Playback/

author
erenjay made it! (author)2012-04-18

Nice instructable ^_^
could you please upload a slightly bigger/more zoomed in schematic? when I try and zoom in with the browser, the pic is too low res to show anything.

author
blinkyblinky made it! (author)blinkyblinky2012-04-18

Don't know why there is no "i" but do you have Fritzing? If you do I have the file on the ible. However, here is the schmatic anyway:

You need a 1K resistor on Pin 10, 11, and 12.

Then connect the ends of the resistors together. Here:

Pin 10----------------------1 KiloOhm Resistor-----------------|
---------------------------------------------------------------------------|
Pin 11----------------------1 KiloOhm Resistor-----------------|--------------To Speaker
---------------------------------------------------------------------------|NC NC NC NC |
Pin 12----------------------1 KiloOhm Resistor-----------------|NC NC NC NC |
---------------------------------------------------------------------------------------To Ground

Hope this helps.
NC stands for the fact that there should be no Connection.

author
erenjay made it! (author)erenjay2012-04-18

oops, missed the link. Thank you.

About This Instructable

6,582views

33favorites

License:

Bio: I love building things and taking pictures. If you want me to build something...I'm open to ideas. My motto? "If you want something ... More »
More by blinkyblinky:Keeping Up Appearances with ChindoguA Complete Beginner's Guide to Raw Files And Raw ProcessingHypercard - An Impossible Paper Object
Add instructable to: