In this instructable, I'll be showing you how to use an Arduino Uno with a vintage sound synthesis chip, to play midi files in square wavy goodness!
If you just want a quick overview of what this project does, watch the above video. Otherwise, continue on!
If you prefer all your instructions in clear, concise videos, we've got you covered!
For the rest of us, you can continue on, for a tad more detail, and written instructions.
For this, you'll need these things:
(The links are for eBay items)
Using the links provided, the total cost is $23.25, including shipping. Of course, most of it comes from halfway across the world, so shipping usually takes about a month. If you want faster shipping, you'll probably have to pay a bit more.
If schematics are your thing, here you go! The rest of us can either go through the step by step, or watch the video.
I would also recommend taking a look at the datasheet, which I've attached.
Note! Make sure none of the wires from the resistors/capacitors are touching, otherwise stuff won't work, and could (tentatively) potentially blow up in your face.
Note! On Mono audio jacks, it really doesn't matter what goes were, as long as one pin connects to 5V, and one to OUTL or OUTR. It'll sound just fine. Unless it doesn't, in which case you might want to check your wiring again.
I find that DuPont female-female jumper wires, with 15-20MM header pins in either end, work much better than the male-male dupont wires. Plus you can also use them as female-female, or male-female. Both are easily found on eBay in large quantities, for small amounts of change. A good Christmas gift for the aspiring Arduino junkie!
I won't go over step by step how to build everything here, but there are several good places to add LEDs. First of all, I connected a 3mm red LED between WR (pin 1)and GND, to show every time it the Arduino sends a command to the SAA1099.
I've also connected LEDs to the data lines before, which allows you to see the actual binary data on each line. I used this setup in my "Arduino and SAA1099 - Fireflies" video, as well as 6 more LEDs and some extra code to light up each LED for each channel that was active.
The more LEDs, the cooler it looks!
Now that you've built the circuit, go double check connections! You don't want to blow up your expensive arduino and Soundchip! (If you do, well. That's not my business)
Assuming you're sane and have checked everything, we can start programming it.
You should hear a Chord, then Beethoven's Rage over a lost Penny. If Classical isn't your thing, have no fear, for we will shortly learn how to use MIDI files of our own choice with it.
If you don't hear anything, check a few things: First, is your speaker on? Turn it all the way up. Then, is the arduino really on? Did the program upload correctly? Check all the wiring with the scematic and datasheet, then try again.
Ready to try something other than Beethoven? Very well, here you go.
To convert MIDI files to C++ Bytestreams, we'll need a program by Len Shustek. He's the creator of the library I based my code off, and my library uses the same bytestream format his does.
Warning! Here there be ascii dragons! You might find it easier to watch the video, where you can see exactly what I'm talking about. If ye dare enter, then continue on!
To use the MIDI to Bytestream conversion program, you'll need to open a command prompt window. Sorry Mac and Linux users, you may have to find a workaround.
Now, we need a MIDI file to convert. Find one somewhere on the interwebs, preferably without percussion or any special effects besides insturments/velocity. (If you don't know what those are, don't worry, you'll be fine)
Now that you've converted your MIDI file, let's feed it in little bytes to the arduino!
Everything's good here, so let's get back to the program.
If all went well, it should be playing your own MIDI file. If not, recheck to make sure the names of the new tab and the name you changed in the "#include "RagePenny.h"" are the same. Check the other steps, and make sure you did everything right. Some MIDI files just don't work, but those are rare.