home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / info / redbook2 / sound.bas < prev    next >
BASIC Source File  |  1992-06-28  |  2KB  |  40 lines

  1. '*****************************************************************
  2. '*  Program name: SOUND.BAS                                      *
  3. '*  Created     : 05/14/90                                       *
  4. '*  Revised     :                                                *
  5. '*  Author      : Bernd Westphal                                 *
  6. '*  Purpose     : Access the speaker system in a VDM environment *
  7. '*                Only 1 VDM has access to the speaker           *
  8. '*  Compiler    : IBM BASIC Compiler/2                           *
  9. '*  Compile     : BASCOM SOUND /O/V;                             *
  10. '*  Link        : LINK SOUND;                                    *
  11. '*  Input param : none                                           *
  12. '*****************************************************************
  13.  
  14.          CLS                           ' clear the screen
  15.          PLAY ON                       ' trap background music events
  16.          ON PLAY(3) GOSUB PlayMusic    ' If there are less than 3 notes
  17.                                        ' in the buffer gosub line 1000
  18.          PRINT "Press ENTER to end."   ' display info, how to end program
  19.  
  20.          PLAY "MB"                     ' background option for PLAY
  21.          GOSUB PlayMusic               ' start the music
  22.  
  23.          kb$ = ""                      ' keyboard input buffer
  24.          WHILE kb$ = ""                ' start of loop
  25.             LOCATE 3, 1                ' position the cursor
  26.             COLOR c                    ' change color and print some text,
  27.                                        ' to show, that music executes
  28.                                        ' independent
  29.             PRINT "Playing your favourite music ..."
  30.             c = c + 1                  ' next color
  31.             IF c > 15 then c = 1       ' no blinking mode
  32.             kb$ = INKEY$               ' get a character if present
  33.          WEND                          ' end of loop
  34.          COLOR 7                       ' white on black
  35.          SYSTEM                        ' return to DOS
  36.  
  37. PlayMusic:
  38.          PLAY "t180 o2 p2 p8 L8 GGG L2 E- p24 p8 L8 FFF L2 D"
  39.          RETURN
  40.