Creating music for the Arduino is simple – just use the tone() library – but it truthfully doesn’t sound that great. That’s because this library is monophonic, making chords difficult or at the very least sound a little weird. [Connor]’s miduino aims to change that, turning raw MIDI files into polyphonic Arduino sketches.
To convert MIDI files into Arduino sketches, [Connor] whipped up a Python script based on midiCSV that reads the notes and channels of a MIDI file and converts it into the language of the Arduino. Unlike the built-in tone() library, miduino is polyphonic making the music produced from any Arduino sound great. It’s basically the difference between writing music for a PC speaker and a true keyboard; sure, you’re only getting square waves, but it sounds much better.
Oddly, [Connor] hasn’t put up his Python script as far as we can tell. All the MIDI songs are being converted on [Connor]’s own Raspberry Pi. This is supposed to be cheaper than a VPS, and makes for a very cool project to boot.
Edit: Miduino isn’t polyphonic yet, but [Connor] says he should have that wrapped up in a week or two.
I think a demo would be a really nice addition to the article :) Here’s a youtube video linked from the miduino website: http://miduino.net/?page_id=941
nice.
Thanks!
While the polyphonic conversion process is still a few days off, feel free to upload monophonic files for now and enjoy the free service! I posted a link on Miduino’s homepage to the missing Python scripts! Direct link: http://www.miduino.net/Miduino_V1.zip
Thank you for the exposure!
– Connor Nishijima | Miduino Developer
Am I the only one confused here? HaD says Miduino adds polyphony. Connor’s actual site says Miduino is currently monophonic, though he hopes to add polyphony in v2.
Also, saying Miduino is “basically the difference between writing music for a PC speaker and a true keyboard” is a big leap, since the point of a synthesizer or sample-playback keyboard is that it can create sounds that are far more sophisticated than raw square waves.
Sure, polyphonic output (which Miduino doesn’t actually have yet!) will make songs with chords or multiple parts sound better than a single voice, but you’re still listening to square waves.
Polyphony is done!
http://miduino.net/
When will your website be online again?
It is in maintenance mode
This is cool and all, but I want to point out a hack going back to 1977 or so. Jon Bokelman wrote an 8080 program which would accept a textual polyphonic score (not MIDI, but similar idea) and would compile it to an in-memory binary program. The program consisted of carefully timed loops which would execute EI and DI (enable interrupt and disable interrupt) instruction. The S-100 bus of these 8080 systems exposed the state of the interrupt enable. By hanging a first-order RC low-pass filter on that line, like magic you produce music. Even now it boggles my mind how well it worked.
I have links to the program’ instruction manual, a bunch of scores on my Sol-20 microcomputer website: http://www.sol20.org/programs.html . Skip down to the section starting with the word “Music”.
Here is a link to one of the scores captured to mp3: http://www.sol20.org/media/d-minor.mp3
High notes are a bit pitchy because the period is so small it is hard to represent them as an integer multiple of the 8080 cycle time. Keep in mind all of this was done on a 2.04 MHz 8080, where even a NOP takes four clocks, and a jump takes 10.
Nice! I’ll definitely channel inspiration from this. Thanks for the link!
Very cool, thanks!
Here is one similar project I did two years ago on a TI Lauchpad (2K MSP430 device) with 8 channel polymorphic, perl script for midi conversion. Sound quality is not bad but the youtube recording is not so good.
http://youtu.be/N-wwuPa4FSk
I should really post my PIC-based 9 voice polyphony printerhead-using MIDI-receiving synthesizer project writeup anywhere.
I should also finish building a case for it.
Great demo! Please tell me this was submitted to a wild compo at some party somewhere.
Also, it’s a shame your camera decided the speaker was the focal point and not the LCD screen. :(
Why is the MIDI data converted to a huge piece of executable code, instead of simply putting the MIDI data in a table, and having a library function to play it ?
If you are gonna do all that then why not go for pcm or an awm knockoff? I think the site only yells “SIMPLICITY” like 50 times, fartface.
Generating a table with values + static code is simpler than generating code, fartface.
V1.1 will have arrays instead, see here: http://www.miduino.net/arrayTesting.ino
Feel try to try that one out!
You really fail at reading comprehension over and over again on this site. Something that should have been fixed by fourth grade. I am guessing you are older than the ADD craze, so it is probably not entirely your fault, but doing nothing to fix it only slows you down. Get some more alts.
Polyphony is done!
http://miduino.net/
Please, don’t compare it to PC speaker. Today, I have been toying around with my HP200LX (XT on 7,9 MHz) that can play MIDI through speaker, though it has to be precomputed from MIDI file. And it sounds pretty good for XT.
Nice, I did similar project on Arduino Uno playing 16 channel polyphonic music: http://www.youtube.com/watch?v=XZfw7l-ZxqE