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

Re: How is the IIgs beep generated?



Mitchell Spector wrote:
"Michael J. Mahon" <mjmahon@aol.com> wrote:


Mitchell Spector wrote:

"Michael J. Mahon" <mjmahon@aol.com> wrote:
   It's closer in pitch, but still not the very unique IIgs "bonk".
Using the different parameters (assuming I used them correctly)
got something closer, but still not exact.

I had a IIgs and my //e side by side and put each into a loop
doing the IIgs "native" bonk and my //e bonk about once a second.
I adjusted the parameters to get the closest match, and it seemed
right in pitch, duration, and envelope.


Well, using a hardware IIGS.... immediately after doing the 'CALL 768' and listening, invoke the system bell with a CTRL-G. Do you hear how different the native bonk is? :)

    So I take it you cannot reproduce the IIGS bonk on an Apple II,
II+, IIe, IIc or IIc+ with 100% accuracy?

Well, since case size, speaker mounting, etc., all have some influence
on the actual sound, I think it's a better question whether the sound
can be produced on a IIgs without using the hardware volume control.

Because of fundamental limitations in the production of sound and the
insensitivity of the human ear to absolute sound levels, I also think
that producing the sound at a somewhat lower volume should still count
as a faithful reproduction of the sound.

So my particular routine may have some deficiencies (in parasitic
noise, duration resolution, etc.), but a similar routine could come
"close enough for all practical purposes".  ;-)

I've seen speaker toggling used in native IIGS software for audio (e.g. Paperboy, Gauntlet, John Madden's Football) but is it just old fashioned 8-bit Apple II sound. I wonder if some kind of simple music program could be written that could use it...just for the sake of seeing if it could be done. The most simple thing to try would be to play any of the Control Panel bell pitches at will, like a piano keyboard! This would be running on a IIgs of course, we're talking
about just playing the pitches in the Sound Control Panel.

Check out RT.SYNTH.  It doesn't (yet?) include a damped squarewave,
but that would be a trivial addition--with any envelope.  (Of course,
it's still 5-bit samples.)

If a damped squarewave was all that was desired, then the native IIgs
bonk routine approach (see Jerry's post) could be used, though it would
take significant re-work to get accurate musical notes.


    I've played with RT.SYNTH on my 8-bit Apple II's, it amazes me
how far you can push the internal speaker!

And I think you'd agree that it doesn't sound like "old fashioned 8-bit
Apple II sound"!

I was thinking of something unrelated though. The 15 pitches in the Sound Control Panel, they can only be played sequentially (+1 or
-1) in scale. I thought it'd be fun to program something where you
can play ANY of the 15 pitch tones at will (e.g. pitch 3, 8, 7, 15, 4).
Is there a way to access the Control Panel Sound's pitch and change it arbitrarily on the fly? Actually, I seem to remember this is what the graphical Control Panel in System 6 allows, but I'd want to assign each pitch to a key press, much like RT.SYNTH.

This should actually be quite easy for someone to do, subject to the
limitation that the sounding of one note cannot be interruped by the
sounding of another.  (In other words, each "bonk" must be allowed to
play to completion.)

It's interesting how the IIGS bonk is completely reproduceable in an emulator, like KEGS (apart from a slight click or pop at the
end). If you look at how that is done, it would reveal any of the
mystery here.

The only mystery remaining is the absolute value of successive volume
steps (a IIgs hardware characteristic).  Everything else about the
"bonk" is well understood (see Jerry's posting of the code that
produces it).

-michael

NadaNet and AppleCrate II: parallel computing for Apple II computers!
Home page: http://home.comcast.net/~mjmahon

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