home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 91 / af091a.adf / af91a3.lzx / prgs / Sound / sound.b < prev   
Text File  |  2018-01-21  |  588b  |  40 lines

  1. '...an example of SOUND & WAVE usage
  2.  
  3. print
  4. print "white noise:"
  5. print
  6. size&=4000
  7. addr&=ALLOC(size&,0)    '...size& bytes of CHIP RAM
  8.  
  9. print "writing random bytes..."
  10.  
  11. for i&=0 to size&-1
  12.   r%=rnd*128
  13.   s%=rnd*2
  14.   if s%=1 then r%=r%*-1
  15.   poke addr&+i&,r%
  16.   if i& mod 1000 = 0 then print i& 
  17. next    
  18. print
  19.  
  20. wave 0,addr&,size&
  21.  
  22. sound 300,18
  23. for d=1 to 2000:next d  '...pause
  24.  
  25. sound 300,18,,0
  26. for d=1 to 2000:next d  
  27.  
  28. sound 300,18,64
  29. for d=1 to 2000:next d  
  30.  
  31. vol=64
  32. for i%=400 to 200 step -15
  33.  sound i%,4.5,vol,0
  34.  vol=vol-3
  35. next
  36. for i%=200 to 400 step 15
  37.  sound i%,4.5,vol,0
  38.  vol=vol+3
  39. next
  40.