|
maiacore 1.10.1
Music analisys library
|
Represents the duration of a musical note, supporting multiple temporal representations. More...
#include <duration.h>
Public Member Functions | |
| Duration (float quarterDuration, int divisionsPerQuarterNote=256) | |
| Constructs a Duration from a quarter note value. More... | |
| Duration (int ticks, int divisionsPerQuarterNote=256, int actualNotes=1, int normalNotes=1) | |
| Constructs a Duration from ticks, with optional tuplet information. More... | |
| void | setQuarterDuration (float quarterDuration, int divisionsPerQuarterNote=256) |
| Sets the duration using a quarter note value. More... | |
| RhythmFigure | getRhythmFigure () const |
| Returns the rhythm figure (e.g., QUARTER, EIGHTH) for this duration. More... | |
| const std::string | getNoteType () const |
| Returns the MusicXML note type string for this duration (e.g., "quarter", "eighth"). More... | |
| int | getDots () const |
| Returns the number of dots (augmentation dots) for this duration. More... | |
| int | getTicks () const |
| Returns the duration in ticks. More... | |
| int | getDivisionsPerQuarterNote () const |
| Returns the number of ticks per quarter note. More... | |
| const Fraction & | getFractionDuration () const |
| Returns the duration as a Fraction object. More... | |
| std::string | getFractionDurationAsString () const |
| Returns the duration as a string in fractional notation (e.g., "1/4"). More... | |
| float | getQuarterDuration () const |
| Returns the duration in quarter notes as a float. More... | |
| bool | isTuplet () const |
| Returns true if the duration represents a tuplet (e.g., triplet, quintuplet). More... | |
| void | setTupleValues (const int actualNotes, const int normalNotes, const std::string &normalType) |
| Sets the tuplet values for the duration. More... | |
| int | getTimeModificationActualNotes () const |
| Returns the tuplet numerator (actual notes). More... | |
| int | getTimeModificationNormalNotes () const |
| Returns the tuplet denominator (normal notes). More... | |
| std::string | getTimeModificationNormalType () const |
| Returns the note type string for the tuplet's normal notes. More... | |
Represents the duration of a musical note, supporting multiple temporal representations.
The Duration class provides methods for converting between quarter note values, ticks, rhythm figures, tuplets, and fractional durations. It is designed for music analysis, computational musicology, and MusicXML processing, allowing precise control over note durations in various formats.
| Duration::Duration | ( | float | quarterDuration, |
| int | divisionsPerQuarterNote = 256 |
||
| ) |
| Duration::Duration | ( | int | ticks, |
| int | divisionsPerQuarterNote = 256, |
||
| int | actualNotes = 1, |
||
| int | normalNotes = 1 |
||
| ) |
| int Duration::getDivisionsPerQuarterNote | ( | ) | const |
Returns the number of ticks per quarter note.
| int Duration::getDots | ( | ) | const |
Returns the number of dots (augmentation dots) for this duration.
| const Fraction & Duration::getFractionDuration | ( | ) | const |
Returns the duration as a Fraction object.
| std::string Duration::getFractionDurationAsString | ( | ) | const |
Returns the duration as a string in fractional notation (e.g., "1/4").
| const std::string Duration::getNoteType | ( | ) | const |
Returns the MusicXML note type string for this duration (e.g., "quarter", "eighth").
| float Duration::getQuarterDuration | ( | ) | const |
Returns the duration in quarter notes as a float.
| RhythmFigure Duration::getRhythmFigure | ( | ) | const |
Returns the rhythm figure (e.g., QUARTER, EIGHTH) for this duration.
| int Duration::getTicks | ( | ) | const |
Returns the duration in ticks.
| int Duration::getTimeModificationActualNotes | ( | ) | const |
Returns the tuplet numerator (actual notes).
| int Duration::getTimeModificationNormalNotes | ( | ) | const |
Returns the tuplet denominator (normal notes).
| std::string Duration::getTimeModificationNormalType | ( | ) | const |
Returns the note type string for the tuplet's normal notes.
| bool Duration::isTuplet | ( | ) | const |
Returns true if the duration represents a tuplet (e.g., triplet, quintuplet).
| void Duration::setQuarterDuration | ( | float | quarterDuration, |
| int | divisionsPerQuarterNote = 256 |
||
| ) |
Sets the duration using a quarter note value.
| quarterDuration | Duration in quarter notes. |
| divisionsPerQuarterNote | Number of ticks per quarter note (default: 256). |
| void Duration::setTupleValues | ( | const int | actualNotes, |
| const int | normalNotes, | ||
| const std::string & | normalType | ||
| ) |
Sets the tuplet values for the duration.
| actualNotes | Tuplet numerator (number of notes played). |
| normalNotes | Tuplet denominator (number of notes expected). |
| normalType | Note type for the tuplet (e.g., "eighth"). |