[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I program sound on my IIGS from Basic?
NoAdsOnMyStuff <CantStandSpam@my.email.address> wrote:
> Hi -
> I'd like to write an AppleSoft Basic program on my daughter's IIGS
> so that when she hits different keys, she gets different tones & sound
> effects. Anyone know how to do this?
It isn't very easy. There are only two readily accessible sound effects
that can be generated in Applesoft BASIC: the standard beep, and a
single click (by PEEKing the speaker location).
Anything more complex has to be done by doing a series of accesses to
the speaker. Even then, you cannot achieve very much in BASIC by
itself, because you need to access the speaker fast enough to get
reasonable tones out of the speaker, and BASIC is pretty slow.
The best solution is to use a small machine language routine that does
the required access pattern to the speaker, with behavioural
modifications controlled by the BASIC program. This program can be set
up by using the BLOAD command (from a binary image on disk), or (if
small enough) by POKEing it directly into memory.
Having said all that, I haven't done much experimentation with sound on
the Apple II, and don't have any convenient routines that I could
provide. Anyone else have any useful suggestions?
--
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand