MUSX Document Model
Loading...
Searching...
No Matches
musx::dom::TimeSignature::TimeSigComponent Struct Reference

A single time signature component. More...

#include <CommonClasses.h>

Public Member Functions

bool operator== (const TimeSigComponent &src) const
 Test if two TimeSigComponent values are the same.
 
util::Fraction sumCounts () const
 Compute the sum of all counts.
 
Edu sumUnits () const
 Compute the sum of all units.
 
TimeSigComponent normalizeCompound () const
 Returns a copy of this component normalized for compound meter. For example, 2 dotted quarters becomes 6/8.
 

Static Public Member Functions

static std::pair< util::Fraction, EdunormalizeCompoundUnit (util::Fraction count, Edu unit)
 Normalizes a single time signature count and unit to a power-of-two unit.
 

Public Attributes

std::vector< util::Fractioncounts
 
std::vector< Eduunits
 

Detailed Description

A single time signature component.

Member Function Documentation

◆ normalizeCompound()

TimeSignature::TimeSigComponent musx::dom::TimeSignature::TimeSigComponent::normalizeCompound ( ) const

Returns a copy of this component normalized for compound meter. For example, 2 dotted quarters becomes 6/8.

Returns
If this component is unambiguously compound meter, returns a normalized version. Otherwise, returns an exact copy of this component.

◆ normalizeCompoundUnit()

std::pair< util::Fraction, Edu > musx::dom::TimeSignature::TimeSigComponent::normalizeCompoundUnit ( util::Fraction  count,
Edu  unit 
)
static

Normalizes a single time signature count and unit to a power-of-two unit.

Returns
The adjusted count and unit.

Member Data Documentation

◆ counts

std::vector<util::Fraction> musx::dom::TimeSignature::TimeSigComponent::counts

The array of counts in this component. For simple time signatures this is a single value, and it is an integer like 4/1.

◆ units

std::vector<Edu> musx::dom::TimeSignature::TimeSigComponent::units

The array of beat values in this component. For simple time signatures this is a single value, and it is a note value like 1024 (quarter note) For straightforward compound time it may be a single dotted value like 1536 (dotted quarter)