home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pascal / sndpas.zip / DEMO.DOC next >
Text File  |  1989-03-09  |  3KB  |  52 lines

  1.  
  2.                               SOUNDPAS.ARC
  3.                      Turbo Pascal Sound Generation
  4.  
  5.                               Nels Anderson
  6.                              92 Bishop Drive
  7.                           Framingham, MA  01701
  8.  
  9.  
  10.  
  11. SOUNDPAS.ARC demonstrates two ways to generate sounds using Turbo Pascal.
  12. The simpler method uses tables to generate sound effects in real time.
  13. The other method replaces the clock tick interrupt to handle sounds in
  14. the background.  This is also a good demonstration of Turbo Pascal 
  15. interrupts in general.
  16.  
  17. Turbo Pascal includes a Sound() function that allows simple tones to be
  18. generated.  With a little work, Sound() can be expanded to make sound
  19. effects that are generated from simple tables.  The first demonstration,
  20. using the Pascal unit SOUNDEFF.PAS and the demo file DEMO1.PAS shows a
  21. simple way to generate sounds from tables.  Notice that execution of
  22. the program stays in the sound generation procedure for the duration of
  23. the sound.
  24.  
  25. The second method uses an interrupt that is installed in place of the
  26. normal clock tick interrupt.  This allows a sound to be generated
  27. without making the rest of the program stop.  The table of sounds will
  28. continue to be generated until the table ends even while the rest of
  29. the program continues.  This allows songs to be played while a program
  30. is running for example.  I use this method in my game EGATrek and I've left
  31. in the sound tables that I use.  There are two full songs plus a couple
  32. of random sound effects.  The demo program, DEMO2.PAS, just plays one
  33. of the songs.  Change the demo program around to hear the other sound
  34. tables.  The interrupt unit is called SOUNDER.PAS.
  35.  
  36. The units and demos have enough documentation in them that you should
  37. be able to understand them if you're familiar with Turbo Pascal.
  38.  
  39. These routines are released to the public domain.  However, if you do
  40. use them I would like to hear from you about what you're doing with
  41. them.  I'd also be interested in any new sound effects that you come up
  42. with.  You can write me at the address on the top of this file, or
  43. contact me on the Xevious BBS system (508-875-3618 or 617-449-7322,
  44. 300-9600 baud, PCBoard 14.0).  If you're connected to one of the minicomputer
  45. nets (InterNet, uucp...) you can try reaching me at one of these addresses:
  46.  
  47.                 ima!primerd!en-m32.prime.com!nja
  48.                 uunet!en-m32.prime.com!nja
  49.                 csnet-relay!en-m32.prime.com!nja
  50.                 nja%en-m32.prime.com@relay.cs.net
  51.                 nja@en-m32.prime.com
  52.