This project is an easy and simple way to play great music with Arduino.
Arduino Leonardo or Pro Micro can use the USBMIDI library for MIDI communication.
Fortunately, MIDI signals can be easily transformed into frequency. Below is a formula to change the MIDI signal value to frequency.
One problem is that the tone () function of Arduino can generate single tone at a time. So, Arduino pro micro separate each MIDI channel and send it to Attiny85 by I2C communication.
The circuit is shown below.
You can add as many Attiny85 as you want. To program Attiny85 into Arduino, you need to load the boot loader, here's how to do it. (I chose SpenceKonde's Attiny85 core.)
To run MIDI files, you need a program like MIDI-OX, and loopMIDI also helps you to communicate with MIDI. Please refer to YouTube video for how to play MIDI files.
For reference, most MIDI files display multiple notes simultaneously on one channel. To separate them, you need a program called openMPT.
Finally, you need to find a MIDI file with less than five channels. The easiest way to get a MIDI file is to search for "music name + midi" on YouTube.
You can download the source code and PCB Gerber files from my GitHub page.
Also you can find more information in my Korean blog.
Comments