问题
I am currently working on a small project in QuickBasic that requires the use of MIDI files.
As the DOS environment I'm using DOSBox 0.74, which provides emulation of the Gravis Ultrasound card.
So far, I've been able to access GUS only by using the PLAYMIDI.EXE file in the C:\ULTRASND directory. However, it is impossible to launch it from inside QuickBasic: the SHELL statement creates a child COMMAND.COM process, so when PLAYMIDI.EXE starts playing in the background the child process finishes and terminates, and the music stops. All of this means that the only way to launch PLAYMIDI.EXE is through a batch file before the actual program, but it also means that there is no way to control the music from the QuickBasic program. Edit (Jul 24, 2011): It is actually possible to launch it using SHELL (my mistake), but the TSR version of PLAYMIDI.EXE takes a lot of memory, so there isn't enough left for my program. The question still stands.
Therefore, my question is whether there is a Gravis Ultrasound library for QuickBasic available.
Edit (Jul 19, 2011): Might be in another language as well, as QuickBasic can link those too.
P.S. Sound Blaster library available here, but I don't like the sound it produces.
Resources
- libTiMidity: http://libtimidity.sourceforge.net/
- Assembly Gravis Ultrasound library: guslib11.arj
- Assembly tutorials (including QBasic): http://www.petesqbsite.com/sections/tutorials/assembly.shtml
- Direct Sound 4 QB++ : ds4qbpp12.zip
- Bells, Whistles and Soundboards: bwsb.zip
- QMIDI 4.1: http://www.phatcode.net/downloads.php?id=191
回答1:
As an huge fan of QB, I'm happy to see someone still using it. So I made it a point to find an answer for you. Here's what I've found. There is an ASM Gravis library on this page. Using the ASM tutorials, you should be able to combine the two. FYI, here's another great resource. Good luck.
回答2:
You could look at DS4QB++, which allows you to play music and sound effects using the Windows API. I haven't tried it with later versions of Windows though. There's also BWSB which is DOS based and can play MOD/S3M files. Both available on my old QB site:
http://piptol.qbasicnews.com/files.htm
回答3:
QB64 uses TiMidity, i guess via _SNDOPEN.
来源:https://stackoverflow.com/questions/6745079/quickbasic-4-5-gravis-ultrasound-library