[comp.sys.mac.programmer] System 7.0 Sound Manager thanks and comments

potts@itl.itd.umich.edu (Paul Potts) (04/23/91)

In his reply to my posting, Jim Reekes writes:

>There has NOT been any "important functionality" that was removed from
>the Sound Manager.  Only frequency values of 0..127 are supported.

OK, I will believe this. My problem, therefore, has been in incorrect
documentation. Prior to the 7.0 beta 4 CD/ROM, I had his 1988 interim
sound manager information, downloaded from Apple.com. I also had
the draft of IM-6 from the January 1991 Developer's CD/ROM and the
7.0 beta 1 CD/ROM. This said:

"When you specify a frequency as a frequency value, you use the lower
three bytes of param2 to pass the desired value. Any value greater
than 127 passed in the lower three bytes is interpreted as the
actual frequency at which to play."

The lower three bytes (the lower two, in fact) would be plenty of
space to represent a fixed point or short int value for frequency.
I thought originally that I could use the square wave synth to play 
notes at these frequencies, without worrying about the fact that the 
sampled sound header now only has one byte to represent baseNote. This
turns out not to be true.

>This is properly documented in Inside Mac VI.  Arbitrary frequencies
>are not, and [have] never been supported...

>All version of the Sound Manager, including what is shipping in System 7,
>[do] not support anything other than values of 0..127...

OK, my point is just that in something that has been shipping since
1989, we ought to have been able to get correct information on it
before the 7.0 beta 4 CD/ROM.

>The Sound Manager doesn't support this for a few reasons.  The Sound
>Manager has no way of determining the original frequency of the sound.
>A baseNote of 56 may be a pitch of 440 Hz, but what if the original
>pitch wasn't in equal temperament (a pitch between the notes of a
>piano)?  It's impossible to represent this in the Sound Header.

It is now, with the revised sound header. If a different scheme had 
been implemented to create the sampled sound header, this wouldn't 
have been a problem. I will agree that this change probably won't hit
many developers. I was just rather startled when I came upon it, and
began casting about on the net partly out of curiosity's sake.

>The Sound Header was changed when the original MACE package was
>released.  This was done in 1989.

Wow! It has been documented wrong for a long time, then. Well, there
is nothing that can be done about it now. 

Thanks, Jim Reekes for your help.  I will be implementing a new scheme 
for the audiometer using pre-made samples looped with freqDuration commands 
(formerly note commands). 

I just wish that I had known about the limitation earlier, so that I could 
have done something more productive with the days that I spent trying to 
figure out why playing 500 Hz didn't work. Documentation continues to be
a problem for us. I could expect to only have draft information on system 7, 
since it hasn't been released yet, but MACE was released quite some time ago.
I love getting information on CD/ROM, but the mechanism for getting interim
information out clearly wasn't working as well as it should have been.
Maybe keeping up-to-date information on apple.com would help.

Thanks again for your speedy reply.

-Paul Potts-