#!/usr/bin/python
# make a prototype hmm the same way brian does
# had been copying one from htkD, not sure if that was right

import os

samplesize=39
featuretype="MFCC_0_D_A"
os.system('mkdir -p hmm0')
outf = open('hmm0/proto','w')

print >> outf, "~o <vecSize> %d <%s>" % (samplesize,featuretype)
print >> outf, '~h "proto"'
print >> outf, "<BEGINHMM>"
print >> outf, " <NUMSTATES> 5"

means = []
vars = []
for i in range(samplesize):
    means.append(str(0.0))
    vars.append(str(1.0))
for index in range(2,5):
   print >> outf, " <STATE> %d" % index
   print >> outf, "  <MEAN> %d" % samplesize
   print >> outf, ' '.join(means)
   print >> outf, "  <VARIANCE> %d" % samplesize
   print >> outf, ' '.join(vars)

print >> outf,  " <TRANSP> 5"
print >> outf,   "  0.0 1.0 0.0 0.0 0.0"
print >> outf,   "  0.0 0.6 0.4 0.0 0.0"
print >> outf,   "  0.0 0.0 0.6 0.4 0.0"
print >> outf,   "  0.0 0.0 0.0 0.7 0.3"
print >> outf,   "  0.0 0.0 0.0 0.0 0.0"
print >> outf,   "<ENDHMM>"
outf.close();

