[ont.micro.mac] Macintosh Sound Barrier Expounded

info-mac@utcsrgv.UUCP (info-mac) (04/26/84)

Date: Monday 23 April 1984 12:02:53 EDT
From: Leo Hourvitz <uw-beaver!leo@mit-pamela>
Subject: Macintosh Sound Barrier Expounded
To: <info-mac@mit-pamela>

Finally got my copy of Inside Mac.  Here's a summary of what it
says about sound.  Sorry if it duplicates something you already
got.

The recommended way to access sound is through the sound driver,
part of the installed operating system (i.e., in the ROM).  You
make Write and Control calls on it, just like all those OSs we
know and love.  The Write call gives a pointer to a sound
record, the first longword of which determines which of the
three types of sound generation should be used.

If that first integer is negative, the Mac generates square
waves (not very interesting).  The sound record in this case
contains a zero-terminated list of frequency, amplitude,
duration integers, which are played in order.

If that first integer in the sound record is zero, the Mac
begins freeform sound wave generation.  You give a waveform
table of up to 256 bytes, and a fixed-point duration of each
sample in the waveform table, in 44usec units.  The Mac plays
each of the entries in the waveform table for the specified
number of 44usec units, then stops.  To generate continuous
sound, you perform a write of this type continually.

If that first integer in the sound record is positive, you do
the interesting sound synthesis, the four-voice engine.  This
record has, first, the duration (in 16msec units -- I dunno
where that comes from) of the sound described by this record.
Then, for each of four waveforms, it has the phase and rate (->
frequency) fixed-point integers, and the 256-byte waveform
description table.  This mode is definitely the most powerful,
letting you play and synthesized waveform repeatedley at a
selected rate.  It is not stated how it combines the four
waveforms, though I suspect it adds and clips (I have problems
believing it can do any sort of multiplicative combination at
that rate).  The four-voice engine is the basis of the Mac
speech heard at various places.

There are three Control calls.  One of them sets the amplitude
of the square wave generator.  Whooppee.  Another is KillIO
(does the obvious).  The third controls the 'three volume bits'
on the VIA.  I quoth the manual: "Applications shouldn't change
the speaker volume, as it's really up to the user to choose the
normal sound level via the Control Panel desk accesory."  I
think that for a hot-dog music program, one would probably
ignore the above warning.

So, it looks like, just as with the User Interface, one thinks
of  the sound capabilities in terms of the hardware capabilities
+ the provided software tools.  I suspect that the functions
provided by the sound driver are simply to useful, and the
ROM/RAM performance differential too high, too allow bypassing
the sound driver (not that I'd want to).  The sound looks like a
source of great fun and kludgery!  Let's go.

Leo

Leo Hourvitz
Architecture Machine Group, MIT
leo%pamela@mit-mc		(Arpanet)

info-mac@utcsrgv.UUCP (info-mac) (04/27/84)

Date: Thu, 26 Apr 84 10:02:22 EST
From: uw-beaver!"Jack Juni"@UMich-MTS.Mailnet
To: PATTERMANN@SUMEX-AIM.ARPA
Subject: Macintosh Sound Barrier Expounded

What's really needed for us SEMI-sophisticated (if that) hackers would be a
short public domain driver rourine(s) accessable from the Mac as it stands
now.  Unfortunately, I haven't yet been able to spring for Inside Mac and
I don't have a 68000 assembler.  Anyone have any ideas?
      Jack Juni  (Univ of MIchigan)