Beispiel #1
0
 public MidiManager(int nTrack)
 {
     tempo  = (short)75;
     tracks = new MidiTrackInfo[nTrack];
     for (int i = 0; i < nTrack; ++i)
     {
         tracks[i] = new MidiTrackInfo();
     }
 }
Beispiel #2
0
        public void Write(BinaryWriter bw)
        {
            MidiHeaderInfo      mhi = new MidiHeaderInfo(tempo * 2, (short)tracks.Length);
            MidiTrackHeaderInfo thi = new MidiTrackHeaderInfo();

            mhi.WriteMidiHeader(bw);

            for (int i = 0; i < tracks.Length; ++i)
            {
                MidiTrackInfo p = GetTrack(i);
                thi.WriteTrackHeader(p.CountMidiBytes(), bw);
                p.Write(bw);
                thi.WriteTrackFooter(bw);
            }
        }