P725 CEEFAX 725 Tue 15 Nov 20:20/11 |B2201215|a17T/SPK06|i14Text|m10The Acor n Speech System - by - Gordon Horsin gton÷e---------------------------------- ------------------÷e÷eModule 6. Creating new words with the Speak and Reset comm ands.÷e--------------------------------- ------------------------------÷e÷eIn the last module I showed you how to extract the data needed to create÷ethe word MOU TH from word PH2OM A, and how to use the Speak External÷ecommand to speak the ne w word. The technique used a small Assem bly÷elanguage program but a large amount of data. The result was, to my ear, a÷e clearly pronounced word but, if the same technique is used to produce a÷elarge v ocabulary, the data occupy a large amoun t of the available memory.÷e÷eIn this mo dule I will demonstrate how new words ca n be created from the÷espeech data store d in word PHROM A without copying the da ta into RAM.÷e÷eghen the Speak command i s used to speak the data in a word PH2OM the data÷eis normally spoken until a st
P725 CEEFAX 725 Tue 15 Nov 20:23/10 |B2202215|a17T/SPK06|m33B3at even÷ewhen words are accessed at some point after t he first data byte, the word÷eis normall y spoken until it is completed.÷e÷eThe S peak command, unlike the Speak External command, can be terminated÷ewith the Res et commandN A word can be started at a l egal address or at a÷enew address and st opped with the Reset command after a kno wn time÷einterval. The effect of this is to produce new wordMparts that can be÷e joined with other words or word-parts to form new words. By choosing the÷einterv als and words carefully all the phonemes needed to create an almost÷eunlimited v ocabulary can be created.÷e÷eThe words c reated in this way do not usually sound as well pronounced as÷ethose created usi ng the Speak External command but, when a large÷evocabulary is required, a progr am and its data can still be a managable ÷esize.÷e÷eThe BASIC program CHOPUP illu strates how simple it is to implement th is÷eidea. The program is used to speak t
P725 CEEFAX 725 Tue 15 Nov 20:22/11 |B2203215|a17T/SPK06|m376Be÷eI showed yo u how to use the program ADDRESS to find the "illegal" address÷efor the new word MOUNT. The address in word PHROM A is & 0D68. The BASIC÷eSOUND command in line 2 0 of CHOPUP uses the speech processor Sp eak command÷eto speak the word MOUNT in word PHROM A. A 25 centi-second time was ting÷edelay is used in lines 40 and 50 b efore the Reset command is executed in÷e line 60. The SOUND command in line 80 is used to speak the word-part -TH.÷eThe n ew word-part created from MOUNT is joine d with the existing word part÷e-TH to cr eate the new word MOUTH.÷e÷e÷e 10 REM: CHOPUP÷e 20 SOUND &FFBF,&D68,0,0÷e 30 REM: Speak MOU-÷e 40 TIME=0÷e 50 REPEAT UNTIL TIME > 25÷e 60 *FX159,0,1 12÷e 70 REM: Reset÷e 80 SOUND &FFBF, &3DC,0,0÷e 90 REM: Speak -TH÷e÷e÷eWhen this technique is implemented in Assemb ly language it is vital to use÷ean accur ate time wasting delay before executing the Reset command. The÷equality of the e
P725 CEEFAX 725 Tue 15 Nov 20:03/08 |B2204215|a17T/SPK06|m3B1Dn the program speaking÷ea wordMpart, reseting the spee ch processor at just the right moment an d÷ethen speaking and reseting the next w ord-part, and so on until the÷ecomplete new word has been spoken. The program ca nnot fust waste time in a÷eloop that tak es about the required time before reseti ng. The program must÷euse one of the com puter's timers to accurately time the Re set command.÷e÷eThe demonstration progra m TELSOFT uses the timer crossing zero e vent to÷etime the Reset command. The int erval timer is incremented 100 times a÷e second and generates event number 5 when the timer reaches zero. The÷eprogram re cognises event number 5 and allows the R eset command to be÷eexecuted as soon as it has occured.÷e÷eThe data stored in wo rd PHOM A are in one fourtieth of a seco nd long÷eframes. To get a well pronounce d new word using the speak and reset÷ete chnique it is a good idea to reset the s peak command at a frame÷eboundary. Unfor
P725 CEEFAX 725 Tue 15 Nov 20:12/07 |B2205215|a17T/SPK06|m3ED7s two and a ha lf÷ehundredths. For this reason all the wordMparts of new words in TELSOFT÷ehave been timed in five hundredths of a seco nd intervals to coincide with÷eevery oth er frame boundary.÷e÷eThe data for every word or wordMpart spoken by TELSOFT sta rts at line 1600÷eand includes the time interval for the word in centi-seconds f ollowed by÷ethe address in PHROM A of th e word or word-part to be used in the÷ec onstruction of a new word. If a complete word or word-part is to be÷espoken with out being reset the time interval is sto red as zeroN The last÷ebyte of the data is an end-of-data marker and has the mos t significant bit÷eof the byte set (line 2480).÷e÷eYou can modify the program TE LSOFT to construct your own new words by ÷ealtering the data stored in lines 1600 to 2480. The amount of data you can÷est ore will depend on the available memory but, if you use more than &500÷ebytes fo r the program and data, you will have to
P725 CEEFAX 725 Tue 15 Nov 20:13/07 |B2206215|a17T/SPK06|m41290re space. You will need to experiment a bit to get go od÷eresults and you may need to use the progran ADDRESS, introduced in the÷elast module, to find new wordMparts to use a s well as the legal words÷edocumented in the Speech System User Guide.÷e÷e÷e 1 0 REM: TELSOFT÷e 20 DIM mcode &300÷e 30 delay=&70÷e 40 info=&71÷e 50 old vec=&73÷e 60 eventv=&220÷e 70 osword =&FFF1÷e 80 osbyte=&FFF4÷e 90 FORpas s=0TO2STEP2÷e 100 P%=mcode÷e 110 [ OPT pass÷e 120 LDA £&EB÷e 1 30 LDX £0÷e 140 LDY £&F F÷e 150 JSR osbyte \ check f or Acorn speech upgrade÷e 160 C PX £&FF÷e 170 BEQ process÷e 18 0 BRK÷e 190 BRK÷e 200 G0VS "No speech upgrade"÷e 210 BRK÷e 220 .process÷e 230 JSR eventoff \ disable timer crossin g zero event÷e 240 LDA eventv÷e 250 STA oldvec \ save LSB o f event vector÷e 260 LDA eventv
P725 CEEFAX 725 Tue 15 Nov 20:14/05 |B2207215|a17T/SPK06|m41639ve MSB of eve nt vector÷e 280 LDX £timer MOD 256 \ new LSB of event vector÷e 290 LDY £timer DIV 256 \ new MSB of eve nt vector÷e 300 SEI \ disable interupts - fust in case÷e 310 STX eventv \ point the event vector to timer code÷e 320 STY eventv+1÷e 330 CLI \ re-enable interupts÷e 340 LDA £14 \ enable event÷e 350 LDX £5 \ interval timer crossing zero event÷e 360 LDY £0÷e 370 JSR osbyte÷e 380 LDA £s pdata MOD 256 \ LSB of word list÷e 390 STA info÷e 400 LDA £spd ata DIV 256 \ MSB of word list÷e 410 STA info+1÷e 420 .again÷e 430 LDA &FF \ poll escape flag÷e 440 BPL noescape \ branch if escape not pressed÷e 450 LDA £& 7E÷e 460 JSR osbyte \ acknow ledge escape÷e 470 JSR restore \ event off and restore vector÷e 480
P725 CEEFAX 725 Tue 15 Nov 20:15/05 |B2208215|a17T/SPK06|m419EB0 G0V S "Escapeb÷e 510 BRK÷e 520 .no escape÷e 530 LDY £0÷e 540 LDA (info),Y \ load delay time÷e 5 50 BPL continue \ branch if not £&FF÷e 560 JSR restore \ eve nt off and restore vector÷e 570 RTS \ return to BASIC÷e 580 .continue÷e 590 EOR £&FF÷e 600 SEC÷e 610 ADC £0 \ accumulator = 0 - accumulator÷e 620 STA timebase \ set up timer÷e 630 INY÷e 640 LDA (inf o),Y \ LSB of transformed word address÷ e 650 PHA \ store LSB ÷e 660 INY÷e 670 LDA ( info),Y \ MSB of transformed word addre ss÷e 680 PHA \ store MSB÷e 690 CLC÷e 700 LD A info÷e 710 ADC £3 \ ad d 3 to word pointer÷e 720 STA i nfo \ to point to next word÷e 730 LDA info+1÷e 740 ADC £0 ÷e 750 STA info+1÷e 760
P725 CEEFAX 725 Tue 15 Nov 20:10/04 |B2209215|a17T/SPK06|m41D9A÷e 770 TAY \ MSB into Y register÷e 780 PLA \ pull LSB o ff stack÷e 790 TAX \ LSB into X register÷e 800 JSR a ddress \ load PH2OM address register÷e 810 LDY £&50 \ speak comm and÷e 820 JSR osbyte÷e 830 LDA timebase \ load (0 - delay in centi-seconds)÷e 840 BEQ again \ if zero say whole word÷e 850 STA delay \ delay is not zero÷e 860 LDA £4 \ write inter val timer÷e 870 LDX £timebase M OD 256÷e 880 LDY £timebase DIV 256÷e 890 JSR osword \ inter val timer uses 5 bytes at .timebase÷e 9 00 .waste÷e 910 LDA delay \ wait until interval timer clears delay÷ e 920 BNE waste \ waste tim e until it does÷e 930 LDA £&9F \ write to speech processor÷e 940 LDY £&70 \ reset command÷e 950 JSR osbyte \ reset÷e 96
P725 CEEFAX 725 Tue 15 Nov 20:11/03 |B220A215|a17T/SPK06|m4214FM it doesn't always worc@÷e 970 JMP again \ go back for next word÷e 980 .timer÷ e 990 PHP÷e 1000 PHA÷e 1010 CMP £5 \ is it timer crossing zero event?÷e 1020 BNE notimer \ no - then do nothing÷e 1030 LDA £0÷e 1040 STA delay \ clear delay to stop wasting time÷ e 1050 .notimer÷e 1060 PLA÷e 107 0 PLP÷e 1080 RTS÷e 1090 .restore÷e 1100 JSR eventoff \ disable interval timer crossing zero÷e 1 110 LDX oldvec \ LSB of old v ector÷e 1120 LDY oldvec+1 \ MSB of old vector÷e 1130 SEI \ disable interupts - fust in case÷e 1140 STX eventv \ restore th e event vector÷e 1150 STY eventv +1 \ to its former glory÷e 1160 CLI \ re-enable interupts÷e 1 170 RTS \ and return÷e 1180 .eventoff÷e 1190 LDA £13 \ disable event÷e 1200 LDX
P725 CEEFAX 725 Tue 15 Nov 20:10/02 |B220B215|a17T/SPK06|m42500zero÷e 1210 LDY £0 \ Y must = 0÷e 1220 JMP osbyte \ Osbyte and retu rn÷e 1230 .address÷e 1240 TYA \ MSB is in Y register÷e 1250 PHA \ push MSB twice÷e 1 260 PHA÷e 1270 TXA \ LSB is in X register÷e 1280 AND £&F \ isolate first nybble÷ e 1290 ORA £&40 \ OR it wit h Load Address command÷e 1300 JS R write \ send command to speech pro cessor÷e 1310 TXA \ se cond nybble÷e 1320 AND £&F0÷e 13 30 LSR A÷e 1340 LSR A÷e 1350 LSR A÷e 1360 LSR A÷ e 1370 ORA £&40÷e 1380 J SR write \ send command to speech pr ocessor÷e 1390 PLA \ t hird nybble÷e 1400 AND £&F÷e 141 0 ORA £&40÷e 1420 JSR wr ite÷e 1430 PLA \ fourt h nybble÷e 1440 AND £&F0÷e 1450 LSR A÷e 1460 LSR A÷e 147
P725 CEEFAX 725 Tue 15 Nov 20:00/00 |B220C215|a17T/SPK06|m428AD÷e 1490 ORA £&4C÷e 1500 JSR write \ send command to speech processor÷e 15 10 LDA £&43 \ last byte alw ays &43÷e 1520 .write÷e 1530 TAY \ transfer command into Y reg ister÷e 1540 LDA £&9F \ wri te to speech processor÷e 1550 JM P osbyte \ Osbyte and return÷e 1560 . timebase÷e 1570 EQUD &FFFFFFFF÷e 1580 A TBFF 1600 EQUB 0 \ speak the c omplete word "thisb÷e 1610 EQUG &3808 \ address of "this" in word PHR OM A÷e 1620 EQUB 20 \ spea k 20 centi-seconds of "score"÷e 1630 C TWA\ A TB\ conds of "off"÷e 1650 EQUW &28D9 \ -of- off)÷e 1660 EQUB 10÷ e 1670 EQUG &38E2 \ -t- (try) ÷e 1680 C VB 25÷e 1690 E QUG &3CC2 \ -ware (were)÷e 1700 EQUB 0÷e 1710 EQUW &0210 \
P725 CEEFAX 725 Tue 15 Nov 20:12/00 |B220D215|a17T/SPK06|m42C5E EQUB 0÷e 17 30 EQUW &3C6C \ was÷e 1740 EQUB 15÷e 1750 EQUW &30E7 \ wr- (run)÷e 1760 EQUB 10÷e 1770 EQUg &1EBD \ -i- (in-)÷e 1780 EQUB 10÷e 1790 EQU W &3953 \ -tt- (twelve)÷e 1800 EQUB 10÷e 1810 EQUW &3A91 \ -e- (uh)÷e 1820 EQUB 15÷e 1830 EQUg &263D \ -n (no)÷e 1840 EQUB 0÷e 1830 E0ZW &0250 \ 12.5 centi-sec. delay÷e 1860 EQUB 10÷e 1870 EQUW &11F8 \ b- (button)÷e 1880 G0VB 30÷e 18 90 EQUW &1DCC \ -y (i)÷e 1900 G0VB 0÷e 1910 EQUW &025 F \ 25 centi-sec. delay÷e 1920 EQUB 15÷e 1930 EQUW &1CC9 \ G- (good)÷e 1940 EQUB 15÷e 1950 G0UW &2A48 \ -or- (or)÷e 196 0 G0VB 20÷e 1970 EQUg &1 62A \ -do- (dollar)÷e 1980 EQ UB 14÷e 1990 EQUW &263D \ -n (no)÷e 2000 G0VB 0÷e 2010
P725 CEEFAX 725 Tue 15 Nov 20:13/20 |B220E215|a17T/SPK06|m4300Alay÷e 2020 EQUB 10÷e 2030 EQUW &04C8 \ H- (hundred)÷e 2040 EQUB 15 ÷e 2050 G0UW &2A48 \ -orM (or )÷e 2060 EQUB 10÷e 2070 EQUW &0936 \ -s- (sixt-)÷e 2080 EQUB 25÷e 2090 EQUW &032B \ -ing- (-ing)÷e 2100 EQUB 10÷e 2110 EQUg &35CA \ -t- (ten)÷e 2120 EQUB 5÷e 2130 EQUW &3A91 \ -o- (uh)÷e 2140 EQUB 20÷e 2150 G0VW &263D \ -n (n o)÷e 2160 EQUB 0÷e 2170 EQUW &025F \ 25 centi-sec. delay÷e 21 80 EQUB 0÷e 2190 EQUW &0 E12 \ and÷e 2200 EQUB 0÷e 221 0 G0ZW &1F57 \ is÷e 2220 EQUB 0÷e 2230 EQUW &0FCF \ available÷e 2240 G0VB 0÷e 2250 G0ZW &1C11 \ from÷e 2260 EQUB 0÷e 2270 EQUW &0250 \ 12.5 centi-sec. delay÷e 2280 EQUB 0÷e 2290 G0VW &1065 \ B÷ e 2300 EQUB 0÷e 2310 EQU
P725 CEEFAX 725 Tue 15 Nov 20:13/19 |B220F215|a17T/SPK06|m433B4÷e 2330 G0VW &124D \ C÷e 2340 EQUB 10÷e 2350 EQUW &35CA \ Te- ( ten)÷e 2360 G0VB 15÷e 2370 EQUW &209F \ -l- (l)÷e 2380 K0VB 10÷e 2390 EQUg &178B \ -e- (each)÷e 2400 EQUB 15÷e 241 0 EQUW &329A \ -s- (score)÷e 2420 G0ZB 10÷e 2430 EQUg &28D9 \ -of- (off)÷e 2440 EQ UB 10÷e 2450 EQUW &38E2 \ -t- (try)÷e 2460 EQUB 20÷e 2470 EQUg &3CC2 \ -ware (were)÷e 2480 EQUB &FF \ end-of-data mar ker÷e 2490 ]÷e 2500 NEXT÷e 2510 CALL mco de÷e÷e÷eIn the program TELSOFT the speec h processor is reset twice after the÷ere quired time interval. It is reset once i n line 950 and again in line÷e960. This is not a mistake. The reason for resetti ng twice is that if the÷esoftware is soa k tested (by repeatedly CALLing mcode in an infinite loop)÷eit will occasionally produce garbled speech on a machine tha
P725 CEEFAX 725 Tue 15 Nov 20:22/18 |B2210215|a17T/SPK06|m43762trol correctl y set. This can usually be prevented÷eby resetting the speech processor twice bu t a crash can only be cured by÷eswitchin g the computer off and then back on agai n.÷e÷eIf you delete line 960 and remove the second reset, it is likely that the÷ eprogram will still work properly on you r computer.÷e÷eResetting a Speak command without any delay at all can also crash the÷espeech processor. There is absolut ely no point in doing this and it must÷e be avoided. Very short delays before res et can have the same effect with÷esome c onsonants. There is no point in having a delay time of less than one÷etwentieth of a second (a delay time of 5 in the pr ogran TELSOFT) and using÷eone twentieth of a second as a minimum delay will cert ainly help to avoid÷ethis problem.÷e÷eIf your speech system crashes for no appar ent reason it may be that the÷espeech to ne control variable resistor needs to be adjusted. The tone÷econtrol is labelled
P725 CEEFAX 725 Tue 15 Nov 20:23/17 |B2211215|a17T/SPK06|m43B1Acan be found to the÷eleft of IC98. On the BBC B+ it i s labelled VR1 and can be found to the÷e right of IC37. Crashes can sometimes be cured by turning the variable÷eresistor clockwise just a very small amount. This control can only be set÷eaccurately wit h laboratory instrilfnts and if speech p rocessor crashes are÷ea continual proble m it may be a good idea to ask your deal er to set the÷etone control in his works hop. If you feel unsure about adjusting the tone÷econtrol, or if you don't know where to look for it, then leave it alon e.÷e÷eIn order to speak the English dial ect known as Received Pronounciation it÷ eis necessary to be able to produce the phonemes in figure 1.÷e÷e÷eConsonants.÷e -----------÷eb ch d dh f g h j k l m n n g ngg p r s sh t th v w y z zh÷e÷eVowels .÷e-------÷e÷ea e i o u oo (as in : mate mete mite mote mute moot)÷ea e i o u oo (as in: rack reck rick roc k ruck rook)÷ear er ir or ur (as in
P725 CEEFAX 725 Tue 15 Nov 20:24/16 |B2212215|a17T/SPK06|m43ECCr (as in: part pert port)÷eah aw oi oor ow owr (as in: bah bawl boil boor brow bow er)÷e÷e÷eFigure 1. The phonemes used in English Received Pronounciation÷e------- ---------------------------------------- ---------------÷e÷e÷eThis list of phonem es can be reduced to twenty vowel sounds and twenty÷efour consonants without red ucing the range of words produced. You s hould÷ebe able to use either the Speak E xternal command (module 5) or the Speak÷ eand Reset commands (this module) to pro duce the phonemes in figure 2.÷e÷e÷e Vowels C onsonants÷e ------ ----------÷ePhoneme PHROM A word Phoneme PH ROM A word÷e------- ------------ ------- ------------÷ee as in E p as in PARAMETER÷ei as in IN- b as in BAD÷ee as in PENCE t
P725 CEEFAX 725 Tue 15 Nov 20:25/15 |B2213215|a17T/SPK06|m44280 d as in DATA÷eu as in PLUS k as in KEY÷ ea as in AFTER g as in GOOD÷eo as in ON ch as in CHARACTER ÷eor as in ACORN f as in J÷eoo as in GOOD f as in FEW÷eu as in U v as in VERY÷eir as in FIRST th as in THANK÷ea a s in A dh as in THE÷ei as in I s as in SAME÷eo as in NO z as in -Z ÷eoi as in POINT sh try -S UH (as in SHOE)÷eou as in THOUSAND zh t ry -Z UH (as in VISION)÷eear try E UH (as in FEAR) h as in HAVE÷eare try WERE (as in CARE) m as in MANY÷eour as in YOUR n as in NAME
P725 CEEFAX 725 Tue 15 Nov 20:20/14 |B2214215|a17T/SPK06|m44639 ng as in -ING ÷e l as in LARGE÷e r as in RUN÷e y as in YEAR÷e w as in WA NT÷e÷e÷eFigure 2. The phonemes needed to produce good quality English speech÷e-- ---------------------------------------- --------------------------÷e÷e÷eIt is po ssible to use the speech data stored in word PHROM A to speak÷elanguages other t han English.÷e÷eWelsh, for example, uses phonemes that are not used in English R eceived÷ePronounciation but these phonem es can still be constructed from the dat a÷estored in word PHROM A. The quality i s not not as good as it would be with÷ea Welsh phonetic word PHROM but it is qqP te recognisable if you take÷esufficient time and care when constructing the soun d and rhythm of the new÷ewords.÷e÷eI hop e these speech modules have given you an
P725 CEEFAX 725 Tue 15 Nov 20:21/13 |B2215215|a17T/SPK06|m449ECem and provid ed you with more information and example s than the÷erather slim User Guide. If y ou have worked through the modules and÷e experimented with the demonstration prog rams you should be able to counter÷ethe criticism that the Acorn Speech System h as limited value because of÷eits small v ocabulary. You should now have sufficien t knowledge to produce÷ea large vocabula ry of high quality speech. The range, in tonation and÷equality of the speech prod uced using the techniques described in t his÷eseries can be as good as that produ ced with any other speech system used÷eo n the BBC range of computers.÷e|c