Пример #1
0
        /// <summary>
        /// Create a sequence from an MIDI.
        /// </summary>
        /// <param name="filePath">The MIDI path.</param>
        /// <param name="timeBase">Time base.</param>
        public void FromMIDI(string filePath, int timeBase = 48, bool privateLabelsForCalls = false)
        {
            Sanford.Multimedia.Midi.Sequence s = new Sanford.Multimedia.Midi.Sequence(filePath);
            Dictionary <string, int>         pub;
            List <int> priv;

            Commands     = SMF.ToSequenceCommands(s, out pub, out priv, Path.GetFileNameWithoutExtension(filePath), timeBase);
            PublicLabels = pub;
            OtherLabels  = priv;
            WriteCommandData();
        }
Пример #2
0
 /// <summary>
 /// Convert the file to an MIDI.
 /// </summary>
 /// <param name="filePath">Path to save the MIDI.</param>
 public void SaveMIDI(string filePath)
 {
     ReadCommandData();
     Sanford.Multimedia.Midi.Sequence s = SMF.FromSequenceCommands(Commands, 0);
     s.Save(filePath);
 }
Пример #3
0
 /// <summary>
 /// Convert the file to an MIDI.
 /// </summary>
 /// <param name="filePath">Path to save the MIDI.</param>
 /// <param name="trackMask">Track mask.</param>
 public void SaveMIDI(string filePath, ushort trackMask = 0xFFFF)
 {
     ReadCommandData();
     Sanford.Multimedia.Midi.Sequence s = SMF.FromSequenceCommands(Commands, 0, trackMask);
     s.Save(filePath);
 }