A midi file consists of multiple tracks including a info track for multi-track messages and a track for metronome ticks.
Ejemplo n.º 1
0
        public static MidiFile GenerateMidiFile(Score score, bool generateMetronome = false)
        {
            var midiFile = new MidiFile();
            // create score tracks + metronometrack
            for (int i = 0, j = score.Tracks.Count; i < j; i++)
            {
                midiFile.CreateTrack();
            }
            midiFile.InfoTrack = 0;

            var handler = new MidiFileHandler(midiFile);
            var generator = new MidiFileGenerator(score, handler, generateMetronome);
            generator.Generate();
            return midiFile;
        }
Ejemplo n.º 2
0
 public MidiFileHandler(MidiFile midiFile)
 {
     _midiFile = midiFile;
     _metronomeTrack = -1;
 }