/// <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 quarter-notes per minute, /// then each quarter-note 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(NoteValue source, int dots) { return m_noteValueTime * source.Duration(this.NamedNoteValue, dots); }
/// <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(NoteValue noteValue, int beat, int dots) { ValidateNoteValueAtBeat(noteValue.Duration(dots), beat); }
/// <summary> /// Contructs a new <see cref="Tempo"/> object. /// </summary> /// <param name="totalNoteValues">Total note values for <see cref="Tempo"/>.</param> /// <param name="noteValue">Named note value used for <see cref="Tempo"/>.</param> public Tempo(int totalNoteValues, NoteValue noteValue) { m_totalNoteValues = totalNoteValues; m_noteValue = noteValue.Duration(); CalculateNoteValueTime(); }
/// <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="NoteValue"/> representing the note value.</param> public MeasureSize(int beats, NoteValue noteValue) { m_beats = beats; m_noteValue = noteValue.Duration(); }
/// <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 quarter-notes per minute, /// then each quarter-note 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(NoteValue source, int dots) { return(m_noteValueTime * source.Duration(this.NamedNoteValue, dots)); }
/// <summary> /// Creates a new musical measure defined as the number of beats per note value. /// </summary> public MeasureSize(int beats, NoteValue noteValue) { m_beats = beats; m_noteValue = noteValue.Duration(); }
public void ValidateNoteValueAtBeat(NoteValue noteValue, int beat, int dots) { ValidateNoteValueAtBeat(noteValue.Duration(dots), beat); }