home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22286 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.5 KB  |  50 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!gumby!kzoo!k044477
  3. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  4. Subject: Re: Using the new Sound Manager
  5. Message-ID: <1993Jan28.030324.6934@hobbes.kzoo.edu>
  6. Organization: Kalamazoo College
  7. References: <1993Jan27.153602.18276@Princeton.EDU>
  8. Distribution: na
  9. Date: Thu, 28 Jan 1993 03:03:24 GMT
  10. Lines: 38
  11.  
  12. trgibney@phoenix.Princeton.EDU (Thomas R. Gibney) writes:
  13. >It appears that the "Enhanced Sound Manager" (Sys 6.0.7 and later) supports
  14. >only an equal-tempered scale when using the waveTable synthesizer.
  15. >Is it still possible to specify exact frequencies with the new Sound Manager,
  16. >as could be done with "noteCmd" described in IM vol5 ?
  17.  
  18. No;  in fact, you never could.  That feature describe in IM V was never
  19. implemented.
  20.  
  21. You can either cobble up twelve sounds in the frequencies you want (a
  22. pain in the butt, and wasteful), or you can manually tweak the
  23. sampleRate field (squirrely and weird;  may have problems if the current
  24. or a future Sound Manager depends on that value remaining constant for a
  25. sound in progress).
  26.  
  27. If this is a serious application, i.e. not for fun or for in-house use,
  28. I'd recommend the second method.  If you go that way, try keeping one
  29. copy of the 'snd ' for each channel (voice) you're playing.  (If you're
  30. only playing one voice, ignore previous sentence.  :-)  Write in the
  31. sampleRate you want--if you want C-sharp, multiply the "natural" rate by
  32. 1+(the twelfth root of two).  Then do your soundCmd to set the channel
  33. up for that sound, and your freqDurationCmd (aka noteCmd) to play it.
  34. For the next note, do it again.  You _don't_ want to write in the next
  35. note's sampleRate until the previous note has started playing.  The
  36. easiest way to arbitrate this is to drop a callBackCmd in after each
  37. freqDurationCmd, and have your callback routine figure out which value
  38. to write in next.  "Easy" here is a relative term;  it sounds like quite
  39. a headache and I'm glad I don't have to write it.  :-/
  40.  
  41. If this will be used in a controlled environment--and anything that
  42. requires a non-well-tempered scale will probably be a pretty vertical
  43. market--you might just want to put together twelve notes in the
  44. frequencies you want.  Going up or down octaves, of course, can be done
  45. with the freqDurationCmd.  It'll cost you RAM, but that's the breaks...
  46. -- 
  47.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  48.  "A degree in Computer Science from Berkeley didn't much qualify me to uphold
  49.   the banner of Chaos against the forces of Order."              - R. Zelazny
  50.