34
RC8650 VOICE SYNTHESIZER
RC SYSTEMS
Figure 3.1. Musical Tone Generator Command Formats
MUSICAL TONE GENERATOR
The RC8650 contains a three-voice tone generator that can be used
for creating music and sound effects. This section explains how to
program the generator.
Note
The musical tone generator output is available only from the AO
pins. Digital audio output from the DAOUT pin is not possible.
The musical tone generator is activated with the J command (no pa-
rameter). Once activated, all data output to the RC8650 is directed to
the musical tone generator.
Note
The RC8650 expects the tone generator data to immediately fol-
low the J command; therefore, be sure not to terminate the command
with a CR or Null.
The tone generator is controlled with four, four-byte data and com-
mand frames, called
Initialize
,
Voice
,
Play
, and
Quit
. With these, the
programmer can control the volume, duration, and frequencies of the
three voices.
Initialize Command
The Initialize command sets up the tone generator’s relative amplitude
and tempo (speed). The host must issue this command to initialize
the tone generator before sending any Voice frames. The Initialize
command may, however, be issued anytime afterward to change the
volume or tempo on the fly.
Initialize command format
The Initialize command consists of a byte of zero and three param-
eters. The parameters are defined as follows:
K
A
K
TL
K
TH
Voice amplitude (1-255)
Tempo, low byte (0-255)
Tempo, high byte (0-255)
The range of the tempo K
T
(K
TL
and K
TH
) is 1-65,535 (1–FFFFh); the
larger the value, the slower the overall speed of play. The amplitude
and tempo affect all three voices, and stay in effect until another Ini-
tialize command is issued. If the command is issued between Voice
frames to change the volume or tempo on the fly, only the Voice frames
following the command will be affected.
Voice Frame
Voice frames contain the duration and frequency (pitch) information
for each voice. All Voice frames are stored in a 2 KB buffer within the
RC8650, but are not played until the Play command is issued. If the
number of Voice frames exceeds 2 KB in length, the RC8650 will au-
tomatically begin playing the data.
Voice frame format
Voice frames are composed of three frequency time constants (K
1
-K
3
)
and a duration byte (K
D
), which specifies how long the three voices
are to be played.
The relationship between the time constant K
i
and the output fre-
quency f
i
is:
f
i
= 16,768/K
i
where f
i
is in Hertz and K
i
= 4-255. Setting K
i
to zero will silence voice
i
during the frame.
K
D
may be programmed to any value between 1 and 255; the larger it
is made, the longer the voices will play during the frame.
S
ECTION
3: M
USICAL
& S
INUSOIDAL
T
ONE
G
ENERATORS