I am not a big fan of programming. I may like it but, I try to keep it down to a 555 timer like in this ible. However, when it comes to synths, well, I just NEED programming. One day, while exploring Synthesizers, I came across something known as chiptunes.

I decided to listen and found the music just totally awesome. And so I tried to make it with Arduino. Unfortunately, it didn't fit the Arduino code. Fortunately, Stimmer in the Arduino Forums had ported Linus Åkesson's Hardware Chiptune Project and made it to fit the Arduino.


And now, here is that project.

Step 1: Gains and Losses.

You will gain:
A machine capable of playing a tune every time you push a button to activate it.

You will lose: (Materials)
An Arduino
A speaker+possibly an amp
2 jumper wires (If your speaker doesn't already have them)
sir can I have a downloadable file for second code
sir can I have a downloadable file for second code
<p>It sounds like the mid of giana sisters ;-) A game on commodore C-64!!</p>
i'm new to arduino. <br> <br>i received this error in compiling: <br> <br>Arduino: 1.6.5 (Windows 8.1), Board: &quot;Arduino Uno&quot; <br> <br>In file included from ChiptunesLightsLinus.ino:9:0: <br>ChiptunesLightsLinus:19: error: variable 'songdata' must be const in order to be put into read-only section by means of '__attribute__((progmem))' <br>variable 'songdata' must be const in order to be put into read-only section by means of '__attribute__((progmem))' <br> <br> This report would have more information with <br> &quot;Show verbose output during compilation&quot; <br> enabled in File &gt; Preferences. <br>
<p>I got the same error, and got it to compile by adding the keyword &quot;const&quot; at the beginning of the line so it looks like this: const byte songdata[] PROGMEM = {</p><p>I have to hunt down a speaker, though, so I don't know if the code actually works, just that it compiles.</p>
<p>That worked for me!</p><p>Thanks!</p>
<p>A wee bit quiet through the tiny speaker I used. Works thanks to that code correction. The beat box code only seems to produce a few glitchy noises and a high pitched whine though.</p>
<p>Used an earphone and a small speaker, both with an amplifier. Nice sound and easily done.</p>
It's so funny
<p>Thank you, <a href="http://www.instructables.com/member/blinkyblinky/" rel="nofollow">blinkyblinky</a></p><p>On 1.6.4 I changed &quot;byte songdata[] PROGMEM = {&quot;</p><p>to &quot;const PROGMEM byte songdata[] = {&quot;</p><p>and it compiled for me.</p><p><a href="http://www.arduino.cc/en/Reference/PROGMEM" rel="nofollow">http://www.arduino.cc/en/Reference/PROGMEM</a></p>
<p>Making this change allowed it to <em>compile </em>on mine, but the code seems to do absolutely nothing.</p>
<p>First of all, thank you very much for guide.</p><p>Is there a way to add a loop, so that the music repeats itself when it's over?</p><p>Thanks </p>
<p>i got:<br>In file included from chiptune.ino:10:0:</p><p>chiptune.ino:20:17: error: variable 'songdata' must be const in order to be put into read-only section by means of '__attribute__((progmem))'</p>
<p>Error compiling is what my arduino says</p>
Arduino 1.6.0 and beyond has problems with older code because some variable declarations have changed; revert back to Arduino 1.0.6 or something older and it should work but not before arduino 1.0 though.<br><br>Just the other day I was trying to compile some other code and found out that instead of just byte [variable name] I have to declare byte PROGMEM [variable name] in order to make it work; something similar may have happened with the Octosynth code so try an older build of Arduino such as Arduino 1.0.6 or prior.
<p>How i can do it with LEONARDO?????<br>Can you help me in Code?</p>
<p>It should work without problems. If so, try an older version of Arduino such as 1.0.6 as I have been finding out that Arduino 1.6.1 has some issues with older code.</p>
<p>for those looking to buy arduino cheap...</p><p>https://sites.google.com/site/arduinouk</p>
<p>oh and if u cant make the code can you give me the web address to stimmers website thanks</p>
<p>could you please update your code it does not work. thanks!</p>
<p>Genius! It works finely. THX very much. Please more songs like this one!</p>
<p>Very cool :D</p>
<p>Thanks for posting this. Is there a library somewhere of other tunes?</p>
I want the entire song to start over. Thanks.
I am absolutely astounded! I cannot believe this amazing Instructable. One question though, is there a way to add a &quot;void loop() {&quot; Function? If so, can you please tell me how?
Do you want the song to loop itself or do you just want a void loop? <br>
the code did not work.it plays for out 3 seconds the makes a fuzzy sound that doesnt end. <br>is he code mesed up or what. help.
Couldn't you just plug in a 1/4in guitar cable with the wire exposed on one end for an amp?<br>
Further later on, I did just that except with the 3.5mm cable.
Hi, I just wanted to thank you for this, and say that the leds are on pin 12 and 10 if you didn't know already. Just found out while looking trough the code :)
How do you generate the data for the songs? I have a great Idea for storing them on an SD card for playback.
Very awesome.<br /> <br /> You need to add a VCF next or at least a simple low pass filter. Check out the right side of <a href="http://www.musicfromouterspace.com/analogsynth_new/THE_CAVE/Your%20First%20Synth/Your%20First%20Synth_files/your_first_synth.gif">this schematic</a>.<br /> <br /> You can simply make buy an 1/8&quot; plug from Radioshack and solder two wires onto it. Then, get a small test amp from Radioshack (about $15) and plug the jack into that.<br /> <br /> Also, check out the book <a href="http://books.google.com/books/about/Handmade_electronic_music.html?id=P1yEOTci8DMC">Handmade Electronic Music</a> if you have not done so already.<br /> <br />
Also, where is the song data from? How was it generated?
This is the original project that this is a ported version of: <a href="http://www.linusakesson.net/hardware/chiptune.php" rel="nofollow">http://www.linusakesson.net/hardware/chiptune.php</a><br> <br> Here's the thread with the port: <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265488118" rel="nofollow">http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265488118</a><br> <br> I tried downloading the tracker from the original project page, but I have no idea how to actually get the tracker to run...
You need a Linux OS like Ubuntu or similar. I am running OpenSuse 11.3 but it should be very similar. You will need to install libSDL next. Then Open a terminal and use the 'change directory' command (cd) to get to where you hid the file on your computer. Next go to the same place using the GUI of your OS and read the readme file.<br> <br> I don't have the file with me but I can say you execute it with something like this (again check the readme file for a more accurate command): ./tracker test2.song It should open up as a tracker.<br> <br> I don't know much aside from the fact you can make it play, idle or editable. Then use the app <a href="http://bearborne.blogspot.com/2011/12/hi-everyone-today-im-back-again-with.html" rel="nofollow">here</a>. You&nbsp;will need gcc and java for it to run.<br> <br> <a href="http://bearborne.blogspot.com/2012/02/lft-tracker-howto.html" rel="nofollow">Here</a> is how you use the tracker.<br> <br>
I think it from the data in the code that is sort of like a table. I tried altering half the data and it gave me some pretty weird sounds.
Yeah, I have an amp...I also have the jack...just didn't know how to explain on my ible.
Nice. I got it to work.
You're welcome.
this was very cool. I cannot imagine having to write out all of the code. Thank god for copy paste.
I know right? I am not the writer, though. The Arduino code is by Stimmer in the Arduino Forums.
I instantly recognized the song the second it started in the video. I've been wanting to build one of those for years now. For all those who haven't heard of this before: http://www.youtube.com/watch?v=_uU4BzSQQmY
Well...enjoy!<br> <br> <div class="media_embed"> <iframe frameborder="0" height="315" src="http://www.youtube.com/embed/_uU4BzSQQmY?rel=0" width="420"></iframe></div> <br> I couldn't get the LEDs though...<br> <br> <br>
neat<br>where did u get the code?
In a mystical book in my basement that writes code for me. <br><br>Just kidding. <br><br>I got it in the Arduino forums.
The code is right here in my ible. Why do you need the link?
to the forum topic, wanted to know more about the thing.<br>doesnt matter, did some looking about and found the origonal project :)
Good for you. :-)

About This Instructable


206 favorites


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 Chindogu A Complete Beginner's Guide to Raw Files And Raw Processing Hypercard - An Impossible Paper Object
Add instructable to: