1

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

Michael Bikovitsky
  • 903
  • 2
  • 10
  • 20
  • 1
    Lucky you if you get this question answered! Stick to that SB library if it works, as probably your goal is not to create a world-class Digital Audio Workstation. In any case I think there was an additional way to invoke external programs other than SHELL. Can't remember though, but books on QBASIC and QuickBasic are not that hard to find in public libraries. – deprecated Jul 19 '11 at 10:43
  • 1
    There is RUN and CHAIN. The former erases the current program from memory and loads another. The latter loads a new program and returns control to the caller when it finishes. The problem is that I don't see how they might help me. Any ideas? – Michael Bikovitsky Jul 19 '11 at 11:21
  • 1
    @vemv, is it possible to compile [libTiMidity](http://libtimidity.sourceforge.net/) for DOS? Trouble is, there seems to be no documentation... – Michael Bikovitsky Jul 21 '11 at 09:24
  • 1
    I have no relevant experience in compiling C I'm sorry. You could ask it as a separate question – deprecated Jul 21 '11 at 11:24

3 Answers3

2

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.

JadziaMD
  • 2,690
  • 5
  • 31
  • 42
  • 1
    I'm stuck here, and will appreciate any help you can offer. I've read the assembly tutorials, but I have no clue as to what I should do with this ASM library. It is pretty well-documented, but I have no idea how to get a MIDI file to play, because the library deals with low-level programming. As I mentioned in the comments to the question there is the [libTiMidity](http://libtimidity.sourceforge.net/) library that uses GUS patch files. Compiling it under DOS and linking to a QuickBASIC program might solve the question. Any ideas? – Michael Bikovitsky Jul 23 '11 at 20:03
  • 1
    @Mike If you're going to go the compile route with TiMidity you'll need a C compiler like Borland. I'm not familiar enough with the library to know how it works, but if there is an API call that allows you to start and stop the process asynchronously it would solve the problem perfectly. – JadziaMD Jul 26 '11 at 17:35
1

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

Marcus K
  • 779
  • 1
  • 10
  • 22
  • 1
    A question: how do you convert MIDI into the internal GDM format? – Michael Bikovitsky Jul 21 '11 at 16:11
  • 1
    You can't do it directly, but you can convert MIDI to MOD/XM/IT format using a tool such as MODPlug Tracker or BeRoTracker, then convert that file to GDM using the BWSB conversion tool – Marcus K Jul 21 '11 at 20:41
1

QB64 uses TiMidity, i guess via _SNDOPEN.

Cees Timmerman
  • 17,623
  • 11
  • 91
  • 124