home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / apple2 / 19902 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.2 KB  |  65 lines

  1. Newsgroups: comp.sys.apple2
  2. Path: sparky!uunet!usc!sdd.hp.com!ux1.cso.uiuc.edu!news.iastate.edu!irsman
  3. From: irsman@iastate.edu (Ian Schmidt)
  4. Subject: Re: Sound
  5. Message-ID: <1992Sep5.230433.13319@news.iastate.edu>
  6. Sender: news@news.iastate.edu (USENET News System)
  7. Organization: Iowa State University, Ames, IA
  8. References: <1992Sep5.223747.17988@mnemosyne.cs.du.edu>
  9. Date: Sat, 5 Sep 1992 23:04:33 GMT
  10. Lines: 53
  11.  
  12. In article <1992Sep5.223747.17988@mnemosyne.cs.du.edu> cshepher@nyx.cs.du.edu (SSP Guy...) writes:
  13. >
  14. >Hello...
  15. >     I'm writing a simple routine to play a sound, which happens to be
  16. >$4c00 bytes long, by using the DOC Registers in bank $00. The problem is,
  17. >it plays about 1 second of the sound, then stops. I know that the whole
  18. >sound is being uploaded to DOC RAM, so I suspect I'm not setting the
  19. >waveform register right. Any ideas? Ian?
  20.  
  21. You've come to the right place ;)
  22.  
  23. There are a couple of things that can cause this...
  24.  
  25. 1) there may be a zero in the sound
  26. 2) you aren't setting the bankselect/tablesize/resolution register for the
  27. appropriate oscillator(s) high enough
  28.  
  29. I'd guess your problem is #2.
  30.  
  31. The BTR register, DOC registers $C0-$DF, selects the size of the sound, as
  32. well as the resolution of the DOC registers.  For normal tuning, the
  33. size and resolution must be identical.  These are the appropriate values:
  34.  
  35. %000  =  256 bytes ($100)
  36. %001  =  512 bytes ($200)
  37. %010  = 1024 bytes ($400)
  38. %011  = 2048 bytes ($800)
  39. %100  = 4096 bytes ($1000)
  40. %101  = 8192 bytes ($2000)
  41. %110  =16384 bytes ($4000)
  42. %111  =32768 bytes ($8000)
  43.  
  44. You use the smallest value greater than or equal to the size of the wave you
  45. play.  For your example (a $4c00 length sound) you'd use the max value of
  46. %111.  To make this into a normally valid BTR register, repeat the value twice
  47. and stick two 0 bits on the left to make it a byte...
  48.  
  49. %00 xxx xxx
  50.  
  51. In this case, %00111111 = hex $3F.
  52.  
  53. Hope this helps (whew)!
  54.  
  55. >| Chris Shepherd Starving Programmer  | cd119@Cleveland.Freenet.Edu |
  56. >|    Ask me about Impasse //gs        | cshepher@nyx.cs.du.edu      |
  57.  
  58.  
  59.  
  60.  
  61. -- 
  62.    _IanSchmidt(oINet+irsman@iastate.edu,oBITNET+twbv4@isuvax,$C000,Data)
  63.      Data  dc i'Apple IIgs,Rush,Tiny Toons,Dave Barry,David Letterman'
  64.  "I will choose a path that's clear: I will choose free will" - Neil Peart
  65.