/// <summary>
 /// Converts the string representation of a musical chord to its <see cref="Chord"/> equivalent.
 /// </summary>
 /// <param name="input">A string containing a chord to convert.</param>
 /// <returns>A <see cref="Chord"/> equivalent to the musical chord contained in <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is <c>null</c> or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static Chord Parse(string input)
 {
     return(ParsingUtilities.Parse <Chord>(input, ChordParser.TryParse));
 }
Пример #2
0
 /// <summary>
 /// Converts the string representation of a MIDI time span to its <see cref="MidiTimeSpan"/>
 /// equivalent.
 /// </summary>
 /// <param name="input">A string containing a time span to convert.</param>
 /// <returns>A <see cref="MidiTimeSpan"/> equivalent to the time span contained in
 /// <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is null or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static MidiTimeSpan Parse(string input)
 {
     return(ParsingUtilities.Parse <MidiTimeSpan>(input, MidiTimeSpanParser.TryParse));
 }
 /// <summary>
 /// Converts the string representation of a musical scale to its <see cref="Scale"/> equivalent.
 /// </summary>
 /// <param name="input">A string containing a scale to convert.</param>
 /// <returns>A <see cref="Scale"/> equivalent to the musical scale contained in <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is <c>null</c> or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static Scale Parse(string input)
 {
     return(ParsingUtilities.Parse <Scale>(input, ScaleParser.TryParse));
 }
Пример #4
0
 /// <summary>
 /// Converts the string representation of a musical note to its <see cref="Note"/> equivalent.
 /// </summary>
 /// <param name="input">A string containing a note to convert.</param>
 /// <returns>A <see cref="Note"/> equivalent to the musical note contained in <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is null or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static Note Parse(string input)
 {
     return(ParsingUtilities.Parse <Note>(input, NoteParser.TryParse));
 }
Пример #5
0
 /// <summary>
 /// Converts the string representation of a musical interval to its <see cref="Scale"/> equivalent.
 /// </summary>
 /// <param name="input">A string containing an interval to convert.</param>
 /// <returns>A <see cref="Scale"/> equivalent to the musical interval contained in <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is null or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static Interval Parse(string input)
 {
     return(ParsingUtilities.Parse <Interval>(input, IntervalParser.TryParse));
 }
Пример #6
0
 /// <summary>
 /// Converts the string representation of a bar/beat time span to its <see cref="BarBeatFractionTimeSpan"/>
 /// equivalent.
 /// </summary>
 /// <param name="input">A string containing a time span to convert.</param>
 /// <returns>A <see cref="BarBeatFractionTimeSpan"/> equivalent to the time span contained in
 /// <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is null or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static BarBeatFractionTimeSpan Parse(string input)
 {
     return(ParsingUtilities.Parse <BarBeatFractionTimeSpan>(input, BarBeatFractionTimeSpanParser.TryParse));
 }
 /// <summary>
 /// Converts the string representation of a musical octave to its <see cref="Octave"/> equivalent.
 /// </summary>
 /// <param name="input">A string containing an octave to convert.</param>
 /// <returns>A <see cref="Octave"/> equivalent to the musical note contained in <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is <c>null</c> or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static Octave Parse(string input)
 {
     return(ParsingUtilities.Parse <Octave>(input, OctaveParser.TryParse));
 }
Пример #8
0
 /// <summary>
 /// Converts the string representation of a chord progression to its <see cref="ChordProgression"/> equivalent.
 /// </summary>
 /// <param name="input">A string containing a chord progression to convert.</param>
 /// <param name="scale">Scale to resolve chords.</param>
 /// <returns>A <see cref="ChordProgression"/> equivalent to the chord progression contained in
 /// <paramref name="input"/>.</returns>
 /// <exception cref="ArgumentException"><paramref name="input"/> is <c>null</c> or contains white-spaces only.</exception>
 /// <exception cref="FormatException"><paramref name="input"/> has invalid format.</exception>
 public static ChordProgression Parse(string input, Scale scale)
 {
     return(ParsingUtilities.Parse(input, GetParsing(input, scale)));
 }