-
Notifications
You must be signed in to change notification settings - Fork 0
IDuration
Chanan edited this page Aug 16, 2020
·
10 revisions
IDuration Interface
Namespace: CW.Soloist.CompositionService.MusicTheory
Assembly: CW.Soloist.CompositionService.dll
Represents a duration of a musical component such as a note or chord.
public interface IDuration
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.
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. |
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. |
© Chanan Welt - Soloist
- Home
- Getting Started
- Design
- Business Logical Layer (CW.Soloist.CompositionService)
- Duration Representation
- IDuration
- Duration
- Duration Representation
- Data Access Layer
- Presentation Layer
- Business Logical Layer (CW.Soloist.CompositionService)