Subject: Re: another sound survey...
To: SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>
From: Colin Wood <cwood@ichips.intel.com>
List: port-mac68k
Date: 05/07/1998 11:36:44
SUNAGAWA Keiki wrote:
> Colin Wood <cwood@ichips.intel.com> wrote:
>
> Colin> Now for the survey part. I'm including a copy of the
> Colin> source for my beeping program below. I guess that
> Colin> it's really a square-wave tone generator. Once
> Colin> you've compiled it (assuming "gcc -o beep beep.c"),
> Colin> you invoke it like so:
>
> The code I sent drove ASC in free-wave mode and This drives
> it in four voice mode.
No, this is the EASC's square-wave mode (which appears to simply be a
variation on synthesized/free-wave mode). Four-voice or wavetable mode is
_much_ more complicated on both, mainly because the hand-coded assembly
does strange things to avoid running out of registers :-)
The ASC appears to have a dedicated square-wave mode. The interesting
thing about it is that the current asc.c driver appears to be playing a
synthesized sound in the ASC's dedicated square-wave mode (i.e. it sets
0x830-0x837 to a value related to the frequency instead of to 0xFE like in
synthesized sound mode).
> It's pretty good that if there are
> some ioctls to handle both modes of [E]ASC.
I'm glad it works :-) True synthesized sound might require more work,
tho. I still haven't gotten it to stop coughing on the sample with
the 22kHz sampling rate, and that's what most are. I may have an idea for
a workaround, tho.
> I think...
>
> /dev/bell for bell device.
Some NetBSD platforms do have some minor device number versions of
/dev/audio used as a console bell, I think. That might not be too hard to
do.
> /dev/audio for play audio file.
>
> Thoughts?
Definitely :-) There is already a machine-independent /dev/audio. All it
will take is writing the glue code once we've figured out exactly how the
silly thing works (or so I think ;-)
> Colin> temp = 0x11999999 / count;
>
> The magic number is 0x58000000 on IIcx. There may be
> another?
Possibly. I didn't try it on my SE/30 last night because it was getting
late. I assume that it will work on the original II-series Macs since the
sound hardware is pretty much the same as in my IIci. I've got a dump of
the SE/30's .Sound driver. I'll have to take a look at it to make sure
I'm not screwing anything up....
> BTW, I made a test prog. try to figure the 4 tones and it
> made a kind of harmony, but I found that I needed to
> implement the scheme to handle musical score even if there
> are limited only 4...
:-) Cool.
Good luck!
--
Colin Wood cwood@ichips.intel.com
Component Design Engineer - PMD Intel Corporation
-----------------------------------------------------------------
I speak only on my own behalf, not for my employer.