-
Notifications
You must be signed in to change notification settings - Fork 0
Duration(byte,byte,bool)
Chanan edited this page Aug 15, 2020
·
5 revisions
Duration(byte,byte,bool) Constructor
Namespace: CW.Soloist.CompositionService.MusicTheory
Assembly: CW.Soloist.CompositionService.dll
Constructs a Duration instance based on the given numerator and denominator parameter values.
public Duration(byte numerator = 1, byte denominator = 4, bool reduceToLowestTerms = true)
{
if (reduceToLowestTerms)
{
byte gcd = (byte)GreatestCommonDivisor(numerator, denominator);
Numerator = (byte)(numerator / gcd);
Denominator = (byte)(denominator / gcd);
}
else
{
Numerator = numerator;
Denominator = denominator;
}
}
Name | Type | Description |
---|---|---|
numerator | byte | The numerator of the duration. |
denominator | byte | The denominator of the duration. |
reduceToLowestTerms | bool | Determines whether to reduce the numerator and denominator do their lowest terms. |
© 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)