Quote: "...midi music, because they suck"
I disagree that midi s.... As sound cards improve and samples are used in wavetables, midi files are not only small and portable across multiple hardware (including computers and electronic instruments), but the sound qaulity (based on the sound card or software drivers) can be exceptional. And because midi events - including notes - are consistant finite numbers, they can be used to trigger ANYTHING in hardware or software. Let me climb down from my soapbox now...
@Maindric
The problem today is most computers aren't set up properly to deal with midi - so in using DarkBASIC, I would agree it's probably better to avoid using midi if you plan on distributing your app unless you handle it outside of using the DarkBASIC commands. Memory and size limits aren't the same when midi was very popular for video games; so using mp3's, trackers, even wav files is passable. Though, with old DOS games, there was always a setup program to test compatibility and setup the sound card...
Anyway, in answer to your original question,
Quote: "Why does that work (Press space bar to pause music) and when you replace the second loop music with resume music, it does not?"
On my computer it works both ways so I couldn't "break" it to observe the problem but, I think DBC uses MCI string commands (those are media commands from the win32 api) to play midi files. There is a problem with an MCI midi sequence driver called
mciseq that may or may not recognize the MCI string "resume" . So, if the problem is with the driver, it may do unpredictable things (like not play with resume or reset the midi instruments).
@Kira Vakaan
Quote: "I also noticed something a little strange about resuming the music like you show in your code example. Although the music continues, some of the instruments are replaced with a grand piano, which I know to be the first MIDI instrument. I don't understand why. Maybe that's just something specific to my own system..."
Only some of the instruments are replaced, or all of them? An explanation can get complicated but it's probably a driver on your system. A midi file is based on a series of events - play a note, change an instrument, add reverb, hold pedal... etc. An instrument change may be indicated at the beginning of the file and never again throughout the file. The general default if no instrument change is indicated is instrument 1 and Channel 1 to play all of the notes in the file. If the software or maybe even the hardware doesn't maintain the channels or the instrument settings when the midi is paused or stopped, then continues playing the file from the halted point, it may revert to the defaults.
Enjoy your day.