/// <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(); }
/// <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); }
/// <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); }