#include <stdio.h>
#include <ctype.h>
#include "midifile.h"


FILE *F;
extern long Mf_currtime;

mygetc ()
{
  return (getc (F));
}

mynoteon (int chan, int note, int velocity)
{
  printf ("On: %ld: chan=%d, note=%d, velocity=%d\n", Mf_currtime, chan, note, velocity);
}

mynoteoff (int chan, int note, int velocity)
{
  printf ("Off: %ld: chan=%d, note=%d, velocity=%d\n", Mf_currtime, chan, note, velocity);
}


main (argc, argv)
     char **argv;
{


  if (argc > 1)
    F = fopen (argv[1], "r");
  else
    F = stdin;

  Mf_getc = mygetc;
  Mf_noteon = mynoteon;
  Mf_noteoff = mynoteoff;

  midifile ();

  exit (0);
}
