27#include "denigma/classify/noteheads.h"
73using NoteheadValue = std::variant<std::monostate, ArtificialHarmonics>;
85 explicit operator bool() const noexcept
86 {
return !std::holds_alternative<std::monostate>(
value); }
90 const T*
as() const noexcept
91 {
return std::get_if<T>(&
value); }
95 bool is() const noexcept
96 {
return std::holds_alternative<T>(
value); }
EntryNoteheadClassification classifyEntryNoteheads(const musx::dom::EntryInfoPtr &entry)
Classifies chord-level notehead patterns (e.g.
Core public API for the Denigma conversion libraries.
Definition articulations.h:32
Result returned by chord-level notehead-pattern classification.
Definition entries.h:80
bool is() const noexcept
Returns true when the classified payload has type T.
Definition entries.h:95
entry::NoteheadValue value
Classified payload, or std::monostate when no chord-level notehead pattern was recognized.
Definition entries.h:82
const T * as() const noexcept
Returns the classified payload as T, or nullptr when it has another type.
Definition entries.h:90
Result returned by notehead classification.
Definition noteheads.h:66
Classification for one artificial-harmonic note pair (a stopped note plus a touched node) found withi...
Definition entries.h:39
TouchInterval
The notated interval from the stopped note up to the touched node.
Definition entries.h:43
musx::dom::NoteInfoPtr stoppedNote
The stopped (fingered) note. Normally has a notehead::Shape::Regular notehead.
Definition entries.h:50
NoteheadClassification touchedNotehead
Notehead classification already computed for touchedNote.
Definition entries.h:56
musx::dom::NoteInfoPtr soundingNote
A third note in the chord at the theoretical sounding pitch, if the source explicitly includes one.
Definition entries.h:61
NoteheadClassification stoppedNotehead
Notehead classification already computed for stoppedNote.
Definition entries.h:54
TouchInterval interval
Notated interval from stoppedNote to touchedNote.
Definition entries.h:58
musx::dom::NoteInfoPtr touchedNote
The touched note (harmonic node). Normally has a notehead::Shape::Diamond notehead.
Definition entries.h:52
One or more artificial-harmonic note pairs found within a chord (e.g.
Definition entries.h:67
std::vector< ArtificialHarmonic > harmonics
The artificial-harmonic note pairs found in the chord.
Definition entries.h:69