5#include "maiacore/constants.h"
6#include "maiacore/fraction.h"
22 Duration(
float quarterDuration,
int divisionsPerQuarterNote = 256);
31 Duration(
int ticks,
int divisionsPerQuarterNote = 256,
int actualNotes = 1,
102 const std::string& normalType);
125 float _quarterDuration;
126 int _divisionsPerQuarterNote;
129 RhythmFigure _rhythmFigure;
130 Fraction _fractionDuration;
Represents the duration of a musical note, supporting multiple temporal representations.
Definition: duration.h:15
std::string getFractionDurationAsString() const
Returns the duration as a string in fractional notation (e.g., "1/4").
int getTimeModificationActualNotes() const
Returns the tuplet numerator (actual notes).
void setTupleValues(const int actualNotes, const int normalNotes, const std::string &normalType)
Sets the tuplet values for the duration.
const std::string getNoteType() const
Returns the MusicXML note type string for this duration (e.g., "quarter", "eighth").
int getDots() const
Returns the number of dots (augmentation dots) for this duration.
Duration(int ticks, int divisionsPerQuarterNote=256, int actualNotes=1, int normalNotes=1)
Constructs a Duration from ticks, with optional tuplet information.
int getTimeModificationNormalNotes() const
Returns the tuplet denominator (normal notes).
std::string getTimeModificationNormalType() const
Returns the note type string for the tuplet's normal notes.
void setQuarterDuration(float quarterDuration, int divisionsPerQuarterNote=256)
Sets the duration using a quarter note value.
const Fraction & getFractionDuration() const
Returns the duration as a Fraction object.
int getDivisionsPerQuarterNote() const
Returns the number of ticks per quarter note.
float getQuarterDuration() const
Returns the duration in quarter notes as a float.
Duration(float quarterDuration, int divisionsPerQuarterNote=256)
Constructs a Duration from a quarter note value.
RhythmFigure getRhythmFigure() const
Returns the rhythm figure (e.g., QUARTER, EIGHTH) for this duration.
int getTicks() const
Returns the duration in ticks.
bool isTuplet() const
Returns true if the duration represents a tuplet (e.g., triplet, quintuplet).