CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013

    Create a midi file using vb

    I am doing a mini vb program on midi files. I need help on how to create a midi file that only plays the musical notes. When the user press a key like C or A, the proocedure simply generate a midi tone that corresponds to only the pressed character and after ward saved the press character in midi form

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008

    Re: Create a midi file using vb

    You can get the key pressed in the keypressed event or you can use the keydown or KeyUp events beyond that would need more info from you.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jan 2006
    Fox Lake, IL

    Re: Create a midi file using vb

    the MIDI format is available for download, except that it is over 900 pages of text.

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Feb 2014

    Re: Create a midi file using vb

    I've just done some work on this. Not sure if it's bisuitable for you, but my code accepts a table of values as a parameter and converts it into a MIDI file. It doesn't play the notes though. I'm currently using a program called MIDIox to handle the MIDI in and out streams. It's freeware and a really useful MIDI debugging tool. If you add a reference to that in your program, you can just call a method to send MIDI notes. There a good section on scripting in the MIDIox help text. If you have a lookup from ASCII value to MIDI out code, you can just output that. Eg, ASCII 67 for C might be note 60 (middle C in MIDI). Hope this helps. This is a good resource on the MIDI file format:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width