Ejemplo n.º 1
0
Archivo: Song.cs Proyecto: xj0229/gsf
 /// <summary>
 /// Add a rest for the given length for the current beat.
 /// </summary>
 /// <param name="restLength">Duration of wait specified as a note value.</param>
 /// <param name="dots">Total dotted note length extensions to apply.</param>
 public void AddRest(NoteValueBritish restLength, int dots)
 {
     AddNotes(new Note
     {
         NamedValueBritish = restLength, Dots = dots
     });
 }
Ejemplo n.º 2
0
Archivo: Song.cs Proyecto: xj0229/gsf
 /// <summary>
 /// Add a rest for the given length for the current beat.
 /// </summary>
 /// <param name="restLength">Duration of wait specified as a note value.</param>
 public void AddRest(NoteValueBritish restLength)
 {
     AddNotes(new Note
     {
         NamedValueBritish = restLength
     });
 }
Ejemplo n.º 3
0
Archivo: Song.cs Proyecto: rmc00/gsf
 /// <summary>
 /// Add a rest for the given length for the current beat.
 /// </summary>
 /// <param name="restLength">Duration of wait specified as a note value.</param>
 /// <param name="dots">Total dotted note length extensions to apply.</param>
 public void AddRest(NoteValueBritish restLength, int dots)
 {
     AddNotes(new Note
     {
         NamedValueBritish = restLength, Dots = dots
     });
 }
Ejemplo n.º 4
0
Archivo: Song.cs Proyecto: rmc00/gsf
 /// <summary>
 /// Add a rest for the given length for the current beat.
 /// </summary>
 /// <param name="restLength">Duration of wait specified as a note value.</param>
 public void AddRest(NoteValueBritish restLength)
 {
     AddNotes(new Note
     {
         NamedValueBritish = restLength
     });
 }
Ejemplo n.º 5
0
Archivo: Tempo.cs Proyecto: avs009/gsf
 /// <summary>
 /// Calculates the actual time duration, in seconds, for the given tempo that the specified
 /// source note value will last. For example, if tempo is M.M. 120 crotchets per minute,
 /// then each crotchet would last a half-second.
 /// </summary>
 /// <param name="source">Source note value.</param>
 /// <param name="dots">Total dotted note length extensions to apply.</param>
 /// <returns>Actual duration of note value in seconds.</returns>
 public double CalculateNoteValueTime(NoteValueBritish source, int dots)
 {
     return m_noteValueTime * source.Duration(this.NamedNoteValueBritish, dots);
 }
Ejemplo n.º 6
0
Archivo: Tempo.cs Proyecto: avs009/gsf
 /// <summary>
 /// Contructs a new <see cref="Tempo"/> object.
 /// </summary>
 /// <param name="totalNoteValues">A <see cref="System.Int32"/> indicating the total note values.</param>
 /// <param name="noteValue">Named note value used for <see cref="Tempo"/>.</param>
 public Tempo(int totalNoteValues, NoteValueBritish noteValue)
 {
     m_totalNoteValues = totalNoteValues;
     m_noteValue = noteValue.Duration();
     CalculateNoteValueTime();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Validates that given note value will fit within this <see cref="MeasureSize"/> for specified beat.
 /// </summary>
 /// <param name="noteValue">Named note value to validate.</param>
 /// <param name="beat">Beat within in measure where note value is trying to fit.</param>
 /// <param name="dots">Dot length extensions to apply to named note value.</param>
 public void ValidateNoteValueAtBeat(NoteValueBritish noteValue, int beat, int dots)
 {
     ValidateNoteValueAtBeat(noteValue.Duration(dots), beat);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new musical measure defined as the number of beats per note value.
 /// </summary>
 /// <param name="beats">A <see cref="Int32"/> representing the beats.</param>
 /// <param name="noteValue">A <see cref="NoteValueBritish"/> representing the note value.</param>
 public MeasureSize(int beats, NoteValueBritish noteValue)
 {
     m_beats     = beats;
     m_noteValue = noteValue.Duration();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Calculates the actual time duration, in seconds, for the given tempo that the specified
 /// source note value will last. For example, if tempo is M.M. 120 crotchets per minute,
 /// then each crotchet would last a half-second.
 /// </summary>
 /// <param name="source">Source note value.</param>
 /// <param name="dots">Total dotted note length extensions to apply.</param>
 /// <returns>Actual duration of note value in seconds.</returns>
 public double CalculateNoteValueTime(NoteValueBritish source, int dots)
 {
     return(m_noteValueTime * source.Duration(this.NamedNoteValueBritish, dots));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Contructs a new <see cref="Tempo"/> object.
 /// </summary>
 /// <param name="totalNoteValues">A <see cref="System.Int32"/> indicating the total note values.</param>
 /// <param name="noteValue">Named note value used for <see cref="Tempo"/>.</param>
 public Tempo(int totalNoteValues, NoteValueBritish noteValue)
 {
     m_totalNoteValues = totalNoteValues;
     m_noteValue       = noteValue.Duration();
     CalculateNoteValueTime();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Creates a new musical measure defined as the number of beats per note value.
 /// </summary>
 public MeasureSize(int beats, NoteValueBritish noteValue)
 {
     m_beats = beats;
     m_noteValue = noteValue.Duration();
 }
Ejemplo n.º 12
0
 public void ValidateNoteValueAtBeat(NoteValueBritish noteValue, int beat, int dots)
 {
     ValidateNoteValueAtBeat(noteValue.Duration(dots), beat);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Returns source note value duration in terms of given reference note value.
 /// For example, if measure size is 3/4 then reference is quarter notes and returned
 /// value will be equivalent number of quarter notes for given source note.
 /// </summary>
 /// <param name="source">Source note value.</param>
 /// <param name="reference">Reference note value.</param>
 /// <param name="dots">Total dotted note length extensions to apply.</param>
 /// <returns>Duration of note value in terms of specified reference note value.</returns>
 public static double Duration(this NoteValueBritish source, NoteValueBritish reference, int dots)
 {
     return(Duration((int)source, (int)reference, dots));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Returns source note value duration.  For example, 0.25 will be returned for
 /// a crotchet note, 1.0 will be returned for a semibreve note, etc.
 /// </summary>
 /// <param name="source">Source note value.</param>
 /// <returns>Duration of note value.</returns>
 public static double Duration(this NoteValueBritish source)
 {
     return(Duration((int)source, 0));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Returns source note value duration in terms of given reference note value.
 /// For example, if measure size is 3/4 then reference is quarter notes and returned
 /// value will be equivalent number of quarter notes for given source note.
 /// </summary>
 /// <param name="source">Source note value.</param>
 /// <param name="reference">Reference note value.</param>
 /// <param name="dots">Total dotted note length extensions to apply.</param>
 /// <returns>Duration of note value in terms of specified reference note value.</returns>
 public static double Duration(this NoteValueBritish source, NoteValueBritish reference, int dots)
 {
     return Duration((int)source, (int)reference, dots);
 }