Original Post

So here it is: The Midi2VB converter including all c# sources. It is able to convert Midi Files to a header format that can be used by the VirtualBoy. It does support the GameHero Midi-Player as well as the SU Sound Engine.

All of the GameHero music has been produced (within one day) using this tool. However, it is not perfect. It can only extract one track from a midi file. This means if the midi file uses multiple tracks you have to choose one. The converter does also not convert every midi file as the library I used does not support every format (also Midi files are a big mess). I got pretty got results if the midi file had a solid piano or melody track. I found all midis at “http://www.vgmusic.com/music/console/nintendo/nes/index-classic.html”. I tried to convert other music then NES-Gamemusic but I did not like the results.

However, I think the music in GameHero is really awesome. And now you guys can use midi tools to do your music and then put it on your VB.

Ok, some more words about the program. Make sure you got the .net framework installed. I used Visual Studio 2005 to compile the sources. You will have to add the NAudio Librarys from the zip file to your references.

You can start the program using the commandline. Just enter “Midi2VB.exe AbsolutPathToMidiFile”. The program then asks for some parameters.

name: this is going to be the file name and variable prefix
Tracks: All legal tracks found in the midi file. Choose one by entering the corresponding number
Max Notes: Maximum number of nodes that are include in the header file (pauses count as notes)
FPS: Estimated frames per second on target system. Default should be 60. This can be used to speed up and slow down the music. It is also great if your game code slows down the music. Then you can just speed up the music again.
Replay: Sets how often the music should be replayed. -1 means endless
Octave Shift: Shifts the octaves up or down
Target: GameHero Midi Player or SU Sound engine.

It should say “All Done” as soon as… well… all is done.
After that you should find a [name].h file in the Midi2VB directory.

Ok, thats it. Feel free to do what ever you want with this code. As long as you build VB Games I am happy.


3 Replies

It’s great! An obvious enhancement would be to make it support more MIDI files, but I have no idea how hard that would be. What’s important is that the VB homebrew community finally has an easy way to put sounds and music into games.

So how do i playback the.h file or listen to it? i was told it plays back the converted audio but im not sure how to use it. the readme didn’t help as much.

NyTR0S96 wrote:
So how do i playback the.h file or listen to it? i was told it plays back the converted audio but im not sure how to use it. the readme didn’t help as much.

It’s a source code file. You will need a c project that includes the music player code as well and compile it.

This project is very old though. VuEngine now has sound support. They used my latest code as a template and modified my music converters to output in their format. I guess it’s way easier using that even though I have not tried it myself.


Write a reply

You must be logged in to reply to this topic.