'===========================================================================
' Subject: MIDI CODE FOR THE SBSIM            Date: 03-23-96 (00:04)       
'  Author: Mike Huff                          Code: QB, PDS                
'  Origin: FidoNet QUIK_BAS Echo            Packet: SOUND.ABC
'===========================================================================
'Here's some of the MIDI code for the SBSIM (Sound Blaster Simplified Interface
'Module) driver. It plays in the background (of course).
'Make sure to load SBMIDI.EXE first then load SBSIM.COM next.
'Ohh, and also make sure SBSIM say driver using interrupt 81h or whatever, but
'make sure you see an "81h" when you load SBSIM or your machine will probably
'crash. This code can easily be modified to play CMFs, VOCs, and can be used to
'control the mixer.

' $INCLUDE: 'QB.BI'
DIM InRegs AS RegType, OutRegs AS RegType
Filename$ = "JAZZ.MID" + CHR$(0) 'make ASCIIZ string

' this initializes the driver and loads the MIDI.
InRegs.ax = SADD(Filename$)
InRegs.bx = 0 + 5 * 256
InRegs.dx = VARSEG(Filename$)
Interrupt &H81, InRegs, OutRegs
IF NOT OutRegs.ax THEN PRINT "MIDI sucessfully started!"

' this starts playing the MIDI.
InRegs.bx = 1 + 5 * 256
Interrupt &H81, InRegs, OutRegs

SLEEP

' this stops the MIDI.
InRegs.bx = 2 + 5 * 256
Interrupt &H81, InRegs, OutRegs
