Adlib-S3M player for QuickBasic, with effects support

0. Contents

This is the documentation of fmengineqb-1.0.2.1.
   1. Purpose
   2. Neat features
   3. Notes
      3.1. Example songs
      3.2. Hazards
      3.3. How does its timer handler work?
      3.4. If it does not play anything
      3.5. Memory usage
   4. Short example
   5. Discussion
   6. Copying
   7. Downloading

1. Purpose

Some entirely in QuickBasic written subroutines for playing Adlib-S3M or MidiS3M files in a QuickBasic program.

2. Neat features

3. Notes

3.1. Example songs

The archive contains some example songs and one example effect file.
Two of the example songs are made by Future Crew, four by me, and two by Warp.

3.2. Hazards

The current version just assumes you have MPU-401 too. If you don't have, just edit the MPUwrite subroutine and add a EXIT SUB clause there to be the first command.

3.3. How does its timer handler work?

It uses ON PLAY event mechanism for the timing, and plays short silent pause commands. Therefore you can not make speaker beeps while the player is playing. This does not affect the performance of the main program.

3.4. If it does not play anything

In the example program, you must press a key (try a,b,c,d,e,f,i,j,g,h,v,0,1 keys).
Note that your sound card must really be Adlib compatible. Creative Sound Blaster AudioPCI 128, for example, is not.

3.5. Memory usage

The player uses following global static tables, and nothing else:
VarSize in bytesType
fmperiod24int[0..11]
order512int[0..255]
adldata2400int[1..100,0..11]
insdata1200{6 ints}[1..100]
adlchan896{14 ints}[0..31]
MIDInote64int[0..31]
MIDIchan64int[0..31]
fmfilename4+nstring
fmpattern4+nstring
fmeffect4+nstring
fmdata46{17 ints,double,long}
fmeff24{3 ints}[0..3]
Total:5242+n
(I am sorry for the big amount of names used, but QuickBasic does not allow putting arrays or dynamic strings inside typedefs.)

4. Short example

'$INCLUDE: 'fmengine.bi'
pleiplei: IF FMtimer% THEN RETURN
IF FMinit < 0 THEN PRINT "FM sound not available.": END
FMload "mysidia.s3m"
' The main loop
WHILE INKEY$ = "": WEND
FMend
END

Could it any way be simpler than this?
 
(Note you must copy FMinit%(), FMtimer%(), MPUDetect%(), MPUvol%(), VibVal%(), note2period%(), FMend(), FMload(), FMnoteoff(), FMplayeffect(), FMplayrowfrom(), FMtouch(), FMupdate(), FMwrite(), MPUwrite() and Vaikene() to the program, but these do not bother your editing, do they? :) )

5. Discussion

Okay, who uses QuickBASIC today? If you find this program useful, you are strongly encouraged to tell me.
However I'm planning to make a QuickBASIC compiler for *nix systems like Linux. See the project page for details. You are encouraged to join as a developer if possible :)

6. Copying

fmengineqb has been written by Joel Yliluoma, a.k.a. Bisqwit,
and is distributed under the following terms:
* No warranty. You are free to modify this source and to
* distribute the modified sources, as long as you keep the
* existing copyright messages intact and as long as you
* remember to add your own copyright markings.
* You are not allowed to distribute the program or modified versions
* of the program without including the source code (or a reference to
* the publicly available source) and this notice with it.

7. Downloading

The official home page of fmengineqb is at http://oktober.stc.cx/source/fmengineqb.html.
Check there for new versions.

Generated from progdesc.php (last updated: Wed, 15 May 2002 11:23:53 +0300)
with docmaker.php (last updated: Wed, 15 May 2002 04:26:32 +0300)
at Wed, 15 May 2002 11:23:55 +0300