[comp.sys.mac.programmer] sound

larson@unix.SRI.COM (Alan Larson) (11/04/88)

I have some questions concerning the sound driver and hardware.

When using the Free From synthesizer, I have discovered that
the values in the waveform correspond to voltage at the speaker
terminal as follows:

	value	voltage on center pin of speaker connector
	 255	most positive value
	 128	zero voltage
	   0	most negative value

After a free form waveform is transmitted, the voltage appears to remain
at the last value sent from the waveform.

At the start of a free form waveform, a brief period of 0 is sent (the
most negative voltage).  Unless the previous value was 0, and the
new waveform picks up smoothly from 0, this causes a click in the speaker.

Calling StopSound() will reset the voltage to zero (value 128), perhaps
with some overshoot (I was watching with a voltmeter, not a scope).
If the voltage was at some different value (such as value 0) from the
previous waveform, this causes a click in the speaker.


This was all discovered on a SE.

I tried running with all waveforms starting and ending at value 0 so there
would be no clicks (there were no StopSound calls).  On the SE, this produced
clean sounds.

I tried running this on a Mac II.  There were clicks audible.  Why?


I tried running the program on a Mac +.  I don't recall if there were
clicks audible between my sounds, but after the last sound was finished,
while polling for a keyboard hit, it produced a fairly loud obnoxious
buzzing sound.  The other machines had not done this.


Can anyone shed some light on this?  Please!

	Alan

jmunkki@kampi.hut.fi (Juri Munkki) (06/28/89)

Warning: This is a *** FLAME ***

I just read the new and revised technote 19 and I must say that I no longer
believe that Apple is serious about sound support in their products.

>The Sound Driver is no longer supported.  There have always been, and
>still are, bugs in the glue code for StartSound.

Where have these bugs been documented? What are they? Why aren't they
documented in this technote? Even if using StartSound is not documented,
I feel I should know about the bugs. I'm not going to rush and change
all my existing programs to use the Sound Manager.

>The Sound Driver may not be present in future System Software releases,
>or future hardware may not be able to support it.  The Sound Manager is
>the applications interface to the sound hardware.

Ok, I accept this, but I expect something in return. I finally had the
time to write a sound subroutine suitable for arcade games and now Apple
pulls the rug from under me.

>The technique used to create a continuous sound should have only been
>used on a Macintosh Plus or SE, since these are the only models that
>have the embarrassing click.  Do not use this method on a Macintosh
>which has the Apple Sound Chip.

Why? I would like to know the reason why I'm not supposed to do this when
it works so well. This is the only way to produce sound so that it is
compatible with every existing Macintosh model. (Except the Lisa/MacXL)

>Further Reference:
>*	The Sound Manager, Interim Chapter by Jim Reekes, October 2, 1988

It should be called:
	The Sound Manager, Bugs & Features
or
	The Sound Manager, Why You Can't Use It.

The interim chapter basically says that you can't use the sound
manager for anything else besides producing a beep sound... At least
I don't find the functions it offers to be of any use to me. Playing
the beep is simple, but anything beyond this is close to impossible.

Apple sure advertises the Mac II as capable of stereo sound, but the
only program that I've heard of playing in stereo is SoundEdit. What
use is a superb sound chip if you aren't allowed to use it for anything?
Or is the ASC reputation all hype and no truth?

I think the sound manager should be scrapped along with the sound driver
and something better should be offered. If you intend to keep on changing
the rules, you might offer something truly good. I thought Apple had all
the necessary r&d money to develop something that makes sense. Give me
ASC documentation and I'll write something better.

Another thing:	if the new and rewritten system 7.0 is any larger than the
		current system 6.0, I think it is flawed. It is possible to
		make the system smaller by leaving out kludges. The first
		thing that comes to mind is MFS support.

I wonder what company will be the new innovator when Apple is gone.
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
|     Juri Munkki jmunkki@hut.fi  jmunkki@fingate.bitnet        I Want   Ne   |
|     Helsinki University of Technology Computing Centre        My Own   XT   |
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^

tim@hoptoad.uucp (Tim Maroney) (06/29/89)

In article <23252@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes:
>
>I just read the new and revised technote 19 and I must say that I no longer
>believe that Apple is serious about sound support in their products.
>
>>The Sound Driver is no longer supported.  There have always been, and
>>still are, bugs in the glue code for StartSound.
>>The Sound Driver may not be present in future System Software releases,
>>or future hardware may not be able to support it.  The Sound Manager is
>>the applications interface to the sound hardware.

So what's wrong with the Sound Manager?  Granted, it's irritating that
Apple sometimes redefines the way parts of the OS work, but you have to
understand that the early Mac OS was a bit of a rush job that wasn't
expected to last this long.  Replacing particularly messy bits like
the Sound Driver and Print Manager is necessary to prolonging the
useful life of the OS.

>The interim chapter basically says that you can't use the sound
>manager for anything else besides producing a beep sound... At least
>I don't find the functions it offers to be of any use to me. Playing
>the beep is simple, but anything beyond this is close to impossible.

I don't get it.  What interim chapter?  Is there something wrong with the
Sound Manager chapter in Inside Mac volume V?  Have I missed something?
My copy of Tech Note #19 makes frequent reference to "the Sound Manager
described in Inside Mac volume V".  And you can do a lot more than beep!
Nor is it difficult -- what could be easier than SndPlay?

>I think the sound manager should be scrapped along with the sound driver
>and something better should be offered. If you intend to keep on changing
>the rules, you might offer something truly good. I thought Apple had all
>the necessary r&d money to develop something that makes sense. Give me
>ASC documentation and I'll write something better.

What specifically is the problem with the Sound Manager?  How would
you improve it?

>Another thing:	if the new and rewritten system 7.0 is any larger than the
>		current system 6.0, I think it is flawed. It is possible to
>		make the system smaller by leaving out kludges. The first
>		thing that comes to mind is MFS support.

Eh?  The file system has been in the ROM since the Mac Plus days.  In
fact, the new B-Tree Manager in System 7.0 is mostly a matter of
documenting hooks that have always been in HFS, not adding any new
code.  I don't see how you could leave out MFS support, since it's in
ROM -- and obviously, there are a lot of single-sided floppies out
there that you can't break!

System 7.0 will be larger.  That's one reason it will require two
megabytes.  It has a lot of new managers and reimplemented managers,
yet it must preserve backward compatibility.  Fortunately, RAM prices
will be quite low by first quarter 1990, which is when I expect System
7.0 to be released to the public.

>I wonder what company will be the new innovator when Apple is gone.

Do you really think a company with a quarter of a billion dollars cash
in the bank is just going to go away because you have some unspecified
complaints with the Sound Manager?
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com
Postal: 424 Tehama, SF CA 94103; Phone: (415) 495-2934

A good flame strengthens its points; it does not stand in lieu of them.

jmunkki@kampi.hut.fi (Juri Munkki) (06/29/89)

In article <7788@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>So what's wrong with the Sound Manager?

Page 32 of the new sound manager chapter:
	"There can only be a single monophonic channel; stereo is not
	 supported."

I think there should be a way of playing multiple stereo channels.
Using the old technote 19 and the sound driver, it was easy to
mix two monophonic channels into one monophonic channel.

>Granted, it's irritating that
>Apple sometimes redefines the way parts of the OS work, but you have to
>understand that the early Mac OS was a bit of a rush job that wasn't
>expected to last this long.

I think the original Mac OS was much cleaner than the current hack.

>Replacing particularly messy bits like
>the Sound Driver and Print Manager is necessary to prolonging the
>useful life of the OS.

Plastic surgery nevers prolongs the file of the patient... It just
makes the patient look better. They should scrap everything they
have and start fresh. This is something that Apple Computer will
not do. System 7.0 retains too much compatibility with old systems.

>What specifically is the problem with the Sound Manager?  How would
>you improve it?

Better use of the ASC. Stereo sound simulating multiple monophonic sources
placed in space.

>>Another thing:if the new and rewritten system 7.0 is any larger than the
>>		current system 6.0, I think it is flawed. It is possible to
>>		make the system smaller by leaving out kludges. The first
>>		thing that comes to mind is MFS support.
>
>Eh?  The file system has been in the ROM since the Mac Plus days.

They should scrap everything in the current ROMs. I think they will
rewrite most of the stuff. I'm sure Finder code will be reduced by
removing support of MFS disks. They could just put up a dialog asking
to run Apple File Exchange to move the files from the MFS disk.

>>I wonder what company will be the new innovator when Apple is gone.
>
>Do you really think a company with a quarter of a billion dollars cash
>in the bank is just going to go away because you have some unspecified
>complaints with the Sound Manager?

No. Do you? :-) Apple is not going away. They aren't going away any
more than IBM is going away. I just think that their edge will wear
out in the next few years. The Macintosh OS is not immortal. Rewriting
it while maintaining compatibility with older systems reminds me of
VM/SP.

The amount of new hacks & kludges tells me that something is very wrong.

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
|     Juri Munkki jmunkki@hut.fi  jmunkki@fingate.bitnet        I Want   Ne   |
|     Helsinki University of Technology Computing Centre        My Own   XT   |
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^

ngg@bridge2.ESD.3Com.COM (Norman Goodger) (06/30/89)

In article <23301@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes:

>Plastic surgery nevers prolongs the file of the patient... It just
>makes the patient look better. They should scrap everything they
>have and start fresh. This is something that Apple Computer will
>not do. System 7.0 retains too much compatibility with old systems.
>The amount of new hacks & kludges tells me that something is very wrong.
>
The problems with doing this are major, you cannot expect thousands of
Mac Users who are using older systems to accept that instantly their Mac's
are completely obsolete just because you feel that the current OS does not
live up to your expectations or what you think it should be. If Apple were
to abandon backward compatability for the reasons you site, the screams
would be louder then they are now about some of the things that Apple is
perceived of doing. While I concur that there is a variety of improvements
that could be made in the Mac OS and I think that 7.0 is a good step in
that direction, eliminating backward compatabilty is not the way to do it.



-- 
Norm Goodger				SysOp - MacInfo BBS @415-795-8862
3Com Corp.				Co-SysOp FreeSoft RT - GEnie.
Enterprise Systems Division             (I disclaim anything and everything)
UUCP: {3comvax,auspex,sun}!bridge2!ngg  Internet: ngg@bridge2.ESD.3Com.COM

spector@brillig.umd.edu (Lee Spector) (08/30/89)

Does anyone have code for playing sounds (preferably without "clicks")
from Macintosh Allegro Common Lisp?  I've read the ACL manual's chapter
on mac traps, and I've looked at a few sound-related mac tech notes, but
I haven't yet got anything to work.

On a related note, does anyone know of an ftp site or mailing list
where one can obtain mac ACL sources?  I've poked around summex and a few
other sites, but have been unable to find anything specifically for macintosh
common lisp.

Many thanks!  -Lee (spector@brillig.umd.edu)

eshellrn@bimacs.BITNET (eshel liran) (05/09/91)

I am intersted in finding how i can produce a sound that will be played
symultaniusly without delaying my program, using turbo pascal.

Another question is concerning the format of macwrite. Is there a way i can
find out how macwrite saves his files, so i can build them myself using pascal?

Please send your answers to me directly using email
to eshellrn@bimacs.biu.ac.il

thanks.