[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sound in Integer BASIC
- Subject: Re: Sound in Integer BASIC
- From: "Michael J. Mahon" <mjmahon@aol.com>
- Date: Mon, 19 Nov 2007 10:15:13 -0800
- In-reply-to: <slrnfk2sdo.2ib7.jim@wotan.magrathea.local>
- Newsgroups: comp.sys.apple2
- References: <slrnfk2sdo.2ib7.jim@wotan.magrathea.local>
- Reply-to: mjmahon@aol.com
- User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
- Xref: g2news1.google.com comp.sys.apple2:30578
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."