Static functions for the musical meter

Implements

Constructors

  • Creates a new meter

    Parameters

    • timeSignature: null | ITimeSignature

      The time signature

    • beatsPerMinute: null | number

      The tempo in beats per minute

    • originTime: null | number

      The temporal position of the origin of the beat (time of first beat) in the track in [seconds]

    Returns Meter

Properties

BeatsPerMinute: null | number

The tempo in beats per minute

OriginTime: null | number

The origin time for the beat (first downbeat of the first measure)

TimeSignature: null | ITimeSignature

The time signature

TemporalEpsilon: number = 0.001

The smallest amount of time that is resolved within Replayer's percision

Methods

  • Creates a new meter with only the given origin time

    Parameters

    • originTime: null | number

    Returns IMeter

    Remarks

    Other properties are left null. This is useful to create an initial instance when only the origin time is yet available.

  • Converts a temporal duration (in seconds) into a decimal beat count if a suitable input value is provided.

    Parameters

    • duration: undefined | null | number

      The temporal duration in [seconds]

    • meter: IMeter

      The meter to use for the conversion

    Returns null | number

    The decimal beat count or null

  • Converts a temporal position (in total seconds within a track) into a metrical position if a suitable input value is provided.

    Parameters

    • time: undefined | null | number

      The temporal position in [seconds]

    • meter: IMeter

      The meter to use for the conversion

    Returns null | MetricalPosition

    The metrical position or null

  • Determines whether all properties are set to valid data

    Parameters

    • meter: undefined | null | IMeter

    Returns boolean

  • Converts a the duration of a single measure into a temporal duration. if a suitable input value is provided.

    Parameters

    • meter: IMeter

      The musical meter

    Returns null | number

    The measure duration in seconds or null

  • Converts a temporal position into a displayable measure/beats count format, according to the meter, if a suitable input value is provided.

    Parameters

    • time: undefined | null | number

      The temporal position in [seconds]

    • meter: IMeter

      The meter to use for the conversion

    Returns string

    The measure/beats representation or a placeholder.

  • Converts a temporal duration into a displayable multimeasure rest format, according to the meter, if a suitable input value is provided.

    Parameters

    • duration: undefined | null | number

      The temporal duration in [seconds]

    • meter: IMeter

      The meter to use for the conversion

    Returns string

    The multimeasure rest representation or a placeholder.

    Remarks

    This is intended to be used to denote durations instead of positions (as with toMeasureDisplay)

  • Converts a metrical position into a temporal position (within a track), if a suitable input value is provided.

    Parameters

    • metricalPosition: null | MetricalPosition

      The metrical position to convert from

    • meter: IMeter

      The musical meter

    Returns null | number

    The temporal position in seconds or null