27#include "denigma/classify/classifier_common.h"
28#include "denigma/classify/general_lines.h"
29#include "denigma/classify/keyboard_pedals.h"
31#include "musx/util/Arpeggio.h"
59 std::optional<GeneralLine>
line;
90 musx::dom::CurveContourDirection
contour{ musx::dom::CurveContourDirection::Unspecified };
100 musx::dom::CurveContourDirection
contour{ musx::dom::CurveContourDirection::Unspecified };
135 std::optional<KeyboardPedalClassification>
endText;
153 bool includesTrSymbol{};
154 std::optional<GeneralLine>
line;
191 musx::dom::others::SmartShape::ShapeType shapeType{};
197 template <
typename T>
198 const T*
as() const noexcept
199 {
return std::get_if<T>(&value); }
208 const musx::dom::MusxInstance<musx::dom::others::SmartShape>& shape);
218 const musx::dom::MusxInstance<musx::dom::others::SmartShapeCustomLine>& customLine);
std::variant< std::monostate, smartshape::Ottava, smartshape::Crescendo, smartshape::Decrescendo, smartshape::Slur, smartshape::ArpeggiatedTie, PseudoTie, smartshape::NonArpeggio, smartshape::KeyboardPedal, smartshape::TrillLine, smartshape::VibratoLine, smartshape::GeneralLine > SmartShapeValue
The semantic payload of a classified smart shape.
Definition smartshapes.h:183
std::optional< smartshape::KeyboardPedal > classifyKeyboardPedalCustomLine(const musx::dom::MusxInstance< musx::dom::others::SmartShapeCustomLine > &customLine)
Classifies a custom line style as keyboard pedaling.
SmartShapeClassification classifySmartShape(const musx::dom::MusxInstance< musx::dom::others::SmartShape > &shape)
Classifies a smart shape's meaning.
Core public API for the Denigma conversion libraries.
Definition articulations.h:32
A source shape used as a stand-in for a laissez-vibrer tie or tie end.
Definition classifier_common.h:49
Result returned by smart-shape classification.
Definition smartshapes.h:188
const T * as() const noexcept
Returns the payload when the shape classified as the requested type, otherwise null.
Definition smartshapes.h:198
A slur used to tie one note of a rolled chord to a note in a following chord.
Definition smartshapes.h:96
musx::dom::NoteInfoPtr tiedFrom
The note the tie starts from.
Definition smartshapes.h:97
musx::dom::NoteInfoPtr tiedTo
The note the tie ends on.
Definition smartshapes.h:98
musx::dom::CurveContourDirection contour
The tie's resolved curvature direction.
Definition smartshapes.h:100
A crescendo hairpin.
Definition smartshapes.h:71
A decrescendo hairpin.
Definition smartshapes.h:77
Describes the appearance of a line-type smart shape in musxdom terms.
Definition general_lines.h:66
A custom line that notates keyboard pedaling.
Definition smartshapes.h:117
bool isSustainPedal() const noexcept
Returns whether any text position identifies the sustain pedal.
bool isSostPedal() const noexcept
Returns whether any text position identifies the sostenuto pedal.
bool isUnaCorda() const noexcept
Returns whether any text position identifies the una-corda (soft) pedal.
CapType endCap
Pedal meaning of the cap at the end of the line.
Definition smartshapes.h:137
GeneralLine line
Appearance of the pedal line.
Definition smartshapes.h:129
CapType startCap
Pedal meaning of the cap at the start of the line.
Definition smartshapes.h:136
std::optional< KeyboardPedalClassification > startText
The marking in the line's left-start text, when it names one.
Definition smartshapes.h:131
std::optional< KeyboardPedalClassification > continuationText
The marking in the line's left-continuation text, when it names one.
Definition smartshapes.h:133
std::optional< KeyboardPedalClassification > endText
The marking in the line's right-end text, when it names one.
Definition smartshapes.h:135
CapType
The pedal semantic of a line cap.
Definition smartshapes.h:121
@ PedalUp
The cap releases the pedal.
@ PedalDown
The cap engages the pedal.
@ None
No cap, or a cap with no pedal meaning.
@ Hook
A plain hook, which brackets the pedaled music without naming a pedal action.
@ PedalChange
The cap releases and immediately re-engages the pedal.
A bracket spanning notes that are explicitly not to be rolled.
Definition smartshapes.h:106
musx::util::ArpeggioSpanCandidate candidate
The notes the bracket spans, as resolved by musxdom.
Definition smartshapes.h:108
An octave-displacement span, from either a built-in ottava shape or a custom line.
Definition smartshapes.h:45
int octaveShift
Octaves the written pitches are displaced: negative sounds below written pitch.
Definition smartshapes.h:47
bool hasVisualProxy
True when this shape is a hidden built-in ottava that is rendered by a visible custom line.
Definition smartshapes.h:56
musx::dom::MusxInstance< musx::dom::others::SmartShape > hiddenCounterpart
When this shape is a custom line whose octave semantics are carried by a hidden built-in ottava cover...
Definition smartshapes.h:52
std::optional< GeneralLine > line
Appearance, when this shape is a custom line. (Empty for built-in ottavas.)
Definition smartshapes.h:59
bool calcIsSemanticCarrier() const noexcept
True when this shape carries the octave-displacement semantics.
Definition smartshapes.h:64
A slur between two entries.
Definition smartshapes.h:83
musx::dom::EntryInfoPtr startEntry
The entry at the slur's start, or null when the endpoint coincides with no entry.
Definition smartshapes.h:85
musx::dom::EntryInfoPtr endEntry
The entry at the slur's end, or null when the endpoint coincides with no entry.
Definition smartshapes.h:88
musx::dom::CurveContourDirection contour
The slur's resolved curvature direction.
Definition smartshapes.h:90
A trill, with or without an extension line.
Definition smartshapes.h:152
std::optional< GeneralLine > line
Appearance, when the source is a custom line. (Empty for built-in trills.)
Definition smartshapes.h:154
A vibrato (wavy) line.
Definition smartshapes.h:160
GeneralLine line
Appearance of the vibrato line. (Always a custom line.)
Definition smartshapes.h:161