Library API
Conversion API
Music Structures
-
enum hkr::NoteBase
The base part of a note name (C, D, E, F, G, A, B).
Values:
-
enumerator c
-
enumerator d
-
enumerator e
-
enumerator f
-
enumerator g
-
enumerator a
-
enumerator b
-
enumerator c
-
enum hkr::IntervalQuality
Different qualities for an interval.
Values:
-
enumerator diminished
-
enumerator minor
-
enumerator perfect
-
enumerator major
-
enumerator augmented
-
enumerator diminished
-
struct Interval
A music interval between two notes.
Public Functions
-
int semitones() const
Count how many semitones are there in the interval.
Public Members
-
int number = 1
Diatonic number.
-
IntervalQuality quality = IntervalQuality::perfect
Interval quality.
-
int semitones() const
-
struct Note
A musical note.
-
struct Chord
A chord containing multiple notes.
Public Members
-
bool sustained = false
Whether this chord is a prolongation of the previous one.
-
Attributes attributes
Attributes of this chord.
-
struct Attributes
Attributes of a chord.
Public Members
-
std::optional<float> tempo
Tempo marking of this chord.
-
std::optional<float> tempo
-
bool sustained = false
-
struct Measure
Information about a measure.
Public Members
-
std::size_t start_beat = 0
Index of the first beat in this measure.
-
Attributes attributes
Attributes of this measure.
-
struct Attributes
Attributes of a measure.
Public Functions
-
void merge_with(const Attributes &other)
Merge another set of measure attributes into this one.
Any non-null attribute in the other attribute set will be overwritten upon this set.
- Parameters
other – The other measure.
-
inline bool is_null() const noexcept
Checks whether this attribute set is completely empty.
-
void merge_with(const Attributes &other)
-
std::size_t start_beat = 0
-
struct Section
A music section, containing multiple staves.
Public Functions
-
std::pair<std::size_t, std::size_t> beat_index_range_of_measure(std::size_t measure) const
Find the starting and ending beat indices of a measure in this section.
- Parameters
measure – Index of the measure.
- Returns
A pair of std::size_t being the starting (inclusive) and ending (exclusive) beats’ indices.
-
std::pair<std::size_t, std::size_t> beat_index_range_of_measure(std::size_t measure) const