home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1990 / USERAU90.MSA / LISTINGS.ARC / SAMPLE.BSC < prev    next >
Text File  |  1990-06-25  |  1KB  |  48 lines

  1. REM Play a DigiSound sample
  2. REM By R.A.Waddilove
  3. REM FAST BASIC
  4.  
  5. POKE $484,2                :\keyclick off
  6. TXTSIZE 13
  7. TXTRECT 0,0,SCREENWIDTH, SCREENHEIGHT : CLS
  8.  
  9. dummy%=ALERT("[3][Digital sounds created| with Digisound from  |    Alpha Systems][ Wow! ]",1)
  10. dummy%=ALERT("[3][Sounds played with portions|of software copyright Alpha|    Systems (c) 1987][ Understood ]",1)
  11.  
  12. RESERVE pgm%,1500 :REM space for program code
  13. RESERVE sample%,20000 :REM space for sample
  14.  
  15. BLOAD "basplay.exe",pgm%
  16. pgm% = pgm% + 28            :\skip header
  17.  
  18. REPEAT
  19.     sample$ = FNselect_file    :\get sample filename
  20.     BLOAD sample$,sample%    :\load sample data into buffer
  21.     file% = OPENIN sample$    :\get sample length
  22.     size% = EXT#file% - 648    :\ size of sample file - 648 (envelope data)
  23.     CLOSE#file%
  24.     pgm%!6 = sample%        :\set start of sample data
  25.     pgm%!10 = size%        :\set sample length
  26.     REM Speed:  5k=7  8k=6  10k=5  16k=4  20k=3  25k=2  32k=1  40k=0
  27.     speed% = 3 + ALERT("[3][select replay speed][ 16k | 10k | 8k ]",2)
  28.     pgm%!14 = speed%        :\set sample speed
  29.     PRINT TAB(11,1);"Pump up the volume!"
  30.     FOR i%=1 TO 5
  31.         CALL pgm%            :\play sample
  32.     NEXT
  33. UNTIL ALERT("[3][Another one?][ Yes | No ]",1) = 2
  34. END
  35.  
  36. DEF FNselect_file
  37. LOCAL file$,name$
  38. file$=PATH$ + "*.SND"
  39. name$ = ""
  40. button% = 0
  41. FSELECT file$,name$,button%
  42. IF button%=0 OR name$="" THEN END
  43. WHILE RIGHT$(file$,1)<>"\"
  44.     file$=LEFT$(file$,LEN(file$)-1)
  45. WEND
  46. CLS
  47. = file$ + name$
  48.