Speech Synth‎ > ‎

sp synth Sym



Published in MICRO - The 6502/6809 Journal No. 47 April 1982
by John Valente
  • interface the Votrax Speech Synthesizer to your system's VIA. Although intended for a SYM-1, the techniques described are readily adaptable to other systems using a 6522.
    • VOTRAX DRIVER requires:
    • SYM-1
    • Sweet Talker Votrax
    • Interface Board
    • It is adaptable to othersystems (such as AIM) with 6522 VIA.
  • The Votrax SC-0l Speech Synthesizer IC lets you experiment with computer-generated speech at a reasonable cost. The Sweet Talker board, which includes the Votrax IC, allows easy interfacing to most computers. It is available from The Micro Mint, Inc., 917 Midway, Woodmere, NY 11598. While I will be describing the interface of the Votrax to my SYM-1 6522 VIA, the programs can be readily adapted to other systems using the 6522. This article provides a machine language driver, followed by a BASIC program to convert the mnemonics for each phoneme of speech into the numerical codes needed by Votrax. (A phoneme is one of the smallest units of speech that distinguishes one word from another; i.e., the m in mat and b in bat.)
  • Communication with the Votrax IC resembles a parallel printer interface with handshaking. Figure 1 shows the connections between the 6522 and the Sweet Talker board. This example uses VIA #2, port A, accessed through the SYM's "AA" connector. Any other VIA port can be used as long as all eight data bits and the two control lines are available. Be sure the Sweet Talker is connected to your power supply.

  • Bits zero through five form the code which tells Votrax which phoneme to synthesize. Bits six and seven select one of four pitch levels for the voice. Control line CA2 latches the data into the Votrax IC and starts synthesis. After the phoneme has sounded, A/R goes high. The CA1 line on the 6522 senses this transition and generates an interrupt, causing the next phoneme code to be sent out. This process repeats until a "stop" code ($3F) is sent. The ENABLE line is not used and is grounded to allow the board to operate.
  • Listing 1 sends a sequence of phoneme codes to the Sweet Talker with the proper timing of control signals. It is written in RAE - 1 format (SYM's Resident Assembler and Editor). The sequence of phonemes is limited to 256, due to the eight-bit length of the X index register. A block of memory to store the values for PITCH and the sequence of phonemes starting at PHONEME is reserved following the program. If you relocate this routine, you need only change the references to these locations. If your 6522 is at a different location, the register addresses will have to be modified accordingly.

Listing 1: Votrax - Assembly Language Listing
Listing 1. ** use browser BACK to return

  • The program begins by pointing the IRQ vector to the INT routine. The SYM requires a JSR ACCESS before this operation. Then, interrupts are temporarily disabled and the 6522 Interrupt Enable Register (IER) is set up to generate an IRQ on the rising edge of CAl. The port is then configured for output.
  • You must send the first phoneme code manually. The X register, which is used to index into the PHONEME list, is set to zero. The next few lines of code are needed because of a timing restraint in the Votrax chip. After sending data to Votrax, wait at least 450 nsec before sending a strobe pulse to latch it. Since the 6522 normally waits only 300 nsec before pulsing, the handshake/strobe is first inhibited by sending a $01 to the Peripheral Control Register (PCR). The phoneme data is fetched from the list, OR'ed with the value of PITCH to select the voice, and sent down the line. Now the handshake is enabled by sending a $OB to the PCR. A dummy read of the port outputs the pulse, and by now much more than the required 450 nsec has elapsed.
  • After the phoneme has sounded, the CAl line goes high and forces an interrupt. In the INT routine, the same manipulation of the handshake occurs to insure proper timing. The X register is incremented to point to the next phoneme code, and the data is fetched. But we don't want to OR the code with the value of PITCH if the "stop" code is encountered. After checking for this, the data and handshake are sent out as before. Conveniently, the dummy read at 1060 leaves the latest phoneme code in the accumulator.
  • As the program exits the INT routine, it loops continuously to IDLE until the "stop" code is found. Then the IER is altered to ignore further interrupts and the IRQ vector is restored to its original value. The address given is for the SYM's Supermon 1.1. Finally, control is restored to the calling program.
  • You can use this program directly by entering phoneme codes through the monitor, starting at address PHONEME and ending with $3F to end the speech. A value of $00, $40, $80 or $C0 must be entered at location PITCH. Try using the random values in memory as a phoneme list; you will hear some very bizarre sounds.
  • To compose intelligible words, however, it is more convenient to use mnemonic codes for each phoneme because these are closer to English. Listing 2, a BASIC program, prompts for the standard Votrax mnemonics, translates them into the proper numerical code, then places them sequentially into the PHONEME block. A call to the machine language driver produces the speech. Remember to reserve space for the machine language routine plus 257 bytes before entering BASIC.

Listing 2: Votrax Phoneme Translator - Basic listing and Sample Run
Listing 2. ** use browser BACK to return

  • The program is written in Synertek Bas-1, but is easily translated into other BASICs. The &"XXXX" is Bas-1's convention for hexadecimal numbers, and X = USR (address,0) calls a machine language routine. Lines 10-40 list the standard Votrax mnemonics, and lines 130-150 READ them into an array for later comparison. Lines 105-115 assign the machine language addresses to variables; simply change these lines to conform to any relocation you have made. Lines 500-540 prompt for the desired phoneme, search for a match, and then POKE the corresponding code into the PHONEME list. When you enter STOP in answer to the prompt, the program asks you to select a pitch for the voice. After responding to line 720, the machine language driver is called and you will hear the result.
  • I suggest experimenting with single words hefore assembling long messages. I think you will find that the components of human speech are very complex. Two words which rhyme to our ears are often composed of different series of phonemes. what might seem to be a simple vowel sound is sometimes a series of two or even three different phonemes. Be sure to include pauses between words (two different pause mnemonics are available).

VOTRAX is a trademark of Federal Screw Works, Inc.

  • John Valente
    • is interested in using the computer to generate sounds and musical stnictures unavailable in conventional instruments. He has been published in Electronotes, Newsletter of die Musical Engineering Group. You can write to Valente at Box 9, Marlboro, VT 05344.