home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / atari / st / tech / 4116 < prev    next >
Encoding:
Text File  |  1992-07-23  |  3.6 KB  |  93 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!mcsun!fuug!funic!nntp.hut.fi!nntp!eye
  3. From: eye@lesti.hut.fi (Petri M Kuittinen)
  4. Subject: Re: Sound Chip:  What are the volume levels?
  5. In-Reply-To: warwick@cs.uq.oz.au's message of 20 Jul 92 23:41:29 GMT
  6. Message-ID: <EYE.92Jul23122240@lesti.hut.fi>
  7. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  8. Nntp-Posting-Host: lesti.hut.fi
  9. Organization: Helsinki University of Technology, Finland
  10. References: <9466@uqcspe.cs.uq.oz.au>
  11. Date: 23 Jul 92 12:22:40
  12. Lines: 79
  13.  
  14.    According to the Abacus Internals book, the volume levels on the Yamaha sound
  15.    chip in the ST uses "logarithmically raised" volume levels.
  16.  
  17.    I'd like to know exactly what the volume levels are, in order to calculate a
  18.    better "magic table" for my sampled sound player.  I've looked at the tables
  19.    used in some programs, and they don't seem too accurate according to some of
  20.    the calculations I've done - but I don't know how they came up with them.
  21.  
  22. I have also noticed the same problem, I looked through many sample tables I
  23. got. After several weeks, I finally came up with a solution, which
  24. seems right (please don't flame me if I am wrong!). The accurate volume levels
  25. seem to be:
  26.  
  27. Sound chip Volume    Real Volume (down from max.)
  28.  
  29. 15            -0 dB
  30. 14            -3 dB
  31. 13            -6 dB
  32. 12            -9 dB
  33. 11            -12 dB
  34. 10            -15 dB
  35. 9            -18 dB
  36. 8            -21 dB
  37. 7            -24 dB
  38. 6            -27 dB
  39. 5            -30 dB
  40. 4            -33 dB
  41. 3            -36 dB
  42. 2            -39 dB
  43. 1            -42 dB
  44. 0            -45 dB
  45.  
  46. So a change of 1 in sound chip volume value will change the real volume by
  47. 3 desibels. And desibels of course are calculated like this:
  48.  
  49.         dB=10*lg(I/10^-12 W/m^2)
  50.  
  51. where lg is 10-based logarithm and I is intensity of sound.
  52.  
  53. With one sound channel you can achieve maximum of 45dB dynamics, but sound
  54. quality will be poor. With combined 3 channels you will get max. 49.8 dB
  55. dynamics (10*lg(3*10^4.5=49.7712...). Most sample players use all the sound
  56. channels to get more accurate simulation of the 256 8bit-sample values. I
  57. don't know how the freq. values (in sound chip register 0-5) affect the volume,
  58. but I guess with the use of them one could achieve even better dynamics.
  59. (Normally sample players on ST, set the frequency-registers to zero and set
  60. all sound channel off -> mixer register).
  61.  
  62.    If someone can find out what the "logarithmically raised volume levels" are,
  63.    I can post the be-all-and-end-all set of "magic tables", so we can all
  64.    benefit.
  65.  
  66. Yes, post the table! It would be nice if you would also calculate a table for
  67. 1 sound channel samples (eg. many ST-musicians use only one channel to produce
  68. digi-drum sounds).
  69.  
  70.    I tried a guess of sqrt(2)^V, and it seems pretty good - maybe even better
  71.    than the tables I was using before.
  72.  
  73.    With the program I've written, I can produce "magic tables" of varying
  74.    characteristics - eg. one to play softer-recorded sounds at increased
  75.    volume without first doing an information-losing scale-up.  The Sun Sparc
  76.    "ulaw" format could be trivially supported by this program too - it should
  77.    give quite EXCELLENT reproduction of those sampled sounds - probably even
  78.    better than is possible with the STe/TT DMA sound hardware.
  79.  
  80.    All I need is the coefficient of the "logarithmically raised" volume levels.
  81.  
  82. When you calculate the "magic" table, try to get the the most silent sample
  83. values correct, human ear becomes more inaccurate with louder values and it's
  84. not so important to get them correct.
  85.  
  86.  
  87.             The <(O)> Eye
  88. --
  89. | The Eye of Brainwash Company    |    LEA    POINT(PC),A3    ;Don't try  |
  90. | E-mail:eye@niksula.hut.fi    |     ADD.L     #$465707B7,(A3)    ;this M68000|
  91. | S-mail:Timpurinkuja 1 C 39    |     LEA    $8000,A4    ;assembler  |
  92. |     02600 Espoo, Finland    |POINT:    ORI.W    #$5945,D5    ;program!!  |
  93.