*********

Welcome to Project 64!

The goal of Project 64 is to preserve Commodore 64 related documents
in electronic text format that might otherwise cease to exist with the
rapid advancement of computer technology and declining interest in 8-
bit computers on the part of the general population. If you would like
to help by converting C64 related hardcopy documents to electronic
texts please contact the manager of Project 64, Cris Berneburg, at
74171.2136@compuserve.com.

Extensive efforts were made to preserve the contents of the original
document.  However, certain portions, such as diagrams, program
listings, and indexes may have been either altered or sacrificed due
to the limitations of plain vanilla text.  Diagrams may have been
eliminated where ASCII-art was not feasible.  Program listings may be
missing display codes where substitutions were not possible.  Tables
of contents and indexes may have been changed from page number
references to section number references. Please accept our apologies
for these limitations, alterations, and possible omissions.

Document names are limited to the 8.3 file convention of DOS. The
first characters of the file name are an abbreviation of the original
document name. The version number of the etext follows next. After
that a letter may appear to indicate the particular source of the
document. Finally, the document is given a .TXT extension.

The author(s) of the original document and members of Project 64 make
no representations about the accuracy or suitability of this material
for any purpose.  This etext is provided "as-is".  Please refer to the
warantee of the original document, if any, that may included in this
etext.  No other warantees, express or implied, are made to you as to
the etext or any medium it may be on.  Neither the author(s) nor the
members of Project 64 will assume liability for damages either from
the direct or indirect use of this etext or from the distribution of
or modification to this etext.

*********

The Project 64 etext of the SAM/Reciter Manual. Converted to etext by
anonymous, formatted by Frank Jeno Kontros <jeno@kontr.uzhgorod.ua>,
the Non Stop Cracker. BBS phone number may no longer be valid.

SAM10.TXT, October 1996, etext #93.

*********

THE SAM/RECITER PACKAGE
=======================
DOCS BY:  DOC'S "R" US BBS  914-668-3664  24 HOURS A DAY 7 DAYS A
WEEK!!!!

SAM --  This program automatically loads the SAM speech synthesis
program,  KNOBS,  the  SAM wedge and leaves the computer ready to
accept phonetic input.

RECITER -- RECITER  is  the  English  text-to-speech program that
interfaces the  SAM program with ordinary English text input.

SAYIT -- A  BASIC  program  that  allows  you to enter strings of
phonetic or English text and hear them spoken immediately. All of
the special features of SAM (pitch control, speed control, KNOBS,
etc.) can be accessed within the me SAYIT program.

DEMO -- A BASIC program that demonstrates some of SAM's features,
including  the  capacity  to  change his voice and the ability to
sing! (This is on side 2 of the cassette version.)

SPEECHES -- Another  BASIC  program  that  features some familiar
texts spoken aloud by SAM.

GUESSNUM -- A  talking  game in which the player guesses a secret
number between 1 and 100.


USING THE SAM PROGRAMS
-------------------------
Sam is a self-contained machine language program.  Your interface
to  SAM  in  BASIC  is the  SAM  wedge,  another machine language
program.  To  load  SAM  and  install the SAM wedge into your C64
computer,  follow  these  instruction:  Load "SAM",8 <RETURN> and
type RUN <RETURN>.


RUNNING THE DEMO PROGRAMS
-------------------------
Once  SAM is loaded into your computer,  you are ready to run any
of the Basic demonstration programs  (SAYIT,  DEMO,  SPEECHES and
GUESSNUM). To do so, follow these steps:

1. Insert the SAM diskette into your disk drive.
2. Type LOAD "filename",8 <RETURN> where filename is SAYIT, DEMO,
   SPEECHES or GUESSNUM.
3. Type RUN <RETURN>.


USING THE SAM WEDGE
-------------------
Load SAM into memory from the disk.  Make sure SAM is on the disk
you  are  trying  to  load  it from.  When SAM is loaded into low
memory  in  your  C64,  it  uses  approximately 6K Bytes of BASIC
memory.  If SAM is load into high memory,  it only requires 2K of
BASIC  memory  but  is  incompatible with the DOS wedge.  The SAM
wedge will give you a choice about where in memory to load SAM.

SAM  patches  into commodore BASIC with the use of the SAM wedge.
The  SAM  wedge  is  a machine language utility that adds ten new
commands  to  Commodore BASIC.  These commands are used just like
any  other  BASIC  commands except that they are used to generate
and control SAM's speech.  You can use them in the immediate mode
in which you simply tell the computer what to do:

   SAY"I AM A TALKING COMPUTER".

Or,  you  can  use  them  in the deferred mode in which the wedge
commands are part of a program:

   10 SAY "I AM A TALKING COMPUTER".

The ten new commands are the following:

SAY (string variable or string)
Commands SAM to speak. Examples:

  a) SAY"MAY4 NEYM IHZ SAE4M." (phoneme string, immediate mode)
  b) 10 SAY "MY NAME IS SAM." (English string, deferred mode)
  c) A$ = "MY NAME IS SAM."
     SAY A$ (string variable, immediate mode)
     String arrays may not be used with the SAY command.

]PITCH n
Sets SAM's pitch value to  n  (see USING KNOBS section).  You can
read the actual pitch value with PEEK(39439) function.

Example: 10 ]PITCH 64

]SPEED n
Sets SAM's speed value to  n  (see USING KNOBS section).  You can
read the actual speed value with PEEK(39438) function.

Example: 10 ]SPEED 72

]LIGHT n
Removes  the  screen  display  if n=0,  leaves the screen display
intact if n = 1. SAM sounds best with the display removed; if the
display remains,  he will growl a little when he talks.   You can
read the actual light value with PEEK(39440) function.

]SAM Puts SAM into the phonetic input mode.

Example: 10 ]SAM
         20 SAY"AY4 TA0K WIHTH FOW4NIYMZ".

]RECITER
Puts SAM into the English input mode (see RECITER section below).

Example: 10 ]RECITER
         20 SAY"NOW I TALK WITH ORDINARY WORDS".

]KNOBS n,m
Allow  you  to  change  SAM's  voice using the KNOBS feature (see
section on KNOBS for details).  Set the "mouth" value with  n and
the "throat" value with  m. You can read the "mouth" and "throat"
values with PEEK(38880) and PEEK(38881) functions.

]ERROR
Beeps  twice when you input a phoneme string to SAM and a phoneme
spelling error is detected. To find out where the error occurred,
use  the  ]ERROR command.  The command will print out the phoneme
string with the improper character in inverse video.  If no error
is detected, the ]ERROR command has no effect.

]LOGO
Displays copyright or cracking message.

]QUIT
Removes  the  SAM  wedge  thereby  allowing  you to maximize free
memory  or use other conflicting wedges.  To learn how to free up
this additional memory, see the beginning of this section.

All wedge commands may be abbreviated by the use of the first two
or more letters in the command  (i.e. ]PITCH-->]PI).  Programmers
should  note  that wedge commands require the following syntax in
IF-THEN statement:

  10 IF A$ = "YES" THEN:SAY "VERY GOOD".

  rather than

  10 IF A$ = "YES" THEN SAY "VERY GOOD".

The colon after THEN is required.

The  SAM  wedge  is  compatible  with the DOS wedge (DOS 5.1); if
RECITER is used, be sure it is loaded into low memory.


USING KNOBS
-----------
KNOBS  is  a  feature  of  SAM  that  allows the use of two extra
"control knobs" for SAM's voice.  If  we  make rough analogies to
the physical structures that produce speech, these KNOBS allow us
to  adjust  the  size  of SAM's throat and his mouth.  Doing this
creates  different  voices without altering the pitch or speed of
the  speech  (and,  of course,  you  can  still  do  these things
independently  with  SAM).  To use KNOBS in your program,  simply
issue the command  ]KNOBS n,m where n and m are numbers between 0
and 255.  A value of 128 in each register results in SAM's normal
voice.   Using  higher  numbers  dilates  the  throat  or  mouth.
Experiment  with  different  combinations  of values and see what
different voices you can get.

Here are a few sample voices to use from KNOBS:

DESCRIPTION          SPEED     PITCH     THROAT    MOUTH
Elf                   72        64        110       160
Little Robot          92        60        190       190
Stuffy Guy            82        72        110       105
Little Old Lady       82        32        145       145
Extra-Terrestrial    100        64        150       200
SAM                   72        64        128       128

Example:  To have SAM talk like an extra-terrestrial with English
text input, use the following program:

  10 ]RECITER
  20 ]SPEED 100
  30 ]PITCH 64
  40 ]KNOBS 150,200
  50 SAY"I NEED TO PHONE HOME."


THE RECITER PROGRAM
-------------------
RECITER  is  an  English  text-to-speech  program  that  converts
ordinary  text into phonemes that SAM can understand.  You simply
supply  output  strings of 255 characters or less to the program.
RECITER takes care of the rest.  The program uses about 450 rules
to  convert  English into SAM's phonetic language. Included among
these  rules  are  some  stress  markers for situations where the
stress   choice   is   unambiguous.   In  addition,  SAM's  usual
punctuation  rules  still  operate  with some  additional symbols
("!", ";" and ":") being considered as periods. The net result is
that  even  directly-translated English test has a fair amount of
inflection.   RECITER   also   recognizes  a  number  of  special
character.  Numbers  are  read  aloud,  and  several  others  are
pronounced as well.  If a character is not understood by RECITER,
it  simply  isn't  passed to SAM  We recommend use of RECITER (or
any   text-to-speech   program,   for   that  matter)   only  for
applications  where  the  user  has  no  control of the text. For
example,  text already in a file,  text received over a MODEM and
text  supplied  by  users  unfamiliar  with  the phonetic system.
Where the highest quality speech with full inflection is desired,
we  urge  you to use SAM's phonetic system.  Don't be discouraged
though.  You  will  find  that  RECITER  will  do a better job of
speaking from English text than other text-translator products.


I. PHONETIC INPUT TO SAM
---------------------------
SAM  is  equipped  with  a  version  of  the  easy-to-learn, very
readable  International  Phonetic  Alphabet.  There  are about 50
phonemes which will let you spell all the words in English.  Some
sounds  from foreign languages are not available in the system at
this time.

Why  use  the  phonetic system?  There are two compelling reason:
(1)  In  the  phonetic  system,  all the words will be pronounced
correctly; and (2) You can put inflection into the speech however
you want it. If you have already tried the RECITER text-to-speech
program,  you know that it does a fair job of pronouncing English
words.  However, it does make mistakes. Some words sound a little
strange and others are difficult to understand.  The  reasons for
this  are  not  hard  to  understand.  English  is  a language of
exceptions  rather  than rules;  words that are spelled alike are
pronounce  differently  ("have"  vs. "gave").  A rule system like
RECITER  cannot pronounce all words correctly unless it stores an
enormous  dictionary  that  takes  up vast amounts of memory. But
the  second  flaw  in  text-to-speech conversion is more serious.
Such a rule system cannot decide where the stress belongs in what
is  being  said.  The phonetic system in SAM,  on the other hand,
allows  you to decide where to accent syllables within a word and
where to stress words within a sentence.  So it is clear that the
preferred  way  to  make SAM speak is with the phonetic alphabet.
But  how  hard  is it to use?  It's really easier than writing in
English  because  you  don't have to know how to spell!  You only
have  to  know  how  to  say  the  word  in  order  to  spell  it
phonetically.

Here  is  the  complete  list of phonemes,  each presented with a
sample  word  containing  its  sound.  Note  that  there are many
vowels, which is why they are all indicated by two letters rather
than one. The phonemes are classified into two categories: vowels
and consonants. Among the vowels are the simple vowel sounds such
as  the  "i" in "sit",  the "o" in "slot",  and the "a" in "hat".
These  vowels  start  with  one sound and end with another (e.g.,
"oi" in " oil" and the "ow" in "how." These vowels start with one
sound and end with another  (e.g., "oi" glides from an "oh" sound
to  an  "ee"  sound).  The  consonants  are also divided into two
groups: voiced and unvoiced. The voiced consonants require you to
use  your vocal chords to product the sound.  Such sounds as "b",
"l",  "n"  and  "z"  fall  into  this  category.   The   unvoiced
consonants,  on the other hand,  are produced entirely by rushing
air  and  include  such  sounds as the "p",  "t",  "h",  and "sh"
sounds.


PHONETIC ALPHABET FOR SAM
-------------------------
The example words have the sound of the phoneme,  not necessarily
the same letters.

     VOWELS                            VOICED CONSONANTS
IY           f(ee)t                    R        red
IH           p(i)n                     L        allow
EH           beg                       W        away
AE           Sam                       W        whale
AA           pot                       Y        you
AH           b(u)dget                  M        Sam
AO           t(al)k                    N        man
OH           cone                      NX       so(ng)
UH           book                      B        bad
UX           l(oo)t                    D        dog
ER           bird                      G        again
AX           gall(o)n                  J        judge
IX           dig(i)t                   Z        zoo
                                       ZH       plea(s)ure
   DIPHTHONGS                          V        seven
EY           m(a)de                    DH       (th)en
AY           h(igh)
OY           boy
AW           h(ow)                     UNVOICED CONSONANTS
OW           slow                      S         Sam
UW           crew                      Sh        fish
                                       F         fish
                                       TH        thin
 SPECIAL PHONEMES                      P         poke
UL           sett(le) (=AXL)           T         talk
UM           astron(omy) (=AXM)        K         cake
UN           functi(on) (=AXN)         CH        speech
Q            kitt-en (glottal stop)    /H        a(h)ead

NOTE:  The symbol for the  "H" sound is  /H.  A glottal stop is a
forced  stoppage  of  sound.  On the following phoneme chart, you
will notice six phonemes -- YX, WX, RX, LX, /X, and DX- which are
described as being used by SAM's rule system.  However, they have
been  provided  with letter codes so that you may experiment with
these special sounds directly. YX and WX are weaker versions of Y
and W.  RX  and  LX are smooth gliding versions of R and L. /X is
the "h" sound in "who", and DX is the quick flap of the tongue on
the upper palate as in the word "pity".

The following symbols are used internally by some of SAM's rules,
buy they are also available to the user.

YX       diphthong ending
WX       diphthong ending
RX       R after a vowel
LX       L after a vowel
/X       H before a non-front vowel or consonant
DX       "flap" as in pity

We are now ready  to transcribe ordinary speech into its phonetic
representation. Let's use the following sentence as an example:

"I do my calculations on the computer."

The  first  step  is  to  say each word aloud and decide how many
syllables  are in the word.  A syllable has one vowel phoneme and
its  associated consonants (if any).  We then identify the proper
vowel  phoneme by comparing its sound to the sounds listed in the
table,  and  do  the  same  for  the  consonants.  The  resultant
combination  of  phonemes  is  the phonetic representation of the
syllable. We do this for each syllable in a word. In our example,
the first word -- "I" -- is a single phoneme, the diphthong "AY".
The next word  --  "do"  -- is a single syllable comprised of the
diphthong "UW" preceded by the voiced consonant "D". The phonetic
spelling is therefore "UW". Similarly, the third word -- "my" --
again  uses  the  "AY"  sound,  this  time  preceded  by  an "M",
resulting  in "MAY".  The word "calculations" has four syllables.
The  first  syllable  transcribes  as  "KAEL".  The  "c" sound is
pronounced  as  "k",  unlike the "s" pronunciation in a word like
"cell"  (notice  there is no "C" in the phoneme table).  The next
syllable  --  "cu"  -- transcribe s as "KYUW." Note here that the
"Y"  sound prevents this syllable from being pronounced as "coo".
The  third  syllable  comes out as "LEY",  and the fourth becomes
"SHAXNZ".  This  word  ends  with  a voiced sound "Z" and not the
hissy "S" sound as in "list". You will rapidly discover that many
words contain the phonetic combinations "AXL",  "AXM"  and "AXN."
To enhance the readability of the phonetic spelling,  the special
symbols  "UL,"  "UM"  and  "UN"  can  be  substituted  for  these
combinations. The "tions" syllable is now written as "SHUNZ". So,
"calculations" becomes "KAELKYUWLEYSHUNZ".

The  next  word "on" becomes "AAN",  and "the" becomes "DHAX". By
the  way,  if  the  word  "the"  precedes a word beginning with a
vowel,  it  gets  pronounced  "thee"  and is spelled "DHIY".  You
should  also  notice  that  the  "th"  letter combination has two
phonetic  representations:  unvoiced  (TH) as in "thin" or voiced
(DH)  as  in  "the".  By  now,  the  steps  used  in getting from
"computer"  to  "KUMPYUWTER"  should already be obvious.  Try it.
Once you get used to the phonetic system,  it will seem very easy
and  obvious.  Initially,  there will be some spellings that seem
tricky  (Did  you  know  that  "adventure"  has  a  "CH" in it?).
However, the rule is always to write the word the way you say it,
no t the way you spell it.

To help you learn the system fast,  we have provided an  English-
to-phonetic spelling dictionary of almost 1500 words. Many common
words are in the dictionary; some unusual ones are in it as well.
If  you are really stuck on how to spell a word that isn't in the
dictionary,  think  of  another word that sounds like it and that
one may be listed. In any case, don't hesitate to experiment with
the  phonetic  spelling system.  Let you ears be your guide. This
system is easy to learn,  easy to use, easy to read, and you will
be amazed at what you can do with it.


II. ADDING STRESS TO SAM's SPEECH
---------------------------------
In  the  phonetic  mode,  SAM is capable of speaking with a great
deal  of inflection and emphasis.  This gives a much more natural
and  understandable  quality  to  the  speech  than  is otherwise
possible.  The stress system for SAM is particularly easy to use.
There  are  eight  stress  markers  that  can  be  used simply by
inserting  a  number  (1-8)  after  the vowel to be stressed. For
example, the monotonic pronunciation of the word "hello" produced
by  the  phonetic  spelling  "/HEHLOW"  becomes a much friendlier
sounding   greeting   when  spelled  "/HEH3LOW"  becomes  a  much
friendlier sounding greeting when spelled "/HEH3LOW".  Why do you
have  to  put  in the stress markers?  Simply because they can go
anywhere and SAM has no way of knowing where you want them to go.
The ft-translator products.

*********

End of the Project 64 etext of the SAM/Reciter Manual.

*********
