Search Results for

    Show / Hide Table of Contents

    Class DoubleToMusicalTimeSpanSettings

    Settings which control the process of conversion a double number to an instance of the MusicalTimeSpan.
    Inheritance
    object
    DoubleToMusicalTimeSpanSettings
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Interaction
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class DoubleToMusicalTimeSpanSettings

    Fields

    DefaultFractionalPartEpsilon

    Represents the default maximum fractional part value to consider a number as integer during the rationalization process (see FractionalPartEpsilon).
    Declaration
    public const double DefaultFractionalPartEpsilon = 1E-07
    Field Value
    Type Description
    double

    DefaultMaxIterationsCount

    Represents the default maximum count of iterations the rationalization process should take before stop (see MaxIterationsCount).
    Declaration
    public const int DefaultMaxIterationsCount = 20
    Field Value
    Type Description
    int

    DefaultPrecision

    Represents the default maximum difference between an input double number and the calculated MusicalTimeSpan (see Precision).
    Declaration
    public const double DefaultPrecision = 1E-05
    Field Value
    Type Description
    double

    Properties

    FractionalPartEpsilon

    Gets or sets a maximum fractional part value to consider a number as integer during the rationalization process. For example, 1.001 will be considered as just 1.0 if FractionalPartEpsilon is 0.001 or greater.
    Declaration
    public double FractionalPartEpsilon { get; set; }
    Property Value
    Type Description
    double
    Exceptions
    Type Condition
    ArgumentOutOfRangeException The value is zero or negative.

    MaxIterationsCount

    Gets or sets the maximum count of iterations the rationalization process should take before stop. The default value is 20.
    Declaration
    public int MaxIterationsCount { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    ArgumentOutOfRangeException The value is zero or negative.

    Precision

    Gets or sets the maximum difference between an input double number and the calculated MusicalTimeSpan. For example, 3/2 will be returned as the result for the input number of 1.5001 if Precision is 0.0001 or greater.
    Declaration
    public double Precision { get; set; }
    Property Value
    Type Description
    double
    Exceptions
    Type Condition
    ArgumentOutOfRangeException The value is zero or negative.

    See Also

    FromDouble(double, DoubleToMusicalTimeSpanSettings)
    In this article
    Back to top 2024 / Generated by DocFX