Log in

View Full Version : Midi file loads slow on startup in XP


TJM
06-30-2004, 05:54 AM
When running my games under XP, the games are slow to load. The problem appears to be that the midi file (the music for the game) is taking a long time to load. It takes approximately 5 seconds or so to load on XP computers. On a Windows 98 computer, however, it loads instantaneously.

I've used the same routines (the mciSendString stuff) for years; the problem just cropped up when I began using them on a XP computer. This has been going on with my games for a long time. I kept hoping I would run across something on this, but I haven't seen anything.

Anyone have any idea what the problem could be?

maxdgaming
06-30-2004, 09:23 AM
XP Sucks?

Nah, I dunno, I just wanted to say that :D

Scorpio
06-30-2004, 09:35 AM
I haven't used Midi much lately (used to a bunch tho), but I think XP will load instrument files based on the midi file...which could take a few seconds to load and initialize. This is probably a Midi option (set via the control panel applet).

I'm not positive about this, but it might be worth looking into.
-Scorpio

Wayward
06-30-2004, 09:42 AM
This CodeProject Article (http://www.codeproject.com/audio/mididemocp.asp) says:
Known bugs in Windows NT, 2000 and XP:
On Windows NT, 2000 and XP the first note of a Midi song is omitted in playing if the song does not begin with a rest of at least a quarter note !! (The Midi sample-files added to the download all begin with a rest)
On Windows NT, 2000 and XP the mciSendString("open...") command is extremely slow
Only on Windows XP mciSendString("open...") gives a stupid error message if the Midi device is occupied by another application. (MCIERR_SEQ_NOMIDIPRESENT instead of MCIERR_SEQ_PORT_INUSE) mciGetErrorString() translates this to "No Midi hardware available or no drivers installed" !!
Not much help I know, but it's a recognized problem.

TJM
06-30-2004, 04:00 PM
Originally posted by Wayward
Not much help I know, but it's a recognized problem.

Actually that was very helpful. Thx.

Originally posted by Wayward
On Windows NT, 2000 and XP the mciSendString("open...") command is extremely slow.

Is there a workaround for this. A function that XP likes better?

TJM
06-30-2004, 04:32 PM
What's the difference in using the MIDI Stream API and the MCI functions? I've always used the MCI functions, but does XP work better with the MIDI Stream functions?

TJM
07-04-2004, 08:38 AM
I'm going to go ahead and try the MIDI Stream API to see if I get better results. I found some information on Microsoft's site, but it doesn't go into any detail. Does anyone know a good online tutorial or sample code? Or a good book?

anothersomething
07-05-2004, 01:45 AM
Using MCI to play MIDI files is bullshit. Much easier to use DirectMusic (Plus they sound the same on every comp, you can specify your own DLS bank, and can loop them without a hickup)

TJM
07-05-2004, 06:13 AM
Any disadvantages to using DirectMusic? Everyone seems to like DirectSound, but I tried using it a while back and the wav files were slow to load.

Are there any problems with Direct Music?