| Home CBM ASCII-X BASIC C128 2MHz Border BASIC 7.80 BASIC 8 CPM Digimaster 128 Fast Serial for uIEC Games Interlace JiffySoft128 Keyboard Scan Media Player 128 Orig Interlace RGBI to S-Video RGBI to SCART RGBI to VGA RGB Conversion SAM 128 Alpha Long Common Phonemes Reciter SAM Technical SID Player 128 VDC Interlace Mp128alpha N-progs D64plus Disk Escape Codes Hardware PCxface PETSCII Pet2asc Futurama IBM PC-AT Contact Games Glossary Hall of fame Hall of shame Miscellaneous Privacy policy Programming Twisty puzzles |
This section explains using Reciter 128 in BASIC with the "wedge" installed, and is very easy to use. (You may also use Reciter from ML or from BASIC without the "wedge", see below.) See the main SAM 128 page for details about installing SAM+Reciter and the BASIC Wedge. Note: If you have previously set BASIC into "SAM-Mode", then you need switch it back to "Reciter-Mode" with the BASIC-Wedge command: ]RECITER (if you want to use English text described on this page), or else see the SAM page (if you want to use phonetic text instead).Speaking English text is very easy, just enter the "SAY" command followed with a string expression. Some examples: ]SAY "HELLO WORLD!" :REM constant string ]SAY A$ :REM scalar variable ]SAY T$(2) :REM array variable ]SAY LEFT$(X$,4)+"S." :REM general string expression Reciter will translate your English text into SAM's phonetic language (with about 95% "raw" accuracy). Reciter will also translate some numbers and punctuation into spoken text [see Using Reciter (general), below]. "Raw" accuracy means the phonetic translation -- please note that even if the correct phonemes are used, Reciter may not sound "right" (true accuracy) because the correct stress is not used. Proper stress is often context-dependent -- you may have to resort to SAM's phonetic mode if Reciter fails to give satisfactory results. On the other hand, if the phonetic translation is wrong (5% error, due to so many exceptions in the English language), you can often alter the spelling (use wrong spelling) to get the right speech. How do you know if the translation is correct? I can only give a partial answer. If a string spoken by Reciter doesn't sound right, then you can use the ERROR command to display the phonetic translation that Reciter used. You would then have to decide if the translation is correct (which requires a good understanding of SAM's phonetic language). For example, ask Reciter to say the phrase "The quick and easy way" like this: ]SAY "THE QUICK & EASY WAY." You can then see the phonetic translation used by Reciter by entering ]ERROR. Reciter will print the following: DHAX KWIHK AEND IY5ZIY WEY5. That won't make any sense if you don't understand SAM's special phonetic language. And you don't need to learn it, if you are happy with Reciter's default accent and pronunciation. (See the page about Using SAM for more details.) Besides stress, there are several ways you can alter Reciter's speech. See the page about Common Routines.
There are two ways to call Reciter 128 from a machine language (ML) / assembly language program. The most common will probably be to call 'Reciter' at$EE0F (60943). Before doing that, you will need to copy the phonetic text you want spoken into SAM's buffer. Your text string should be terminated with an ESCape character: $1B (27). If not, Reciter will say 'random' junk after your desired text is spoken. In the current (Epsilon) release, the buffer is located at $D800~$D8FF. Because the buffer may move in later versions, you can find the buffer address in memory locations $EE22/23 (a word). Another method, which only applies if you are using BASIC variables, is to simply call 'ReSyBASIC' at $EE0C (60940). Before calling this routine, you first need to have a string variable named SA$ defined. If you don't, an empty string named SA$ will be created. You don't need a special terminator byte in the string (because BASIC knows how long the string is). Either way, your string should not have any embedded ESC ($1B) or 'shifted ESC' ($9B) character(s). If it does, Reciter will ignore whatever follows (the first). The following examples show the non-wedge BASIC calls to Reciter (i.e., ReSyBASIC at $EE0C). So if you are using ML, just use a simple JSR if running in BANK 1 (unlikely) or else use JSR_FAR. And ML user's that don't want to use BASIC strings must call 'Reciter' at $EE0F instead. For example, SA$="HELLO WORLD! I AM RECITER 128.":BANK 1:SYS 60940 If you are using BASIC (without the Wedge), it saves a lot of typing (and reduces memory use and improves RUN speed) if you use a variable for the value 60940. Also, you only need to use BANK 1 if you have used some other BANK command (or no BANK command) before using SYS. Thus a more practical example is, SA$="THE QUICK & EASY WAY.":SYSAM This assumes BANK 1 was the last BANK command issued, and variable AM = 60940. Below is an example in pure ML (you can enter it with the built-in MONITOR) which runs in BANK 15 at address $1300. It is the same as above, except it does not rely on BASIC variables (and thus does a virtual SYS 60943 instead of SYS 60940 shown above): .1300 LDA #0 ;use BANK 15 (for KERNAL routine $FF77)
.1302 STA $FF00
.1305 LDA #00 ;point to SAM buffer ($d800)
.1307 LDX #D8
.1309 STA $FE ;pointer in $FE,$FF
.130B STX $FF
.130D LDA #$FE ;where our pointer is
.130F STA $02B9 ;set for IND_STORE
.1312 LDY #$12 ;length of string (followed by $1b terminator)
;this loop copies string to SAM buffer
.1314 LDA $1330,Y ;read from current bank
.1317 LDX #1 ;select BANK 1
.1319 JSR $FF77 ;write to another bank
.131C DEY ;count chars
.131D BPL $1314 ;loop until all copied
;now call Reciter at $ee0f
.131F LDX #1 ;run code in BANK 1
.1321 STX $02
.1323 LDA #$EE ;address $EE0F
.1325 LDX #$0F
.1327 STA $03 ;set for JSR_FAR
.1329 STA $04
.132B JSR $02CD ;call JSR_FAR
;your code continues...
.132E NOP
.132F RTS
;the text "ASSEMBLY LANGUAGE." + $1B
>01330 41 53 53 45 4D 42 4C 59 20 4C 41 4E 47 55 41 47
>01340 45 2E 9B
;test the example
J 1300
Note if you want to run in BANK 0 (instead of BANK 15), then the first LDA should have an argument of #$3E (MMU value for BANK 0), and inside the copy loop you should change "LDX #1 / JSR $FF77" to "LDX #$7F / JSR $02AF" (load .X with the MMU value of BANK 1, and call "stash" code in Common RAM). Another, uncommon, SYS command you may use with Reciter 128 is the Error Display call. Reciter 128 will accept any text string, so you normally wouldn't call this! However, a neat trick is you can call this routine, at 60949 ($EE15), after having Reciter speak, and it will list the phonetic text that Reciter produced for SAM to speak. This is a great way to learn more about SAM's phonetic language (and what Reciter is doing with your English text)! So if you just executed the example above, then entering SYS 60949 would cause SAM to print: DHAX KWIHK AEND IY5ZIY WEY5. That won't make any sense if you don't understand SAM's special phonetic language. And you don't need to learn it, if you are happy with Reciter's default accent and pronunciation. (See the page about Using SAM for more details.) Note: even if you are not using BASIC at all, the MMU pre-configuration registers B (and possibly D) must be set to the same values used by BASIC ROM ($7F and $41, respectively). The 'D' pre-configuration register is only used for finding the BASIC string SA$ and for printing the 'error' text (SAM translation). In both these cases, the BASIC ROM must also be installed in the C128. In the later case, the KERNAL ROM is also required.
Capitalization is ignored. Any ASCII/PETSCII text will be transformed into upper-case ASCII at the beginning of Reciter. Besides speaking English words, Reciter will also speak some punctuation marks and numbers. In regards to numbers, Reciter only 'knows' the cardinal numbers zero to nine! As a special case, the dictionary also includes the translation for 64 (sixty-four)... guess why! In this Beta release, I added another special case for 28 (twenty-eight)... guess why! Thus if you ask Reciter to say "50" (fifty), he will actually say "five-zero"! Reciter also knows the ordinal numbers 1st to 10th (that is, "first" to "tenth"). If you try something else, like 21st (twenty-first), he will say "two-first"! Reciter (like SAM) understands some punctuation marks as special (he will not try to say them):
Most other non-alphanumeric characters will be ignored. In particular, all the ASCII non-printing characters (except $1B and $9B) will be ignored. However, Reciter will literally say the following marks:
Note: the non-printing ASCII code "ESCape" ($1B) will halt Reciter input (all following characters will be ignored). The 'extended-ASCII' code of $9B will do the same (this is the normal end-of-text marker for SAM and Reciter). See also the page about Common Routines for ways to manipulate the sound of SAM and Reciter. SAM (64) © Don't Ask, Inc., 1982 SAM 128 © H2Obsession, 2015 Webpage © H2Obsession, 2015, 2016 |