int ndim = 41;
float eps = 0.2;
string SOURCEKIND = USER;

# "Silence" is defined as a cough, a breath, a lip smack, or quiet.
# This chunk is at least 50ms long (the "+" signs mean that the states
# loop back to themselves, and can therefore be as long as desired).
# Of course, there is nothing that enforces that the states labelled "cough"
# are actually coughs.   It's really just four different kinds of silence.
macro s1 = 3* smack:+:v=quiet:m=$s$i | 3* quiet:+:v=vquiet:m=mquiet ;
macro s2 = 4* breath:+:v=quiet | 4* quiet:+:v=vquiet:m=mquiet ;
macro silence = s1 s2 s1 ;
# All the "v=", "m=", and "s=" stuff involves sharing of variances,
# means, or entire state definitions.     For instance, all the "cough"
# states share a comon variance.    All the "cough0" states share a
# common mean, so they will be the same whether the "silence" macro
# is an initial silence or a silence within an IWS.

# So, a "S" phoneme can include multiple coughs, breaths, quiet, etc.
# We require two silences so that the total duration is >100ms,
# which is what differentiates an audible pause from a stop.
phone S = silence:+ ;



macro stop = 3* stop_sequence:+:v=C:m=$s$i ;
macro voiced_fricative = 3* v_frication:+:v=C:m=$s$i ;
macro unvoiced_fricative = 3* unv_frication:+:v=C:m=$s$i ;
macro c = stop | voiced_fricative | unvoiced_fricative ;
# Liason gets stuck between two vowels at French word boundaries.
phone C = c ;

macro sonorant = 3* semiclosure:+:m=$s$i:v=$s ;
phone M = sonorant;
macro liason = c | sonorant ;

#Inter-word spaces.     An IWS is either a single state (10ms long)
# that can help join the two neighbouring phones together
# _or_ it is two or more repetitions of the "silence" macro.
# (And a state for a transition into silence, and a state for transition
# out of silence back to speech.) 

phone IPP_SC = pp_transition:v=TR:m=SC ;
phone IPP_SM = pp_transition:v=TR:m=SM ;
phone IWP_CC = pp_transition:v=TR:m=CC | pp_transition:v=TR:m=CS silence:+ pp_transition:v=TR:m=SC ;
phone IPP_CC = pp_transition:v=TR:m=CC ;
phone IWP_CM = pp_transition:v=TR:m=CM | pp_transition:v=TR:m=CS silence:+ pp_transition:v=TR:m=SM ;
phone IPP_CM = pp_transition:v=TR:m=CM ;
phone IWP_MM = pp_transition:v=TR:m=MM | pp_transition:v=TR:m=MS silence:+ pp_transition:v=TR:m=SM ;
phone IPP_MM = pp_transition:v=TR:m=MM ;
phone IWP_VC = pp_transition:v=TR:m=VC | pp_transition:v=TR:m=VS silence:+ pp_transition:v=TR:m=SC ;
phone IPP_VC = pp_transition:v=TR:m=VC ;
phone IWP_VM = pp_transition:v=TR:m=VM | pp_transition:v=TR:m=VS silence:+ pp_transition:v=TR:m=SM ;
phone IPP_VM = pp_transition:v=TR:m=VM ;
phone IPP_CS = pp_transition:v=TR:m=CS ;
phone IPP_MS = pp_transition:v=TR:m=MS ;
# In French, we have liason at V #word V:
phone IWP_VV = pp_transition:v=TR:m=VV
		| pp_transition:v=TR:m=VS silence:+ pp_transition:v=TR:m=SV
		| pp_transition:v=TR:m=VC liason  pp_transition:v=TR:m=CV ;
phone IPP_VV = pp_transition:v=TR:m=VV ;
# IPP_VVL is used where we know there is no pause, but liason is possible.
phone IPP_VVL = pp_transition:v=TR:m=VV
		| pp_transition:v=TR:m=VC liason  pp_transition:v=TR:m=CV ;
phone IPP_SV = pp_transition:v=TR:m=SV ;
phone IWP_CV = pp_transition:v=TR:m=CV | pp_transition:v=TR:m=CS silence:+ pp_transition:v=TR:m=SV ;
phone IPP_CV = pp_transition:v=TR:m=CV ;
phone IWP_MV = pp_transition:v=TR:m=MV | pp_transition:v=TR:m=MS silence:+ pp_transition:v=TR:m=SV ;
phone IPP_MV = pp_transition:v=TR:m=MV ;
phone IWP_MC = pp_transition:v=TR:m=MC | pp_transition:v=TR:m=MS silence:+ pp_transition:v=TR:m=SC ;
phone IPP_MC = pp_transition:v=TR:m=MC ;
phone IPP_VS = pp_transition:v=TR:m=VS ;

# These are so rare that we lump them with IWP_XX
# phone IWP_VX = pp_transition:V=TR:m=VX | pp_transition:V=TR:m=VS silence:+ pp_transition:V=TR:m=SX ;
# phone IWP_CX = pp_transition:V=TR:m=CX | pp_transition:V=TR:m=CS silence:+ pp_transition:V=TR:m=SX ;
# phone IWP_MX = pp_transition:V=TR:m=MX | pp_transition:V=TR:m=MS silence:+ pp_transition:V=TR:m=SX ;
# phone IWP_XC = pp_transition:V=TR:m=XC | pp_transition:V=TR:m=XS silence:+ pp_transition:V=TR:m=SM ;
# phone IWP_XM = pp_transition:V=TR:m=XM | pp_transition:V=TR:m=XS silence:+ pp_transition:V=TR:m=SM ;
# phone IWP_XV = pp_transition:V=TR:m=XV | pp_transition:V=TR:m=XS silence:+ pp_transition:V=TR:m=SV ;
phone IWP_XX = pp_transition:v=xTR:m=XX | pp_transition:v=xTR silence:+ pp_transition:v=xTR ;
#
# These are so rare that we lump them with IPP_XX
# phone IPP_CX = pp_transition:V=TR:m=XX ;
# phone IPP_MX = pp_transition:V=TR:m=XX ;
# phone IPP_XC = pp_transition:V=TR:m=XX ;
# phone IPP_XM = pp_transition:V=TR:m=XX ;
# phone IPP_VX = pp_transition:V=TR:m=XX ;
# phone IPP_SX = pp_transition:V=TR:m=SX ;
# phone IPP_XS = pp_transition:V=TR:m=XS ;
# phone IPP_XV = pp_transition:V=TR:m=XV ;
phone IPP_XX = pp_transition:v=xTR:m=XX ;


# Here we have 5 vowels, all sharing the same variance, but each with
# their own mean acoustic properties. 
macro v = 3* v1:+:v=V:m=$s$i | 3* v2:+:v=V:m=$s$i | 3* v3:+:v=V:m=$s$i | 3* v4:+:v=V:m=$s$i |
		3* v5:+:v=V:m=$s$i ;
macro thong1 = 2* v1:+:v=V:m=$s$i | 2* v2:+:v=V:m=$s$i | 2* v3:+:v=V:m=$s$i | 2* v4:+:v=V:m=$s$i |
		2* v5:+:v=V:m=$s$i ;
macro thong2 = 2* v1:+:v=V:m=$s$I | 2* v2:+:v=V:m=$s$I | 2* v3:+:v=V:m=$s$I | 2* v4:+:v=V:m=$s$I |
		2* v5:+:v=V:m=$s$I ;
phone V = v | thong1 thong2 ;

phone X = v | c | generic:+ ;
