[net.micro.amiga] Amiga sound chip Answers

knudsen@ihnss.UUCP (09/12/85)

Well, here I am answering my own dumb questions and, I hope,
some others' as well.  A few days ago I posted some queries about
the Amiga's sound chip scheme.  Turns out the answers were in the
Byte article that I had already carefully read!  (Whatever you
do, don't let your age go over 40... blows your RAMs....)

	The news is good and bad.  Yes, the chip allows for
AM and FM synthesis.  It generates arbitrary waveforms out
of previously-loaded tables, just like on the KIM back in '77,
but can mung these together by AM or FM.  And, these tables
can be as long as you want, so as to play out a digitized (sampled)
one-shot sound event (like a glass marble shattering).
No mention of an on-board A/D.  Hopefully you can write
directly to the D/A converters.
	Bad news: there are only 4 channels of sound.
Any kind of modulation sacrifices a channel to another,
so only two FM notes could be played together.  Not so hot.
Good news: each channel has its own envelope generator (ADSR).
Also, you could prestore nice 4-note major, minor, etc. chords
and play a whole chord out of one channel!

	Fact:  the channels play out 8-bit bytes of samples
(not really hi-fi), tho they read 16-bit words at a time.
Probably requires even number of samples per waveform.
	More bad news: pitch is controlled by period, not frequency.
And that's period between samples.  The resolution is around 279
nsec, or 1 / 7.++ MHz clock rate.  So, if your waveform contains
N samples, to play it at 440 Hz requires a divider D such that
	440 = 7M / (N * D).
Trouble is, for reasonable N values, like 256, at higher pitches
the D values get pretty small, so your pitch resolution
is limited, making it hard to get higher notes in tune.
Can beat this by making hi-pitch wave tables shorter
(which is physically a good idea), but it's a pain.
	Also, the FM jiggles period, not frequency.
Serious FM usually drives frequency negative, which I'm sure this chip
can't handle.  And the modulation will be very nonlinear
(but that may just make for richer sounds).

	Summary:  Amiga music is OK, if you use lots of ingenuity
to beat the system.  I've been beating KIMs and Cocos for years;
when do we get a music system that you can PLAY, not FIGHT?
	mike k
PS: watch the digital signal processing (DSP) microchips
that have been out for a while.  Someday this technology
will give us worthwhile built-in music capabilities.