Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino Plus 2 --- MIDI Player

netduino plus midi player parse audio sound pwm outputs

  • Please log in to reply
2 replies to this topic

#1 RonZon

RonZon

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationWaukesha, WI

Posted 05 February 2013 - 07:19 PM

I THINK I am pretty much finished with my version of a MIDI Player.

 

I have posted a YouTube video here:

 

And,  a code page on CodePlex:

http://netduinop2mid...r.codeplex.com/

 

Basically,  this program reads a Standard MIDI file (*.mid) from the SD-card, parses it,  and plays the song using all 6 of the PWM outputs. So,  that gives you up to 6 note POLYPHONY.   This can also be set to use less channels (1-6).

 

I had posted a video earlier with a simple, crude test using resistors to mix the "audio" out to the speaker... but, it obviously was not the correct way to do such a thing. So,  I created a proper audio mixing circuit using an OP-AMP. This mixes all 6 PWM signals and outputs to a 1/8" jack, which can be connected to headphones or as line-level output.  It still isn't perfect,  but surprisingly it sounds pretty darn good.  

 

The code can be set up to read all *.mid files at the root of the SD card and play in a row, or just play a single file. There is also a switch on the board to SKIP SONGS.

 

 

I have optimized the code as best as I can, and it plays pretty smooth. I am not very experienced, so I'm sure there are things that I do not know yet... but I am definitely learning :)

 

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.

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

 

BTW: 

In the video:

I have the 1/8" jack connected as a line-level output to record.  I am using the USB connection ONLY to show the debug results on the screen.  There is a 12volt supply connected for primary power.   I found out that 5volt USB power is very "dirty" and NOT suitable for audio applications at all.   The power input is further regulated on the Netduino board, giving very clean results.  I also added a 0.1uF cap from pin 4 to 8 on the buttom of the LM358 op-amp IC.

 

 

-Ron



#2 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 05 February 2013 - 07:30 PM

Ron, this looks and sounds fantastic. What a great project. Thank you for sharing. 

 

Boy, does it ever take me back to my old Commodore 64 and ColecoVision console games. Good times. 

 

Cheers,

Steve



#3 RonZon

RonZon

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationWaukesha, WI

Posted 07 February 2013 - 01:19 AM

Thank you :)







Also tagged with one or more of these keywords: netduino, plus, midi, player, parse, audio, sound, pwm, outputs

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.