Parallax BOE-Bot Speech Board Diphone Chip Set (#30050) .fr

While not required to use the Diphone chip set, downloading the QVDIPH. ..... ER. CON $0F. ' hER. AR. CON $10. ' stAR. XR. CON $11. ' stORe (OR from ...
238KB taille 48 téléchargements 283 vues
599 Menlo Drive, Suite 100 Rocklin, California 95765, USA Office: (916) 624-8333 Fax: (916) 624-8003

General: [email protected] Technical: [email protected] Web Site: www.parallaxinc.com Educational: www.stampsinclass.com

Parallax BOE-Bot Speech Board Diphone Chip Set (#30050) Introduction The BOE-Bot Speech Board provides a simple method of adding speech and sound effects to your BOEBot. The Diphone Chip Set allows you to convert your BOE-Bot Speech Board into a speech synthesizer capable of unlimited English vocabulary.

Features Replaces Speech Board controller and sound storage chips. Simple serial control - Can use 42 phonemes (plus a pause) to create speech - Can play a string of up to 40 phonemes - Set volume to one of eight levels - Enable/Disable audio mixing of Stamp-generated sounds - Set sampling rate for voice effects (decrease voice pitch) 300 milliwatt amplifier Diphones extracted from recorded human speech for best intelligibility

• •

• •

Packing List The Parallax BOE-Bot Speech Board Diphone chip set (#30050) package should include the following components (demo source code can be downloaded from www.parallaxinc.com): • •

Documentation (these pages) Diphone chip set (356DP controller and diphone storage chip)

While not required to use the Diphone chip set, downloading the QVDIPH.EXE program from www.quadravox.com will facilitate the creation of phoneme strings. Documentation for this program is also located at www.quadravox.com in the file QVDIPH.PDF.

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 1

Setting Up Warning: Static electricity (discharge) can damage sensitive electronic components on the BOE-Bot Speech Board and the Diphone chip set. You can remove any static build-up from your body by touching a large metallic object connected to earth (i.e., a water facet). Tip: You man need to straighten the leads of the chip set to make them more perpendicular to the plane of the chip body. This is best accomplished by holding the chip in your hands and bending the pins inward using a flat work surface. Do not apply power to the Speech Board until all chip set pins have been verified to be

properly seated in their respective sockets. Follow these steps to convert your BOE-Bot Speech Board into a speech synthesizer: 1. Clear any program currently in the BASIC Stamp on your BOE-Bot. All pins should be made inputs (Dirs = 0). 2. Disconnect the power source from your BOE-Bot. 3. If installed, remove the BOE-Bot Speech Board from the BOE-Bot 4. With a small, flap-tipped screwdriver, carefully remove the small Speech Board controller chip (labeled A in the diagram below). Install the 356DP controller chip, noting the pin 1 marking on the chip (small dot). Installing this chip backwards will damage the chip and the Speech Board. 5. With a small, flap-tipped screwdriver, carefully remove the large Speech Board recorder chip (labeled B in the diagram below). Install the #30050 diphone chip, noting the pin 1 marking on the chip (small dot). Installing this chip backwards will damage the chip and the Speech Board. 6. Reinstall the Speech Board onto the BOE-Bot. 7. Load and run the test program (see next page) to verify the Diphone chip set.

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 2

Diphone Chip Set Test Program ' {$STAMP BS2} Diphone_Test: SEROUT 11, 16780, [$FD] PAUSE 500 SEROUT 11, 16780, [$FC, 4] PAUSE 5

' reset ' required -- do not change ' set volume

' say "Hello" SEROUT 11, SEROUT 11, SEROUT 11, SEROUT 11, PAUSE 1000

16780, 16780, 16780, 16780,

[$F9] [$25, $03, $27, $07] [$2A, $FA] [$FB]

' ' ' ' '

open string send phonemes send break, close string say it let speech finish

' play a beep SEROUT 11, 16780, [$F1] FREQOUT 10, 1000, 880 SEROUT 11, 16780, [$F3]

' mix mode on ' beep ' mix mode off

END

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 3

How It Works The BOE-Bot Speech Board Diphone Set works by linking and playing stored (in an ISD ChipCorder®) diphones (the smallest fragment of human speech) through the onboard amplifier and speaker. Since there are over 1000 diphones stored on the chip and manually programming them would be impractical, the 356DP controller chip synthesizes the correct diphone series from a string of phonemes provided by the BASIC Stamp program. The 356DP controller also allows controls the amplifier level and allows the board to amplify sounds created by the BASIC Stamp. All communications take place at 2400 baud. The serial connection (pin 11) also serves as a busy indicator. Most commands to the Speech Board require only one byte; a few require an additional onebyte parameter (i.e., volume level). The serial commands for the BOE-Bot Speech Board Diphone Chip Set are explained below. Open String ($F9), Close String ($FA), Play String ($FB) The Diphone chip set synthesizes speech from strings of phonemes; the essential constituent sounds in human speech. The controller can store and play up to 40 phonemes without breaks or delays in between. Before this occurs, the phoneme codes must be downloaded to the Speech Board string buffer. The process for storing and playing a string of phoneme codes is as follows: 1. 2. 3. 4.

Send Send Send Send

Open String command ($F9) phoneme codes (up to 40) in desired order of play; string must end with $2A (silence) Close String command ($FA) Play String command ($FB)

Note that the string will remain in the Speech Board memory until reset or replaced with another string. Set Volume ($FC) This command allows the Speech Board volume to be set to one of eight levels. The byte that follows the Set Volume command is the volume level (0 [muted] to 7). Mix On ($F1) and Mix Off ($F3) The Mix On command enables Stamp-generated sounds (using FREQOUT and DTMFOUT) to be played through the Speech Board amplifier and speaker. Stamp-generated sounds must be output from pin 10. The Mix Off command disables the mixer input. Stop Playback ($F6) The Stop Playback command works for any playback function. Sleep ($F8) This command shuts off the Speech Board amplifier, the ISD ChipCorder® and puts the controller in a low-power state. To restore normal operations, send any serial byte and wait at least 50 milliseconds for the system to restart.

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 4

Reset ($FD) This command performs a software reset of the Speech Board and restores default settings. Reset can also be used to clear the string buffer. Note: It is advisable to pause at least five milliseconds after a given command to allow the Speech Board controller to process the command. No delay is required between commands and parameter bytes. Refer to the demonstration files for examples of using the delay.

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 5

Demonstration Program This program shows how to speech is synthesized from linked phonemes. The program also demonstrates how the mixer mode can be activated to play Stamp-generated sounds. ' ============================================================================== ' ' File...... QV356M4-TTS.BS2 ' Purpose... Diphone Set Text-To-Speech Demonstration ' Author.... Parallax ' E-mail.... [email protected] ' Started... ' Updated... 01 JUNE 2002 ' ' {$STAMP BS2} ' ' ============================================================================== ' -----------------------------------------------------------------------------' Program Description ' -----------------------------------------------------------------------------' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

This program uses the Quadravox QV356 Speech Board and #30050 Diphone chip set to "say" the following phrases: "Hello, I am the BASIC Stamp microcontroller." "My voice box is the Quadravox QV356M4." After speaking, the mix mode is demonstrated by playing a dial tone, then dialing the telephone number for Parallax. These sounds are played through the QV356 amplifier and speaker. The heart of the program is a subroutine called Say_Phrase that will play a string of phonemes contained in DATA statements. The routine is capable of dealing with invalid phoneme values and string definitions longer than 40 phonemes (buffer max). Parallax recommends that the programmer plan breaks in strings instead of allowing the subroutine to handle this. There will be small pause at the break point. In some cases, this pause can damage intelligibility.

' -----------------------------------------------------------------------------' Revision History ' -----------------------------------------------------------------------------' -----------------------------------------------------------------------------' I/O Definitions ' -----------------------------------------------------------------------------QV_SIO QV_Busy Mix_Out

CON VAR CON

11 In11 10

' serial I/O for QV356 ' high when QV356 is busy ' output to QV356 mixer

' -----------------------------------------------------------------------------' Constants ' ------------------------------------------------------------------------------

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 6

QV_MixOn QV_MixOff QV_Sleep QV_Open QV_Close QV_Play QV_Volume QV_Reset

CON CON CON CON CON CON CON CON

$F1 $F3 $F8 $F9 $FA $FB $FC $FD

' ' ' ' ' ' ' '

enable mix of pin 10 sounds disable mix of pin 10 sounds power down open string close string play string set volume (0..31) software reset

N2400

CON

16780

' 2400-8-N-1, inverted (QV356)

Std_Volume

CON

5

' good volume for demo

' -----------------------------------------------------------------------------' Variables ' -----------------------------------------------------------------------------addr qvData bufCount

VAR VAR VAR

Word Byte Byte

' phoneme address in EE ' data to module ' phoneme buffer count

' -----------------------------------------------------------------------------' Speech Phonemes ' -----------------------------------------------------------------------------' ' ' ' '

The QV356DP controller selects the correct diphone pairs to synthesize speech defined by these phonemes. The program QVDIPH.EXE (available from www.quadravox.com) can be used to create a phoneme list from plain text.

IY IH EY EH AE UY UH OW AO AA AX AH AY OY AW ER AR XR _P _T _K _B _D _G _M _N NG _F _V

CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON CON

$00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $1A $1B $1C

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

bEEt bIt bAIt bEt At hOOt bOOk bOAt cAUse cOt abOUt bUt bIte bOY cOW hER stAR stORe (OR from QVDIPH.EXE) Pet Top Keep Bet Dot Go Mit Not siNG Fit Vote

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 7

TH DH _S _Z SH ZH CH _J _H _R _L _W _Y __

CON CON CON CON CON CON CON CON CON CON CON CON CON CON

$1D $1E $1F $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $2A

' ' ' ' ' ' ' ' ' ' ' ' ' '

THin THen Sit Zip SHin rouGe ouCH eDGe Hot Red Lip Watt Yet silence (_# from QVDIPH.EXE)

EOP

CON

$FF

' end of phrase

' -----------------------------------------------------------------------------' EEPROM Data ' -----------------------------------------------------------------------------' Phrases were created with QVDIPH.EXE, then manually fine-tuned for best ' quality. ' ' Required changes from QVDIPH.EXE phonetic text: ' ' * OR --> XR ' * _# --> __ ' Phrase1 DATA _H,EH,_L,OW,__,__,AY,AE,_M,DH,AX,_B,EY,_S,IH,_K DATA _S,_T,AE,_M,_P,_M,AY,_K,_R,OW,_K,AX,_N,_T,_R,OW,_L,ER DATA EOP Phrase2a

DATA DATA DATA

_M,AY,_V,OY,_S,_B,AO,_K,_S,IH,_Z,DH,AX _K,_W,AA,_D,_R,AX,_V,AO,_K,_S EOP

Phrase2b

DATA DATA DATA

_K,_Y,UY,_V,IY,__,TH,_R,IY,_F,IH,_F,_T,IY,_S,IH,_K,_S EH,_M,_F,XR EOP

' -----------------------------------------------------------------------------' Initialization ' -----------------------------------------------------------------------------Initialize: SEROUT QV_SIO, N2400, [QV_Reset] ' reset sound board PAUSE 500 ' required -- do not change SEROUT QV_SIO, N2400, [QV_Volume, Std_Volume] ' set initial volume PAUSE 5 ' -----------------------------------------------------------------------------' Program Code ' -----------------------------------------------------------------------------Main: addr = Phrase1 GOSUB Say_Phrase addr = Phrase2a GOSUB Say_Phrase

' say Phrase 1 ' say Phrase 2

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 8

addr = Phrase2b GOSUB Say_Phrase GOSUB Wait_Until_Not_Busy PAUSE 1000

' -- with planned break ' let speech finish

' mixer demo SEROUT QV_SIO, N2400, [QV_MixOn] PAUSE 5 FREQOUT Mix_Out, 2000, 350, 440 PAUSE 50 DTMFOUT Mix_Out, [1,9,1,6,6,2,4,8,3,3,3] SEROUT QV_SIO, N2400, [QV_MixOff]

' enable Stamp sounds ' create a "dial tone" ' "call" Parallax ' disable Stamp sounds

END ' -----------------------------------------------------------------------------' Subroutines ' -----------------------------------------------------------------------------' ' ' '

**************************************************** Makes serial line an input and checks for Busy state -- this line will be low when not busy ****************************************************

Wait_Until_Not_Busy: INPUT QV_SIO IF QV_Busy THEN Wait_Until_Not_Busy RETURN ' ' ' ' '

' make comm an input ' wait until busy goes low

***************************************************** Say a phrase starting at EE address defined by "addr" -- does basic validity check of phoneme -- prevents buffer overrun *****************************************************

Say_Phrase: GOSUB Wait_Until_Not_Busy bufCount = 0 SEROUT QV_SIO, N2400, [QV_Open]

' let current buffer play ' reset buffer count ' open phoneme buffer

Get_Phoneme: READ addr, qvData IF (qvData = EOP) THEN Close_Phrase IF (qvData > __) THEN Get_Phoneme bufCount = bufCount + 1 IF (bufCount = 39) THEN Close_Phrase SEROUT QV_SIO, N2400, [qvData] addr = addr + 1 GOTO Get_Phoneme

' ' ' ' ' ' ' '

Close_Phrase: SEROUT QV_SIO, N2400, [__, QV_Close] SEROUT QV_SIO, N2400, [QV_Play] IF (qvData EOP) THEN Say_Phrase

' close current buffer ' play it ' keep going if phrase not done

read phoneme from phrase data phrase done? no -- is phoneme valid? yes, update phoneme count close buffer if full no, send phoneme to buffer increment address get next phoneme

Say_Phrase_Exit: RETURN

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 9

Using The Quadravox Diphones Program Selecting the correct phonemes and arrangements can be a bit tricky at first. Quadravox has provided a helper program to generate phoneme strings based on text input. The program follows standardized rules for [English] text-to-speech synthesis. That said, the results won't always be perfect and there will be times when you will need to make adjustments for the best intelligibility. Download and run the QVDIPH.EXE from Quadravox (www.quadravox.com). Once installed, this program creates a short-cut called Diphones (Start Menu Æ Programs Æ Diphones). Run the Diphones Synthesis program.

1. Make sure that the "Text" radio button is selected to enable the "Regular Text" field. 2. Enter the text to synthesize in the field labeled "Regular Text." 3. Click the "Simulate" button. This converts the plain text to phonetic text and plays the phonetic text through your PC sound card. You may notice that a particular word does not sound quite right. You can adjust the simulation manually by inserting phonemes into the "Phonetic Text" field. To test your adjustment, click the "Simulate from Phonetic Text" button. Try this: Enter "Parallax" in the "Regular Text" field, then press "Simulate." The program generates the phoneme string, _#_PEY_RAO_LAE_K_S_#, which doesn't sound quite right – it sounds like Payrallax. Change the phoneme string to _#_PEH_RAH_LAE_K_S_# and then press "Simulate from Phonetic Text." Sounds much better now, doesn't it? Before transferring phonemes strings from the Diphones program to a BASIC Stamp program, you must make two changes: 1. The _# phoneme (short silence) must be changed to __ (# is not legal in names) 2. The OR phoneme must be changed to XR (OR is a BASIC Stamp keyword)

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 10

BOE-Bot Speech Board Diphone Chip Set Phonemes # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

HEX $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $1A $1B $1C $1D $1E $1F $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $2A

Phoneme

Example

IY IH EY EH AE UY UH OW AO AA AX AH AY OY AW ER AR XR _P _T _K _B _D _G _M _N NG _F _V TH DH _S _Z SH ZH CH _J _H _R _L _W _Y __

bEEt bIt bAIt bEt At hOOt bOOk bOAt cAUse cOt abOUt bUt bIte bOY cOW hER stAR stORe Pet Top Keep Bet Dot Go Mit Not siNG Fit Vote THin THen Sit Zip SHin rouGe ouCH eDGe Hot Red Lip Watt Yet silence

Notes

OR from Diphones.exe

hard TH soft TH

_# from Diphones.exe

Parallax, Inc. • BOE-Bot Speech Board Diphone Set (#30050) • 7/2002

Page 11