Skip to content

IDuration

Chanan edited this page Aug 16, 2020 · 10 revisions

IDuration Interface

Namespace: CW.Soloist.CompositionService.MusicTheory
Assembly: CW.Soloist.CompositionService.dll


Summary

Represents a duration of a musical component such as a note or chord.

Defintion

public interface IDuration

Remarks

Each duration is assembled of two properties:
Numerator, which represents the number of beats in the duration,
and Denominator, which represents the duration of a single beat, in relation to whole note duration.
For example, a chord which is played over half a bar, would have a duration of 1/2.

Duration of notes and chords are calculated as the quotient of the nominator divided by the denominator,
so for example, a duration instance of 2/4 is equivalent to 1/2.


Properties

Property Name Type Description
Numerator byte Number of beats in the duration.
Denominator byte Length of the beat in relation to a whole note duration.
Fraction float Quotient of the division of the duration's numerator by the duration's denominator.

Methods

Method Name Return Type Description
Add IDuration Adds the given duration to this duration, and returns the sum.
Subtract IDuration Subtracts the given duration from this duration, and returns the difference.
IsDenominatorPowerOfTwo bool Determines whether this duration's denominator is a power of two or not.
  • Home
  • Getting Started
  • Design
    • Business Logical Layer (CW.Soloist.CompositionService)
    • Data Access Layer
    • Presentation Layer
Clone this wiki locally