Finally: The new Mr.Midi 2 is ready!
It works with the real midi file protocol and supports a FAT16 file system on the inserted card. So usage is as simple as with a MP3 player.
For such a luxury you need the ATmega168 from Atmel.
Boasting :-)
Invented in Germany, going round the world! Since it is free open source, you can build it, sell it, modify it (but as open source again) and have fun with it!
Even people from UK, Japan and the Netherlands have build their own DIY MrMIDI 2!
If you like, you can send me pictures of your own!
Everybody who can build the circuit and program an ATmega168/328 on his own can use it for free and unrestricted.
Watch this:
Features
Works with most cards, max size is limited to 2GB (but please also note, cards 32MB and below could use FAT12, which is not supported)
Real MIDI files on FAT16/32 (Midi format 0 only) - recording (only root dir) and playback
Maximum of 255 files per folder
Displays the file names - long names are supported - filename scrolling
File delete is possible (it can delete any file from the root directory)
256 byte input/output buffer and 8MHz clock for high performance and precise MIDI timings
Lyrics are displayed (when contained in MIDI file) - cool!
Variable speed (+/-15 steps) and transpose (+/-24) while playing a file
MMC/SD card bootloader - just format a card, copy generated MM.BIN onto it, insert it, press and hold STOP and switch ON!
MIDI channel mute for each channel
Menu for setting up drum channel, lyric display, repeat modes, channel mutes and track delay
Settings are stored in non-volatile EEPROM on-chip
IR remote control (RC5 protocol), a Philips videorecorder remote for example. Or get a programmable remote and use code 257 (for a Philips VCR).
Several song repeat modes (song, folder, random, non-stop)
Circuit
Attention: Mega168 pin TX must be connected to OUT pin 5 and pull up to OUT pin 4! For LED backlight: Connect LED- (K) of your display over a resistor to PORTB6+7 (in parallel), connect LED+ (A) to Vcc 5V For mass production: Connect an 8MHz XTAL and 2 capacitors to PORTB6+7 for stable clock accuracy over life-time, see data sheet!
Parts:
1x ATmega168/328 - processor
1x TSOP4836 (or TSOP1836) - IR receiver
1x 6N138 - optocoupler
1x 24x2 or 16x2 standard display LCD
1x LDO voltage converter 3.3V - for card
1x voltage converter 5V - for MCU, display and TSOP (note the power requirements for your converter! The display with LED background light alone could consume 100mA.)
1x power switch
7x push-button
6x 100nF
2x 10uF
1x 1k
3x 220ohms
3x 2.2k
3x 4.7k (try higher values, if you have problems with your cards)
For LCD backlight another resistor (depends on your display) - if your LCD needs to much power, you'll need an extra transistor like the 2N3906 to drive it!
1x 8 MHz XTAL + 2x 18pF for greater clock accuracy (at PB6 and PB7 instead of backlight) - the internal oscillator has too much tolerance for mass production! Don't forget to set the fuses accordingly!
Use Atmel Studio 6.0! The newer versions use a different compiler and won't work!
Config your blank out-of-the-box ATmega168:
Program fuses to 512/1024 word boot loader size and NO boot vector enabled.
Use an 8MHz XTAL and no CKDIV8 fuse.
Flash the included hex file "mrmidi2_bl512words.hex" or 1024words version (directory "default" contains the 24x2 display version, "compactdisplay" the 16x2 version).
Manual
Start:
Format a card with FAT (FAT16).
Convert your MIDI files to format 0 (good program to do this: Midi File Converter).
Copy your files to the card (or leave it empty).
Insert card in Mr.MIDI 2 and switch ON!
Mr. MIDI 2 scans the card and displays the first detected file - this is the first file which was copied to the card and not neccessarily the alphabetical first!
Use the UP/DOWN buttons (IR remote:Prg+/-) to scroll through the files.
Use the REC button to start a recording.
Use the PLAY button to play a file. If a file error appears, it is probably in not in format 0.
Use the LEFT+RIGHT buttons (press at the same time, IR remote: ENT button) to delete the current file.
Use the UP+DOWN buttons (press at the same time, IR remote: MENU button) to open the menu.
Recording:
After pressing REC "Ready for Rec" will appear. Recording starts with the first MIDI event. Then the recording time is displayed, too.
To end and save the recording, press STOP.
To abort and throw away the recording, press REC again.
Recordings will create files named "MM001.MID", the number will count up. No files are overwritten!
Playback:
You can see the playback time and file number. If lyric display is enabled (default: ON) and the MIDI file contains text, it will be displayed.
You can change the tempo using LEFT (slower) or RIGHT (faster).
You can transpose a file while playing with UP/DOWN.
Menu:
1. Drum channel: You can edit the drum channel with LEFT/RIGHT.
2. Lyrics: You can edit the lyric display option. LEFT is OFF (0), RIGHT is ON (1).
3. Start sector: You can change the start sector for the dumb card scan if your card is not FAT16.
4. Mute: You can mute channels. Use RIGHT to select a channel (scroll through) ad LEFT to mute/unmute. An "X" will be displayed for muted channels.
5. Repeat mode: You can select a repeat mode - 0 = play single file and stop, 1 = repeat single file, 2 = play sequence, 3 = repeat directory, 4 = random
6. Backlight: You can control the LED backlight of your LCD with this.
Edit files on PC:
Insert card in card slot and just edit the files, copy them or do what you want! If your MrMIDI screwed something up, please reformat the card (FAT16)!
Firmware Update:
Format a card with FAT16.
Copy MM.BIN onto it.
Insert it in Mr. MIDI 2 and switch ON. Wait for update progress (very fast: less than 1 second).
Switch OFF, remove card!
Extensions
You can add a small wavetable upgrade board with a 26-pin-connector to give Mr.MIDI2 full audio capabilities. Add a quality audio amplifier for superior MIDI sound! Description of wavetable board connector (German)
Build
Compile the project with WinAVR 20060421 + AVR Studio 4.12 or newer up to Atmel Studio 6.0. Ignore the warnings.
Use hex2bin to create the bootloader file MM.BIN.
Then update your main_blXX.hex-flashed MrMIDI2 to the current version!
Notes
Remember, this is a free DIY open source project.
Open source means: When you change it, please offer the sources as free download. If you want to make money of it (commercial production) you can do this, but put a link of this page on your product page (and in the product manual). Please send me a free sample of your product, too (so I can go showing off :-)!
No warranties or liabilities are given. Build and use this project on your own risk!