Netduino Plus 2 --- 6 Note Polyphonic MIDI Player

All of the code is located in:
\MidiPlayer\Program.cs
---------------------------------------


This program parses a STANDARD midi file (*.mid) and then PLAYS it using the 6 built in PWM channels.   The files are stored on the SD-card.   You can play a single file,  or set it to play any *.mid files in the root directory in a row,  with an option to REPEAT.

NOTE:  The midi file should be type 0, so that all the tracks are in a single track,  NOT Multi-tracked.  Use a Midi type converter, such as: http://web.archive.o...gs/software.htm

I have successfully played up to a 38KB file.  Not sure if anything larger would work.  There is 100KB+ of RAM,  and the code is around 11KB....

This code should easily be adapted to any of the other Netduinos, as well.   I don't have any other versions to test, though.      The song data can also be embedded within the code.    Easiest way is to use a HEX convertor, such as HxD Hex Editor.  You may export the bytes as a *.cs file and embed the BYTES into the program:  http://mh-nexus.de/en/programs.php

------------------------------------------

Youtube Video:
http://youtu.be/Hc4IYJLTAxk

That one has an add-on board that I built to MIX the 6 PWM channels as AUDIO,  then output to headphones or line-level.   A speaker can be connected, but would be better to be driven by an amplifier.

------------------------------------------

Here is an image of the Op Amp shield completed: http://ppl.ug/Kjn27rtVTPM/ 

(it ended up being a little sloppier than my original, due to necessary changes )

------------------------------------------

Here is the TINA-TI simulator file:  http://ppl.ug/6lKepOPeloI/

and an image of the SCHEMATIC:  http://ppl.ug/jt5jry3cboM/

 

If you haven't heard of it,  this is a great program offered FREE by Texas Instruments (TI):  http://www.ti.com/tool/tina-ti    to build and simulate electronic circuits.

-------------------------------------------
OLD Youtube video
(using only a few resistor's tied off each of the PWM channels):
http://www.youtube.com/watch?v=faVSrO1xM1k

Last edited Feb 5, 2013 at 5:50 PM by ronzon, version 18