Example #1
0
mm_model *mm_new (char *model_name, int model_column)
{
  mm_model *mm = malloc (sizeof (mm_model));

  mm->model_name = malloc (strlen (model_name) + 1);
  strcpy (mm->model_name, model_name);

  mm->inputstates = 0;
  mm->outputstates = 0;
  mm->normalised_flag = 0;

  mm->model_column = model_column;

  /* read in model parameters */

  model_parameters *p = parameters_read (model_name);

  if (model_column == 0)
    {
      mm->inputstates = p->hiddenstates;
      mm->outputstates = p->hiddenstates;
    }
  else if (model_column == 1)
    {
      mm->inputstates = p->visiblestates;
      mm->outputstates = p->visiblestates;
    }
  else
    {
      mm->inputstates = p->visiblestates;
      mm->outputstates = p->hiddenstates;
    }

  parameters_free (p);

  mm->p_initial = 0;
  mm->logp_initial = 0;
  mm->p_transition = 0;
  mm->logp_transition = 0;

  return mm;
}
Example #2
0
File: main.c Project: EQ4/waonc
int
main (int argc, char * argv [])
{
   wbool_t parse_good = wtrue;
   waon_parameters_t waon_parameters;
   analysis_scratchpad_t analysis_scratchpad;
   wbool_t result = parameters_initialize(&waon_parameters);
   if (result)
      result = parameters_parse(&waon_parameters, argc, argv);

   if (result)
      result = analysis_scratchpad_initialize(&analysis_scratchpad);

   if (result)
   {
       analysis_scratchpad.absolute_cutoff = waon_parameters.abs_flg;
       if (not_nullptr(waon_parameters.file_patch))
          analysis_scratchpad.use_patchfile = wtrue;

       /* NEW as of 12-01 */

       g_midi_pitch_info.mp_adj_pitch = waon_parameters.adj_pitch;
   }
   if (waon_parameters.show_help)
   {
      print_usage();
      parse_good = wfalse;
   }
   else if (waon_parameters.show_version)
   {
      print_version();
      parse_good = wfalse;
   }
   if (result && parse_good)
   {
      parse_good = processing(&waon_parameters, &analysis_scratchpad);
      parameters_free(&waon_parameters);
   }
   return parse_good ? 0 : 1 ;
}