Skip to content

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

Summary

Constructs a Duration instance based on the given numerator and denominator parameter values.

Source Code

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;
    }
}

Parameters

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.
  • Home
  • Getting Started
  • Design
    • Business Logical Layer (CW.Soloist.CompositionService)
    • Data Access Layer
    • Presentation Layer
Clone this wiki locally