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

Re: cassette data specs req.



OOAEOOMSNR asked:

>No.  Rather than get into a discussion of modulation and D/A converters, let
>me just say that what I'm after is to understand what the Apple does to
>convert programs to sound and back again.  Does it use frequency shift
>keying like a 300 baud modem?  What frequencies mean what to it?

Perhaps the easiest way to put it is that the Apple speaker is software
controlled by a one-bit toggle.  Software can decide to toggle the speaker
from "full on" to "full off" or vice versa, at a resultion of one cycle of the
processor clock (but not too often, since the toggling instructions require
several cycles).  An unaccelerated Apple II clock is about 1 microsecond.

Sounds are usually made by toggling the speaker at regular intervals to
create tones.  More complex sounds can be created by toggling it at an
ultrasonic rate, with a pulse width corresponding to "intermediate" positions
of the speaker cone, or the desires audio waveform.  This is a technique
used by relatively few programs (of which mine is one--see .sig  ;-).

The monitor cassette routines use a simple approach of toggling the
speaker to create one pulse width for a zero bit and another (twice
as wide or half as wide--I forget which is which) for a one bit.  When
the recorded waveform is played back into the cassette input port,
the zero crossings are sampled (again, one bit!) and a monitor
routine times the interval between them to decide whether a zero
or one was intended.  The bits are assembled into bytes, and a
checksum is compared with the checksum byte recorded on tape,
and, if they match, the operation is considered successful.

Files recorded to cassette actually consist of two "records", the
first containing the load address and length, and the second
containing the data.

-michael

Check out amazing quality 8-bit Apple sound on my
Home page:  http://members.aol.com/MJMahon/