[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sound in Integer BASIC



Jim wrote:
I've got a small programme that just takes input from the serial port and
displays it on the screen. It includes a POKE to click the speaker for each
character displayed, and this works quite well. However, the standard POKE
(which I don't have on me at the moment) is perhaps a little harsh,
especially if there's a lot being displayed.

Unless Integer BASIC implements POKE without an indexed store, you
should use X=PEEK(loc) to toggle the speaker.

The indexed store accesses the speaker toggle *twice*, generating
a very short pulse, rather than changing the state as you wish.

As Matt pointed out, the ~8-instruction routine to generate a tone
is a very good beginning machine language exercise:  toggle, delay,
loop til done. If the delay and duration are set by free page zero locations (like $06 and $07 for Applesoft) you can POKE them to vary
the beep prior to the CALL.

-michael

NadaPong: Network game demo for Apple II computers!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."