
// This is the master phoneme file.


// The base phoneme table contains the utility phonemes, the consonants,
// and a schwa.  The vowels are defined in the language specific phoneme
// tables, which can also redefine consonants if they wish.


//*******************************************************************
// UTILITY PHONEMES
//*******************************************************************


phoneme %  //  Unstressed
  stress
  stress_type 1
endphoneme

phoneme %%   //  Diminished stress
  stress
  stress_type 0
endphoneme

phoneme \,   //  [,] Secondary stress
  stress
  stress_type 2
endphoneme

phoneme \,\,  //  [,,] Secondary stress
  stress
  stress_type 3
endphoneme

phoneme '   //  Primary stress
  stress
  stress_type 4
endphoneme

phoneme ''  //  Primary stress (priority)
  stress
  stress_type 5
endphoneme

phoneme '!  //  Primary stress (emphasized)
  stress
  stress_type 6
endphoneme

phoneme =   //  Place stress on previous vowel
  stress
  stress_type 2
endphoneme

phoneme ||  //   End Word
  pause
  lengthmod 1
endphoneme

phoneme _  //  Short pause
  pause
  starttype _ endtype _
  lengthmod 1
  length 25
endphoneme

phoneme _! //   Short pause, don't replace by linking
  pause
  starttype _ endtype _
  lengthmod 1
  nolink
  length 35
endphoneme

phoneme _|   //  Very short pause
  pause
  starttype _ endtype _
  lengthmod 5
  length 1
endphoneme

phoneme _:   //   Standard pause
  pause
  starttype _ endtype _
  lengthmod 1
  length 75
endphoneme

phoneme _::  //   Long pause
  pause
  starttype _ endtype _
  lengthmod 1
  length 150
endphoneme

phoneme _;_  //   clause pause
  pause
  starttype _ endtype _
  lengthmod 1
  length 200
endphoneme

phoneme  _^_  //  Change dictionary (followed by language-code in ascii
  pause
  starttype _ endtype _
  lengthmod 1
  length 10
endphoneme 

phoneme  _X1  //  a language specific action
  pause
  starttype _ endtype _
  lengthmod 1
  length 10
endphoneme 

phoneme ?  // glottal stop
  vls glt stop
  lengthmod 2   // ??
  nolink
  Vowelin  glstop
  Vowelout glstop
  WAV(ustop/null)
endphoneme


phoneme : //  lengthen previous vowel by "length"
  virtual
  length 70
endphoneme

phoneme - //  Indicates the previous phoneme is a syllabic consonant
  virtual
endphoneme


phoneme @    //  Schwa
  vowel   starttype #@  endtype #@
  unstressed
  length 140
  FMT(vowel/@)
endphoneme


phoneme @-   //  very short schwa
  vowel nonsyllabic
  starttype #@  endtype #@
  unstressed
  length 50
  FMT(vowel/@-)
endphoneme


//*******************************************************************
// Other sounds
//*******************************************************************

phoneme #X1  // click, use for indicating capital letters
  vls alv frc sibilant
  lengthmod 3
  WAV(ustop/percus10)
endphoneme


//*******************************************************************
// VIRTUAL - referred to in vowels'   vowel  starttype and endtype
// These each apply to a class of vowels
//*******************************************************************

phoneme #@  virtual
endphoneme

phoneme #a  virtual
endphoneme

phoneme #e  virtual
endphoneme

phoneme #i  virtual
endphoneme

phoneme #o  virtual
endphoneme

phoneme #u  virtual
endphoneme


//*******************************************************************
// SONORANTS
//*******************************************************************


phoneme r-   // syllabic r
  vowel  starttype #@  endtype #@
  unstressed
  length 220
  FMT(vowelr/r-voc)
endphoneme

phoneme l-   // syllabic l
  vowel  starttype #@  endtype #@
  unstressed
  length 200
  FMT(vwl_hi/l-voc)
endphoneme


phoneme r
  liquid rhotic
  lengthmod 7

  IF nextPh(isNotVowel) THEN
    ChangePhoneme(r/)
  ENDIF

  NextVowelStarts
    VowelStart(r/r@, -15)
    VowelStart(r/ra, -15)
    VowelStart(r/re, -15)
    VowelStart(r/ri, -15)
    VowelStart(r/ro, -15)
    VowelStart(r/ru, -15)
  EndSwitch

  IF prevPh(isVowel) THEN
    VowelEnding(r/xr, -50)
  ENDIF

  IF prevPh(isPause) THEN
    FMT(r/_r)
  ELIF prevPh(t) OR prevPh(p) OR prevPh(k) THEN
    FMT(r/tr)
  ENDIF

  FMT(r/r)
endphoneme



phoneme r/   // used for [r] when not preceding a vowel
  liquid rhotic
  lengthmod 2

  IF nextPh(n) THEN
    FMT(r3/r_n) addWav(r3/rx)
  ENDIF

  IF prevPh(t) OR prevPh(p) OR prevPh(k) THEN
    FMT(r/trr)
  ENDIF

  IF prevPh(isNotVowel) THEN
    FMT(r/rr)
  ENDIF

  FMT(r3/r_) addWav(r3/rx)
endphoneme



phoneme R
  liquid
  trill
  lengthmod 6
  Vowelin  f1=0  f2=1600 -300 300  f3=-200 80
  Vowelout f1=2  f2=1600 -300 300  f3=-200 80 brk
  FMT(r3/r_trill2) addWav(r3/r_trill2.wav, 65)
endphoneme

phoneme R2   // this is [R] from Slovak/Czech
  liquid
  trill
  lengthmod 6
  Vowelin  f1=0  f2=1700 -300 300  f3=-300 80
  Vowelout f1=2  f2=1700 -300 300  f3=-300 80 brk
  FMT(r3/r_trill) addWav(r3/r_trill.wav, 50)
endphoneme

phoneme R3  // Afrikaans
  liquid
  trill  
  lengthmod 6
  length 60
  Vowelin  f1=2  f2=2700 -300 -200  f3=-1300 80  
  Vowelout f1=2  f2=1700 -300 -200  f3=-1300 80

  // vowel modifier is the same as for [r]
  NextVowelStarts
    VowelStart(r/r@, -15)
    VowelStart(r/ra, -15)
    VowelStart(r/re, -15)
    VowelStart(r/ri, -15)
    VowelStart(r/ro, -15)
    VowelStart(r/ru, -15)
  EndSwitch

  IF prevPh(isVowel) THEN
    VowelEnding(r/xr, -50)
  ENDIF

  FMT(r3/r_trill) addWav(r3/r_trill3.wav)
endphoneme


phoneme r"     // uvular trill
  vcd uvl frc
  lengthmod 6
  IF nextPh(isNotVowel) THEN
    FMT(r3/r_uvl) addWav(r3/r_uvl.wav, 50)
  ENDIF
  FMT(r3/r_uvl) addWav(r3/r_uvl.wav, 75)
endphoneme


procedure vowelstart_l
  NextVowelStarts
    VowelStart(l/l@)
    VowelStart(l/la)
    VowelStart(l/le)
    VowelStart(l/li, -10)
    VowelStart(l/lo)
    VowelStart(l/lu)
  EndSwitch
endprocedure

phoneme l
  liquid
  lengthmod 7

  IF nextPh(isNotVowel) THEN
    ChangePhoneme(l/)
  ENDIF

  CALL vowelstart_l

  IF prevPh(#@) THEN
    VowelEnding(l/xl, -50)
  ELIF prevPh(isVowel) THEN
    VowelEnding(l/xl, -40)
  ENDIF

  IF prevPh(isPause) THEN
    FMT(l/_l)
  ENDIF

  IF prevPh(t) THEN
    FMT(l/tl)
  ENDIF

  IF prevPh(l/) THEN
    FMT(l/l_long)    // double l, make it longer
  ENDIF

  FMT(l/l)
endphoneme


phoneme l/    // used for [l] when not before a vowel
  liquid
  lengthmod 7

  IF nextPh(isVowel) THEN
    ChangePhoneme(l)
  ENDIF

  PrevVowelEndings
    VowelEnding(l/L1_@L, -60)
    VowelEnding(l/L1_aL, -40)
    VowelEnding(l/L1_eL, -30)
    VowelEnding(l/L1_iL, -30)
    VowelEnding(l/L1_oL, -40)
    VowelEnding(l/L1_uL, -40)
  EndSwitch

  FMT(l/l_)
endphoneme

phoneme l/2    // 'dark' [l] after a vowel
  liquid
  lengthmod 7

  IF nextPh(isVowel) THEN
    ChangePhoneme(l)
  ENDIF

  PrevVowelEndings
    VowelEnding(l/L2_@L, -60)
    VowelEnding(l/L2_aL, -50)
    VowelEnding(l/L2_eL, -40)
    VowelEnding(l/L2_iL, -30)
    VowelEnding(l/L2_oL, -50)
    VowelEnding(l/L2_uL, -40)
  EndSwitch
endphoneme


phoneme l/3    // Replacement for [l/]
  liquid
  lengthmod 7

  IF nextPh(isVowel) THEN
    ChangePhoneme(l)
  ENDIF

  PrevVowelEndings
    VowelEnding(l/l_@)
    VowelEnding(l/l_a)
    VowelEnding(l/l_e)
    VowelEnding(l/l_i)
    VowelEnding(l/l_o)
    VowelEnding(l/l_u, -20)
  EndSwitch

//  IF nextPh(isLiquid) THEN
//    FMT(l/_l)
//  ENDIF

  FMT(l/l_)
endphoneme



phoneme l^    // palatal l
  liquid
  lengthmod 7
  Vowelout len=60 lenadd rate
  length 100

  NextVowelStarts
    VowelStart(l^/j2@)
    VowelStart(l^/j2a)
    VowelStart(l^/j2e)
    VowelStart(l^/j2i)
    VowelStart(l^/j2o)
    VowelStart(l^/j2u)
  EndSwitch

  IF prevPh(isPause) THEN
    FMT(l^/_l^)
  ENDIF

  FMT(l^/l^)
endphoneme


phoneme l.
  liquid rfx
  lengthmod 7
  FMT(l^/l_rfx)
endphoneme



phoneme w
  liquid
  lengthmod 7

  IF nextPh(isVowel) THEN
    NextVowelStarts
      VowelStart(w/w@)
      VowelStart(w/wa)
      VowelStart(w/we)
      VowelStart(w/wi)
      VowelStart(w/wo)
      VowelStart(w/wu)
    EndSwitch

    VowelEnding(w/xw, -30)

    IF prevPh(isPause) THEN
      FMT(w/_w)
    ELSE
      FMT(w/_w)
    ENDIF
  ELSE
    // no vowel follows
    Vowelout len=50
    IF prevPh(#i) THEN
      FMT(w/iw_)
    ENDIF
    FMT(w/w_)
  ENDIF
endphoneme



phoneme j
  liquid palatal
  lengthmod 7

  IF nextPh(isVowel) THEN
    NextVowelStarts
      VowelStart(j/j@)
      VowelStart(j/ja)
      VowelStart(j/je)
      VowelStart(j/ji)
      VowelStart(j/jo)
      VowelStart(j/ju)
    EndSwitch

    VowelEnding(j/xj, -30)

    IF prevPh(isPause) THEN
      FMT(j/_j)
    ENDIF
  ELSE
    // no vowel follows
    Vowelout len=70
    FMT(j/j_)
  ENDIF
endphoneme


phoneme ;     // linking j, used between (i) vowels and a following vowel
              // also to palatalize consonants
  liquid palatal
  lengthmod 0

  IF nextPh(isNotVowel) THEN
    ChangePhoneme(NULL)   // this is to ignore this phoneme if not before a vowel
  ENDIF

  NextVowelStarts
    VowelStart(j2/j2@)
    VowelStart(j2/j2a)
    VowelStart(j2/j2e)
    VowelStart(j2/j2i)
    VowelStart(j2/j2o)
    VowelStart(j2/j2u)
  EndSwitch

  IF prevPh(#i) THEN
    VowelEnding(j2/xj2, -40)
  ENDIF

  IF prevPh(isPause) THEN
    FMT(j2/_j2)
  ENDIF
endphoneme


//*******************************************************************
// NASAL CONSONANTS
//*******************************************************************


phoneme m
  vcd blb nasal
  Vowelout f1=2  f2=1000 -500 -350  f3=-200 80 brk
  lengthmod 4

  IF KlattSynth THEN
    Vowelin  f1=0  f2=1000 -50 -200  f3=-200 80
    IF nextPh(isPause2) THEN
      FMT(klatt/m_)
    ENDIF
    FMT(klatt/m)
  ENDIF

  NextVowelStarts
    VowelStart(m/m@)
    VowelStart(m/ma)
    VowelStart(m/me)
    VowelStart(m/mi)
    VowelStart(m/mo)
    VowelStart(m/mu)
  EndSwitch

  IF prevPh(isNotVowel) AND nextPhW(isLiquid) THEN
    FMT(m/mj)
  ELIF prevPh(isPause) THEN
    FMT(m/_m)
  ELIF nextPh(isNotVowel) THEN
    FMT(m/m_)
  ENDIF
endphoneme


phoneme n
  vcd alv nasal
  Vowelout f1=2 f2=1700 -300 250  f3=-100 80  rms=20 brk
  lengthmod 4

  IF KlattSynth THEN
    Vowelin f1=0 f2=1500 -200 200 f3=0 80
    FMT(klatt/n)
  ENDIF

  NextVowelStarts
    VowelStart(n/n@)
    VowelStart(n/na)
    VowelStart(n/ne)
    VowelStart(n/ni)
    VowelStart(n/no)
    VowelStart(n/nu)
  EndSwitch

  IF prevPh(isNotVowel) AND nextPhW(isLiquid) THEN
    FMT(n/nj)
  ELIF prevPh(isPause) OR prevPh(n) THEN
    FMT(n/_n)
  ELIF nextPh(isNotVowel) THEN
    FMT(n/n_)
  ENDIF
endphoneme


phoneme n.
  vcd rfx nasal
  starttype n  endtype n
  Vowelin f1=2 f2=1200 -300 250  f3=-500 80  rms=20 colr=2
  Vowelout f1=2 f2=1200 -300 250  f3=-500 80  rms=20 brk colr=2
  lengthmod 4

  IF KlattSynth THEN
    FMT(klatt/nr)
  ENDIF

  NextVowelStarts
    VowelStart(n/n@)
    VowelStart(n/na)
    VowelStart(n/ne)
    VowelStart(n/ni)
    VowelStart(n/no)
    VowelStart(n/nu)
  EndSwitch

  IF prevPh(isNotVowel) AND nextPhW(isLiquid) THEN
    FMT(n/nj)
  ELIF prevPh(isPause) OR prevPh(n.) THEN
    FMT(n/_nr)
  ELIF nextPh(isNotVowel) THEN
    FMT(n/nr_)
  ENDIF
endphoneme


phoneme n^
  vcd pal nasal palatal
  Vowelout f1=3 f2=2500 300 500  f3=100 80  len=45 brk rate
  lengthmod 4

  IF KlattSynth THEN
    VowelStart(klatt/n^@)
    FMT(klatt/n^)
  ENDIF

  NextVowelStarts
    VowelStart(n^/n^@)
    VowelStart(n^/n^a)
    VowelStart(n^/n^e)
    VowelStart(n^/n^i)
    VowelStart(n^/n^o)
    VowelStart(n^/n^u)
  EndSwitch

  IF prevPh(isPause) THEN
    FMT(n^/_n^)
  ELIF nextPh(isNotVowel) THEN
    IF nextPhW(n^) THEN
      Length 75
    ELIF prevPhW(n^) THEN
      Length 100
    ENDIF
    FMT(n^/n^_)
  ENDIF
endphoneme


phoneme N
  vcd vel nasal
  Vowelout f1=3 f2=2300 300 400  f3=-200 80  len=40 rms=20 brk
  lengthmod 8            // longer than 'n'

  IF KlattSynth THEN
    Vowelin f1=0 f2=2100 50 300 f3=0 80
    FMT(klatt/nn)
  ENDIF

  NextVowelStarts
    VowelStart(nn/nn@)
    VowelStart(nn/nna)
    VowelStart(nn/nne)
    VowelStart(nn/nni)
    VowelStart(nn/nno)
    VowelStart(nn/nnu)
  EndSwitch

  IF prevPh(#i) THEN
    VowelEnding(nn/inn, -40)
  ENDIF

  IF prevPh(isNotVowel) AND nextPhW(isLiquid) THEN
    FMT(nn/nnj)
  ELIF prevPh(isPause) THEN
    FMT(nn/_nn)
  ELIF nextPh(isNotVowel) THEN
    FMT(nn/nn_)
  ENDIF
endphoneme


phoneme **    //   TEST flap
  liquid alv
  lengthmod 3
  Vowelout f1=3 f2=1600 -300 300  f3=-300 80 rms=35 len=15
  Vowelin f1=2  f2=1600 -300 300  f3=-100 80 len=20

  IF prevPh(#i) OR prevPh(#e) THEN
    FMT(r3/@tap2)
  ENDIF
  FMT(r3/@tap)
endphoneme



phoneme *    //   flap
  vcd alv flp
  brkafter
  lengthmod 3

  IF nextPh(#e) OR nextPh(#i) THEN
    Vowelin f1=0  f2=1500 -300 300  f3=-200 80
    FMT(d/tap1) addWav(r3/rx, 150)
    FMT(d/tap1) addWav(r3/rx, 150)
  ENDIF

  Vowelin f1=2  f2=1500 -300 300  f3=-200 80
  IF nextPh(#a) THEN
    FMT(d/tap3) addWav(r3/rx, 200)
  ENDIF

  IF nextPh(r) THEN
    FMT(d/dr)
  ENDIF

  Vowelout f1=3 f2=1500 -400 300  f3=-200 80 rms=35 len=50
  Vowelin f1=0  f2=1500 -300 300  f3=-200 80
  FMT(d/tap3) addWav(r3/rx, 200)
endphoneme



phoneme r.    //   retroflex
  liquid rfx
  lengthmod 3
  Vowelout f1=3 f2=1400 -400 300  f3=-400 80 rms=35 len=15 colr=2
  Vowelin f1=2  f2=1400 -400 300  f3=-400 80 len=20
  FMT(r3/@tap_rfx)
endphoneme


//*******************************************************************
// VOICED STOPS
//*******************************************************************


phoneme  b
  vcd blb stop
  voicingswitch p 
  Vowelout f1=2  f2=1000 -500 -300  f3=-300 80 brk
  lengthmod 5

  IF PreVoicing THEN
    FMT(b/xb)
  ENDIF

  IF KlattSynth THEN
    Vowelin f1=1  f2=1000 -500 -300  f3=-300 80
    IF nextPh(isPause2) THEN
      FMT(klatt/b)  addWav(x/b_)
    ENDIF
    FMT(klatt/b) addWav(x/b)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(b/b_) addWav(x/b_)
  ELIF nextPh(@-) THEN
    FMT(b/b@2) addWav(x/b)
  ELIF nextPh(#@) THEN
    FMT(b/b@) addWav(x/b)
  ELIF nextPh(#a) THEN
    FMT(b/ba) addWav(x/b)
  ELIF nextPh(#e) THEN
    FMT(b/be) addWav(x/b)
  ELIF nextPh(#i) THEN
    FMT(b/bi) addWav(x/b)
  ELIF nextPh(#o) THEN
    FMT(b/bo) addWav(x/b)
  ELIF nextPh(#u) THEN
    FMT(b/bu) addWav(x/b)
  ENDIF

  FMT(b/b) addWav(x/b)
endphoneme


phoneme d
  vcd alv stop
  voicingswitch t
  lengthmod 5
  Vowelin f1=1  f2=1700 -300 300  f3=-100 80
  Vowelout f1=2 f2=1700 -300 300  f3=-100 80 brk

  IF PreVoicing THEN
    FMT(d/xd)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(d/d_)  addWav(x/d_)
//  ELIF nextPh(r) THEN
//    FMT(d/dr) addWav(x/d)
  ENDIF

  FMT(d/d) addWav(x/d)
endphoneme


phoneme d[
  vcd dnt stop
  voicingswitch t[
  lengthmod 5
  Vowelin f1=2  f2=1500 -300 300  f3=-150 80
  Vowelout f1=2 f2=1500 -300 300  f3=-150 80

  IF PreVoicing THEN
    FMT(d/xd)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(d/d_)  addWav(x/d_)
  ELIF nextPh(r) THEN
    FMT(d/dr) addWav(x/d_dnt, 110)
  ENDIF

  FMT(d/d) addWav(x/d_dnt, 110)
endphoneme


phoneme dZ
  vcd pla afr sibilant
  voicingswitch tS
  lengthmod 5
  Vowelin f1=2  f2=2300 200 400  f3=100 80
  Vowelout f1=2  f2=2300 250 300  f3=100 80 brk

  IF PreVoicing THEN
    FMT(dzh/xdzh)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(dzh/dzh_) addWav(x/dzh_)
  ENDIF
  FMT(dzh/dzh) addWav(x/dzh)
endphoneme


phoneme dZ;
  vcd pla afr sibilant palatal
  voicingswitch tS;
  lengthmod 5
  Vowelin f1=2  f2=2700 400 600  f3=300 80 rate len=70
  Vowelout f1=2 f2=2700 400 600  f3=300 80

  IF PreVoicing THEN
    FMT(dzh/xdzh)
  ENDIF

  IF KlattSynth THEN
    IF nextPh(isPause2) THEN
      FMT(dzh/dzh_) addWav(x/dzh_)
    ENDIF
    FMT(dzh/dzh) addWav(x/dz_pzd)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(dzh/dzh_) addWav(x/dzh_)
  ENDIF
  FMT(dzh/dzh) addWav(x/dz_pzd)
endphoneme


phoneme J
  vcd pal afr sibilant
  voicingswitch c
  lengthmod 5
  Vowelin f1=2  f2=2700 400 600  f3=300 80 rate len=70
  Vowelout f1=2 f2=2700 400 600  f3=300 80 colr=1

  IF PreVoicing THEN
    FMT(dzh/xdz_pzd)
  ENDIF

  IF KlattSynth THEN
    IF nextPh(isPause2) THEN
      FMT(klatt/dz_pzd_) addWav(x/dzh, 35)
    ENDIF
    FMT(klatt/dz_pzd) addWav(x/dzh, 45)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(dzh/dz_pzd_) addWav(x/dzh, 35)
  ENDIF
  FMT(dzh/dz_pzd) addWav(x/dzh, 45)
endphoneme


phoneme g
  vcd vel stop
  voicingswitch k
  lengthmod 5
  Vowelin f1=2  f2=2300 200 300  f3=-300 80
  Vowelout f1=2  f2=2300 250 300  f3=-300 80 brk

  IF PreVoicing THEN
    FMT(g/xg)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(g/g_) addWav(x/g_)
  ENDIF
  FMT(g/g) addWav(x/g2, 150)
endphoneme



//*******************************************************************
// VOICED fricatives
//*******************************************************************


phoneme B
  vcd blb frc
  voicingswitch f
  lengthmod 6
  Vowelin  f1=2  f2=1000 -300 -200  f3=-100 100
  Vowelout f1=2  f2=1000 -500 -300  f3=-100 60  len=50

  IF KlattSynth THEN
    IF nextPh(isPause2) THEN
      FMT(klatt/v_) addWav(vocw/v)
    ENDIF
    FMT(klatt/bh) addWav(vocw/v)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/v_) addWav(vocw/v)
  ENDIF
  FMT(voc/bh) addWav(vocw/v)
endphoneme


phoneme v
  vcd lbd frc
  voicingswitch f
  lengthmod 6
  Vowelin  f1=0  f2=1000 -300 -200  f3=-300 100
  Vowelout f1=0  f2=1000 -500 -300  f3=-300 60  len=50

  IF KlattSynth THEN
    Vowelout f1=1  f2=1000 -500 -300  f3=-300 60  len=50 brk
    IF nextPh(isPause2) THEN
      FMT(klatt/v_) addWav(vocw/v)
    ENDIF
    FMT(klatt/v) addWav(vocw/v, 150)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/v_) addWav(vocw/v)
  ENDIF
  IF thisPh(isWordStart) AND nextPhW(isLiquid) THEN
    Length 70
  ENDIF
  FMT(voc/v) addWav(vocw/v)
endphoneme


phoneme v#        // approximant, not fricative
  vcd lbd frc
  lengthmod 6
  voicingswitch f
  Vowelin  f1=0  f2=1000 -300 -200  f3=-300 100
  Vowelout f1=0  f2=1000 -500 -300  f3=-300 60  len=50
  IF nextPh(isPause2) THEN
    FMT(voc/v#_)
  ENDIF
  FMT(voc/v#)
endphoneme


phoneme D
  vcd dnt frc
  voicingswitch T
  lengthmod 6
  Vowelout f1=0  f2=1700 -300 300  f3=-100 60  len=50

  IF KlattSynth THEN
    Vowelin f1=0 f2=1290 -300 300 f3=0 0
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/dh_) addWav(vocw/dh)
  ENDIF
  FMT(voc/dh) addWav(vocw/dh)
endphoneme


phoneme z
  vcd alv frc sibilant
  voicingswitch s
  lengthmod 6
  Vowelout f1=0  f2=1700 -300 300  f3=-100 60  len=50

  IF KlattSynth THEN
    Vowelin f1=0 f2=1390 -300 300 f3=0 0
    Vowelout f1=1  f2=1390 -300 300  f3=-100 60  len=50 brk
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/z_) addWav(ufric/s_, 85)
  ENDIF
  FMT(voc/z) addWav(ufric/s_)
endphoneme


phoneme Z
  vcd pla frc sibilant
  voicingswitch S
  lengthmod 6
  Vowelin  f1=0  f2=2000 0 300  f3=-200 80
  Vowelout f1=2  f2=2000 0 300  f3=-200 80 brk

  IF KlattSynth THEN
    IF nextPh(isPause2) THEN
      FMT(klatt/zh_) addWav(vocw/zh)
    ENDIF
    FMT(klatt/zh) addWav(vocw/zh, 130)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/zh_) addWav(vocw/zh)
  ENDIF
  FMT(voc/zh) addWav(vocw/zh, 130)
endphoneme


phoneme z.
  vcd pla frc sibilant
  voicingswitch s.
  lengthmod 6
  Vowelin  f1=0  f2=1800 -100 300  f3=-300 80
  Vowelout f1=2  f2=1800 -100 300  f3=-300 80 brk

  IF KlattSynth THEN
    IF nextPh(isPause2) THEN
      FMT(klatt/zh_) addWav(vocw/zh_rfx)
    ENDIF
    FMT(klatt/zh) addWav(vocw/zh_rfx)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/zh_) addWav(vocw/zh_rfx)
  ENDIF
  FMT(voc/zh) addWav(vocw/zh_rfx)
endphoneme


phoneme z;
  vcd pal frc sibilant palatal
  voicingswitch s;
  lengthmod 6
  Vowelin  f1=2  f2=2700 400 600  f3=300 80 rate len=70
  Vowelout f1=2  f2=2300 250 300  f3=-300 80 brk

  IF nextPh(isPause2) THEN
    FMT(voc/z_pzd_) addWav(ufric/s_pzd_, 80)
  ENDIF
  FMT(voc/z_pzd) addWav(ufric/s_pzd, 80)
endphoneme


phoneme Z;
  vcd pal frc sibilant palatal
  voicingswitch S;
  lengthmod 6
  Vowelin  f1=2  f2=2700 400 600  f3=300 80 rate len=70
  Vowelout f1=2  f2=2300 250 300  f3=-300 80 brk

  IF nextPh(isPause2) THEN
    FMT(voc/z_pzd_) addWav(ufric/sh_pzd_)
  ENDIF
  FMT(voc/z_pzd) addWav(ufric/sh_pzd, 80)
endphoneme


phoneme J^   // palatal fricative (Kirshenbaum C<vcd>)
  vcd pal frc palatal
  voicingswitch C
  lengthmod 6
  Vowelin f1=1  f2=2700 400 600  f3=200 70
  Vowelout f1=1 f2=2700 400 600  f3=200 70 len=100

  FMT(voc/j) addWav(ufric/ch, 25)
endphoneme


phoneme Q
  vcd vel frc
  voicingswitch x
  lengthmod 6
  Vowelin f1=2  f2=2300 200 400  f3=-100 80
  Vowelout f1=2  f2=2300 250 300  f3=-300 80 brk

  IF KlattSynth THEN
    IF nextPh(isPause2) THEN
      FMT(klatt/qqh_) addWav(vocw/Q_)
    ENDIF
    FMT(klatt/qqh) addWav(vocw/Q)
  ENDIF

  IF nextPh(isPause2) THEN
    FMT(voc/Q_) addWav(vocw/Q_)
  ENDIF
  FMT(voc/Q) addWav(vocw/Q)
endphoneme


phoneme Q^
  vcd vel frc
  lengthmod 6
  Vowelin f1=2  f2=2700 400 600  f3=200 80
  Vowelout f1=2  f2=2700 40 600  f3=200 80 brk

  IF nextPh(isPause2) THEN
    FMT(voc/Q_) addWav(vocw/Q_)
  ENDIF
  FMT(voc/Q) addWav(vocw/Q)
endphoneme


phoneme Q"       // voiced velar fricative
  vcd uvl frc
  lengthmod 6

  IF nextPh(isPause2) THEN
    FMT(voc/Q_ulv) addWav(ufric/xx, 60)
  ENDIF
  FMT(voc/Q_ulv) addWav(ufric/xx, 80)
endphoneme




//*******************************************************************
// UNVOICED STOPS
//*******************************************************************


phoneme p
  vls blb stop
  voicingswitch b
  lengthmod 2
  Vowelin  f1=0  f2=1000 -50 -100  f3=-200 80 amp=11
  Vowelout f1=0  f2=1000 -500 -350  f3=-300 80 rms=22

  IF nextPh(isPause2) THEN
    WAV(ustop/p_)
  ELIF nextPh(r) THEN
    WAV(ustop/pr, 70)
  ELIF nextPh(R) OR nextPh(R2) THEN
    WAV(ustop/pr)
  ELIF nextPh(@-) THEN
    WAV(ustop/p_unasp)
  ELIF nextPh(l) THEN
    WAV(ustop/pl)
  ENDIF
  WAV(ustop/p)
endphoneme


phoneme t
  vls alv stop
  voicingswitch d
  lengthmod 2
  Vowelin f1=0  f2=1700 -300 300  f3=-100 80
  Vowelout f1=0 f2=1700 -300 250  f3=-100 80  rms=20

  IF nextPh(isPause2) THEN
    WAV(ustop/t_)
  ELIF nextPh(r) OR nextPh(R) OR nextPh(R2) THEN
    WAV(ustop/tr)
  ELIF nextPh(@-) THEN
    WAV(ustop/t_dnt, 50)
  ENDIF
  WAV(ustop/t, 90)
endphoneme


phoneme t[        // dental variant of /t/
  vls dnt stop
  voicingswitch d[
  lengthmod 2
  Vowelin f1=1  f2=1500 -250 250  f3=-100 80  amp=16
  Vowelout f1=0 f2=1500 -300 250  f3=-100 80  rms=20

  IF nextPh(isPause2) THEN
    WAV(ustop/t_dnt, 35)
  ENDIF
  WAV(ustop/t_hi, 70)
endphoneme


phoneme tS
  vls pla afr sibilant
  voicingswitch dZ
  lengthmod 2
  Vowelin f1=0  f2=2300 200 400  f3=-100 80

  IF nextPh(isPause2) THEN
    WAV(ustop/tsh_)
  ENDIF
  WAV(ustop/tsh)
endphoneme


phoneme tS;
  vls pal afr sibilant palatal
  voicingswitch dZ;
  lengthmod 2
  Vowelin f1=0  f2=2700 400 600  f3=300 80 rate len=70

  IF nextPh(isPause2) THEN
    WAV(ustop/ts_pzd)
  ENDIF
  WAV(ustop/ts_pzd)
endphoneme


phoneme c
  vls pal stop palatal
  voicingswitch J
  lengthmod 2
  Vowelin f1=0  f2=2700 400 600  f3=300 80 rate len=70
  Vowelout f1=1  f2=2700 400 600  f3=200 70 len=50 colr=1

  IF nextPh(isPause2) THEN
    WAV(ustop/t_pzd, 30)
  ENDIF
  WAV(ustop/c, 130)
endphoneme


phoneme k
  vls vel stop
  voicingswitch g
  lengthmod 2
  Vowelin f1=0  f2=2300 200 300  f3=-200 80
  Vowelout f1=0 f2=2300 300 400  f3=-200 80  rms=20

  IF KlattSynth THEN
    Vowelout f1=0 f2=2300 200 300  f3=-200 80  rms=20
  ENDIF

  IF nextPh(isPause2) THEN
    WAV(ustop/k_)
  ELIF nextPh(r) OR nextPh(R) OR nextPh(R2) THEN
    WAV(ustop/kr)
  ELIF nextPh(#i) OR nextPh(;) THEN
    WAV(ustop/ki)
  ELIF nextPh(l) THEN
    WAV(ustop/kl)
  ELIF nextPh(@-) THEN
    WAV(ustop/k_unasp, 70)
  ENDIF
  WAV(ustop/k)
endphoneme


phoneme q
  vls uvl stop
  lengthmod 2
  Vowelin f1=1  f2=1700 0 200  f3=-300 80 paus f4 rms=30
  Vowelout f1=1 f2=1700 -100 200  f3=-300 80  f4 rms=35

  IF nextPh(isPause2) THEN
    WAV(ustop/q, 40)
  ELIF nextPh(#u) THEN
    WAV(ustop/q_u, 80)
  ENDIF
  WAV(ustop/q, 48)
endphoneme



//*******************************************************************
// UNVOICED fricatives
//*******************************************************************

phoneme f
  vls lbd frc
  voicingswitch v
  lengthmod 3
  Vowelout f1=0  f2=1000 -500 -350  f3=-200 80

  IF nextPh(isPause) THEN
    WAV(ufric/f_)
  ENDIF
  WAV(ufric/f)
endphoneme


phoneme T
  vls dnt frc
  voicingswitch D
  lengthmod 3
  Vowelin f1=0  f2=1700 -300 300  f3=-100 80
  Vowelout f1=0 f2=1700 -300 250  f3=-100 80  rms=20

  IF nextPh(isPause) THEN
    WAV(ufric/th_)
  ENDIF
  WAV(ufric/th)
endphoneme


phoneme s
  vls alv frc sibilant
  voicingswitch z
  lengthmod 3
  Vowelin  f1=0  f2=1700 -300 300  f3=-100 80
  Vowelout f1=0  f2=1700 -300 250  f3=-100 80  rms=20

  IF nextPh(isPause) THEN
    WAV(ufric/s_)
  ELIF nextPh(p) OR nextPh(t) OR nextPh(k) THEN
    WAV(ufric/s!)
  ENDIF
  WAV(ufric/s)
endphoneme


phoneme S
  vls pla frc sibilant
  voicingswitch Z
  lengthmod 3
  Vowelin  f1=0  f2=2100 100 300  f3=-100 80
  Vowelout f1=0  f2=2100 100 300  f3=-100 80

  IF nextPh(isPause) THEN
    WAV(ufric/sh_)
  ENDIF
  WAV(ufric/sh)
endphoneme


phoneme s.
  vls pla frc sibilant
  voicingswitch z.
  lengthmod 3
  Vowelin  f1=0  f2=1800 -100 300  f3=-300 80
  Vowelout f1=0  f2=1800 -100 300  f3=-300 80

  IF nextPh(isPause) THEN
    WAV(ufric/sh_rfx, 60)
  ENDIF
  WAV(ufric/sh_rfx, 90)
endphoneme


phoneme s;
  vls pal frc sibilant palatal
  voicingswitch z;
  lengthmod 3
  Vowelin  f1=1  f2=2700 400 600  f3=200 70 rate len=70
  Vowelout f1=1  f2=2700 400 600  f3=200 70 rate len=70

  IF nextPh(isPause) THEN
    WAV(ufric/s_pzd_)
  ENDIF
  WAV(ufric/s_pzd)
endphoneme


phoneme S;
  vls pal frc sibilant palatal
  voicingswitch Z;
  lengthmod 3
  Vowelin  f1=1  f2=2700 400 600  f3=200 70 rate len=70
  Vowelout f1=1  f2=2700 400 600  f3=200 70 rate

  IF nextPh(isPause) THEN
    WAV(ufric/sh_pzd_)
  ENDIF
  WAV(ufric/sh_pzd)
endphoneme


phoneme L   // Welsh "ll"
  vls alv frc
  lengthmod 3

  NextVowelStarts
    VowelStart(l/l@)
    VowelStart(l/la)
    VowelStart(l/le)
    VowelStart(l/li, -10)
    VowelStart(l/lo)
    VowelStart(l/lu)
  EndSwitch

  IF prevPh(isVowel) THEN
    VowelEnding(l/xl, -40)
  ENDIF

  WAV(ufric/ll, 80)
endphoneme


phoneme C
  vls pal frc palatal
  lengthmod 3
  Vowelin f1=0  f2=2700 400 600  f3=200 70
  Vowelout f1=0 f2=2700 400 600  f3=200 70  rms=20

  IF nextPh(isPause) THEN
    WAV(ufric/ch_)
  ENDIF
  WAV(ufric/ch)
endphoneme


phoneme x
  vls vel frc
  voicingswitch Q
  lengthmod 3
  Vowelin f1=0  f2=2300 200 400  f3=-100 80
  Vowelout f1=0 f2=2300 300 400  f3=-100 80  rms=20

  IF nextPh(isPause) THEN
    WAV(ufric/x, 120)
  ENDIF
  WAV(ufric/x_hr, 30)
endphoneme


phoneme X
  vls uvl frc
  voicingswitch Q"
  lengthmod 3

  IF nextPh(isPause) THEN
    WAV(ufric/xx, 70)
  ENDIF
  WAV(ufric/xx)
endphoneme


phoneme h
  vls glt apr
  lengthmod 3

  IF nextPh(#@) THEN
    WAV(h/h@)
  ELIF nextPh(#a) THEN
    WAV(h/ha)
  ELIF nextPh(#e) THEN
    WAV(h/he)
  ELIF nextPh(#i) THEN
    WAV(h/hi)
  ELIF nextPh(#o) THEN
    WAV(h/ho)
  ELIF nextPh(#u) THEN
    WAV(h/hu)
  ENDIF
  WAV(h/h_, 70)  // no vowel following
endphoneme



//*******************************************************************
// ADDITIONAL PHONEME TABLES
//*******************************************************************

phonemetable consonants base
include ph_consonants


phonemetable base2 base
include ph_base2

phonemetable en base
include ph_english

phonemetable en_n en
include ph_english_n

phonemetable en_us en
include ph_english_us

phonemetable en_sc en
include ph_english_sc

phonemetable en_rp en
include ph_english_rp

phonemetable en_wm en
include ph_english_wm

phonemetable en_wi en
include ph_english_wi


phonemetable af base
include ph_afrikaans

phonemetable cy base
include ph_welsh

phonemetable de base
include ph_german

phonemetable eo base
include ph_esperanto

phonemetable jbo eo
include ph_lojban

phonemetable nci base2
include ph_nahuatl

phonemetable fi base
include ph_finnish

phonemetable fr base
include ph_french

phonemetable fr_ca fr
include ph_french_ca

phonemetable hi base
include ph_hindi

phonemetable ta hi
include ph_tamil

phonemetable hu base
include ph_hungarian

phonemetable lv base
include ph_latvian

phonemetable nl base
include ph_dutch

phonemetable pl base
include ph_polish

phonemetable sk pl
include ph_slovak

phonemetable cs sk
include ph_czech

phonemetable hr sk
include ph_croatian

phonemetable mk hr
include ph_macedonian

phonemetable sr hr
include ph_serbian


phonemetable it base2
include ph_italian

phonemetable la base
include ph_latin

phonemetable es base2
include ph_spanish

phonemetable es_la es
include ph_spanish_la

phonemetable ca es
include ph_catalan

phonemetable pt base2
include ph_pt_brazil

phonemetable pt_pt pt
include ph_portugal

phonemetable ro base2
include ph_romanian

phonemetable el base2
include ph_greek

phonemetable grc base2
include ph_greek_ancient

phonemetable sv base
include ph_swedish

phonemetable no base
include ph_norwegian

phonemetable is base
include ph_icelandic

phonemetable ru base
include ph_russian

phonemetable vi base
include ph_vi

phonemetable zhy base
include ph_zh_yue

phonemetable zh base
include ph_zh


phonemetable sw base
include ph_swahili

phonemetable tr base2
include ph_turkish

phonemetable ku base2
include ph_kurdish

phonemetable id base2
include ph_indonesian

phonemetable sq base
include ph_albanian

phonemetable hy base
include ph_armenian

phonemetable da base
include ph_danish


phonemetable rw base2
include ph_kinyarwanda

phonemetable ml hi
include ph_malayalam

//phonemetable kn hi
//include ph_kannada

//phonemetable bn hi
//include ph_bengali

phonemetable ne hi
include ph_nepali

//phonemetable mr hi
//include ph_marathi


//phonemetable eu base2
//include ph_basque

//phonemetable mn base
//include ph_mongolian

phonemetable pa hi
include ph_punjabi

phonemetable prs base
include ph_dari
