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

Re: Help: Apple II Sound Trick



Kermit,

I wrote some software back in the day that did just what you are refering
to--it played multiple voices on my good 'ol ][+. I had it rigged so that
each paddle (or the x and y of the joystick) each played a note while a
third note could be selected on the keyboard. I've just recently got my
hands on my original ][+ (got it from my parents just a few weeks ago) but
it has a burnt out Disk ][ controller that I haven't been able to replace
yet. Anyway, I probably have still have the code on a disk in the stack that
was saved. If I remember correctly, the principle was pretty
straightforward. Since the speaker was a single bit device, you generated
tones by tweeking the speaker at the correct frequency. For a single tone,
you simply had a timing loop which divided the CPU frequency by the desired
output frequency and you tweaked the speaker once per interval. For multiple
tones, you set up a loop that counted ticks. If the tick count was a
multiple of one of the desired frequencies, you tweaked the speaker. It was
as little bit more sophisticated than that because volume is affected by how
close together the tweaks are. If multiple frequencies superimposed on a
single tick count, that could obviously not be produced directly on a 1 bit
device. Instead, the speaker would be tweaked for two successive ticks. I
think that increasing the volume had something to do with increasing the
number of times in a row that the speaker would be tweaked for each note.
ie. instead of tweaking the speaker once each interval (eg. at 10hz, it
would be tweaked for approx. 1 microsecond, 10 times a second) you would
tweek it say 2, 5 or 10 times in a row (2, 5 or 10 microseconds) each
interval. I don't remember exactly what the maximum switching speed of the
speaker was--I'm just assuming it was about the same as the CPU frequency.
Something like that. If I get things back and running, maybe I'll be able to
tell you.

xo boots



Kermit Woodall <kermit@novadesign.com> wrote in message
36B3C754.126F@novadesign.com">news:36B3C754.126F@novadesign.com...
>Supertimer wrote:
>>
>> I think this was how certain Apple II sound programs can pull up to
>> 3 voices out of the internal speaker (remember, this was before
>> the Apple IIGS and the Ensoniq and 32 channel sound).  One of
>> these was the Music Construction Set.
>
>Well, actually there's another trick for that, but the trick I'm looking
>for was much more elementary. A friend said the same thing is used for
>DTMF - Dual Tone Multi-Frequency. You generate two tones that you
>rapidly alternate between to generate a harmonic note.
>
>My quest for this article continues...
>--
>--------------------------------------------------------------------
>Kermit Woodall                                            Live Faust
>Nova Design, Inc.                                           Die Jung
>http://www.novadesign.com                         Leave it to Beaver
>--------------------------------------------------------------------