Welcome to the Music and Sound forum on GD.net. Pull up a chair, listen to some tracks by your peers and discuss all things music and sound. We're happy to have you. Please check out the FAQ link for some basic (and mostly common sense) approaches used in this forum. If you have any questions, feel free to PM me.
I am currently incorporating MIDI files into my game using the Lamothe technique from his "Tricks Of The Windows" book. I noticed that when the MIDI file is played in my game, it sounds slightly different than when I play the MIDI file with the Windows Media Player, or Anvil (the software I used to create the MIDI file). I would prefer the game to sound the same as it does coming from Anvil (the way I created it).
After some messing around, I''ve determined that it sounds different because I am adding the default port (Microsoft Software Synthesizer) within my game.
return(0); //terminate application
According to the DirectX7 documentation, under win95 or win98, the default port is always the Microsoft Software Synthesizer.
It would make more sense to me if the default port was selected from the one defined in the MIDI tab of the MultiMedia icon of the Control Panel. I am quite sure that is where the WindowsMediaPlayer gets its ouptut port from for MIDI files. That is what I would like my program to do.
Any ideas as to how I could do this within my program? Any thoughts as to the wisdom of doing it this way? How will this affect the sound on other PC''s with different sound cards?
My sound card is a SoundBlaster AWE64.
Thanks for the help.
Hi, i have your exact same problem The solution i found was a hack, but i havent heard of any other way to do it. I basically find the media tab setting in the registry, then do a strcmp against all dmusic enumerated caps strings until it matches, then return that guid for dmusic to initialize with
// get the default device out of the registry hr = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap", 0, KEY_QUERY_VALUE , &key); if (hr != ERROR_SUCCESS) return NULL; RegQueryValueEx(key, "CurrentInstrument", 0, NULL, (LPBYTE)&name, &size); RegCloseKey(key);