Easy MIDI Notes is based off of another developer's hard work (Abadani, I believe) and some streamlining of code which I added for simplification and ease of use.
Example app is designed for those who just want to make use of MIDI without having to spend 90% of the time trying to get a darn note to play.
The functionality of this code is similar to Matthew Stride's "Midi Note Generator", but this one is for VB.Net 2008, not C++.Net.
Feel free to leave comments or questions though.
Featues include (features I added):
- 1 file for easy code reuse (simply drop the class in your project and your ready to go)
- Simple functions to Stop and Play notes
- XML Documentation for ease of code use
- Easy Instrument Selection
- Easy to follow example program which demonstrates Instrument selection, Volume, Pan, and ModWheel control.
This app is aimed at those who love music and want to get started creating MIDI apps, but may not be as skilled at developing (but want to learn).
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come
out every day, so no prevention program can catch 100% of them. For your own safety, please:
Re-scan downloaded files using your personal virus checker before using it.
NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
If you don't have a virus scanner, you can get one at many places on the net
Terms of Agreement:
By using this code, you agree to the following terms...
You may use
this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
You may link to this code from another website, but ONLY if it is not wrapped in a frame.
You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
This code is AMAZING, I cannot thank you enough! Just spend 1 hour hiking through forums looking for a simple MIDI player for VB.net (I'm making a piano simulator) and this has actually saved my life. Easy to use and simple to integrate into an existing project. Thank you! (If this comment was disrespectful, please report it.)
Great code - is there a way of recovering from a 'hang' during a PlayMidiNote? Occasionally my computer hangs in mid-note then crashes and re-boots. Thank you. (If this comment was disrespectful, please report it.)
Hey Jonathan - In the PlayMIDINote function, in the following area: Catch ex As Exception put a breakpoint on that line and run it in Debug mode. See if it can tell you what the exception is and try to see if you can handle it. Let me know what the error is. Right now it is just skipping the error basically. (If this comment was disrespectful, please report it.)
This code is just what I need for 3D Rhythm Guitar Simulator project I'm working on! Is it fairly straight forward to change the Chorus and Reverb settings? And is there a single note OFF command? (If this comment was disrespectful, please report it.)
== Go to clsMIDI - LINE 110 after "Sub STOPALLMIDINotes()" == Add the following code
Sub STOPMIDINote(ByVal Note As Integer) Inst.StopNote(Note) End Sub
== Add this to Form1 ==
'Click on the Form (not on a label) Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then m.PlayMIDINote(70, 127) 'Play Note 70 Else m.STOPMIDINote(70) 'Stop Note 70 End If End Sub (If this comment was disrespectful, please report it.)
Thank you for making this excellent code available. Question: Is it possible to define the duration of a note before it begins? I have tried altering m.duration and inst.duration but nothing seems to change. (If this comment was disrespectful, please report it.)
Add Your Feedback
Your feedback will be posted below and an email sent to
the author. Please remember that the author was kind enough to
share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular code, please
click here instead.)