33#include "denigma/classify/articulations.h"
34#include "denigma/classify/dynamics.h"
35#include "denigma/classify/classifier_common.h"
36#include "denigma/classify/keyboard_pedals.h"
146 musx::dom::NoteType
noteType{ musx::dom::NoteType::Quarter };
271 dynamics::Change
change{ dynamics::Change::Absolute };
291using RunValue = std::variant<
309 template <
typename T>
310 const T*
as() const noexcept
311 {
return std::get_if<T>(&
value); }
333 std::optional<musx::util::EnigmaParsingContext>
enigmaCtx;
337 std::vector<expression::RunClassification>
runs;
342 template <
typename T>
343 const T*
as() const noexcept
344 {
return std::get_if<T>(&
value); }
347 template <
typename T, ExpressionType EnumVal>
348 const T& checkedPayload(
const char* enumDesc)
const
350 assert(
type == EnumVal);
351 if (
type != EnumVal) {
352 throw std::logic_error(std::string(
"ExpressionClassification type is not ") + enumDesc +
".");
354 return std::get<T>(
value);
362 {
return checkedPayload<dynamics::Mark, ExpressionType::Dynamic>(
"Dynamic"); }
367 {
return checkedPayload<expression::Fermata, ExpressionType::Fermata>(
"Fermata"); }
372 {
return checkedPayload<expression::BreathMark, ExpressionType::BreathMark>(
"BreathMark"); }
377 {
return checkedPayload<articulation::StringMute, ExpressionType::StringMute>(
"StringMute"); }
382 {
return checkedPayload<expression::HarpDiagram, ExpressionType::HarpDiagram>(
"HarpDiagram"); }
387 {
return checkedPayload<keyboardpedal::Type, ExpressionType::KeyboardPedal>(
"KeyboardPedal"); }
392 {
return checkedPayload<PseudoTie, ExpressionType::PseudoTie>(
"PseudoTie"); }
397 {
return checkedPayload<expression::NonArpeggio, ExpressionType::NonArpeggio>(
"NonArpeggio"); }
402 {
return checkedPayload<expression::TempoText, ExpressionType::TempoMark>(
"TempoText"); }
407 {
return checkedPayload<expression::MetronomeMark, ExpressionType::MetronomeMark>(
"MetronomeMark"); }
412 {
return checkedPayload<expression::TempoAlteration, ExpressionType::TempoAlteration>(
"TempoAlteration"); }
417 {
return checkedPayload<expression::TechniqueText, ExpressionType::TechniqueText>(
"TechniqueText"); }
422 {
return checkedPayload<expression::RehearsalMark, ExpressionType::RehearsalMark>(
"RehearsalMark"); }
427 {
return checkedPayload<expression::MultimeasureRestNumber, ExpressionType::MultimeasureRestNumber>(
"MultimeasureRestNumber"); }
432 {
return checkedPayload<expression::MeasureRepeatCount, ExpressionType::MeasureRepeatCount>(
"MeasureRepeatCount"); }
437 {
return checkedPayload<expression::GenericText, ExpressionType::GenericText>(
"GenericText"); }
442 {
return checkedPayload<expression::Error, ExpressionType::Error>(
"Error"); }
450 musx::dom::MusxInstance<musx::dom::others::MeasureExprAssign>
assignment;
459 const musx::dom::MusxInstance<musx::dom::others::MeasureExprAssign>& assignment);
465 const musx::dom::MusxInstanceList<musx::dom::others::MeasureExprAssign>& assignments);
472 const musx::dom::MusxInstance<musx::dom::others::TextExpressionDef>& def,
473 const musx::dom::MusxInstance<musx::dom::others::MeasureExprAssign>& assignment = {});
480 const musx::dom::MusxInstance<musx::dom::others::ShapeExpressionDef>& def,
481 const musx::dom::MusxInstance<musx::dom::others::MeasureExprAssign>& assignment = {});
musx::dom::others::MarkingCategory::CategoryType ExpressionCategoryType
Finale marking-category type used while classifying expressions.
Definition expressions.h:43
std::vector< ExpressionAssignmentClassification > classifyExpressionAssignments(const musx::dom::MusxInstanceList< musx::dom::others::MeasureExprAssign > &assignments)
Classifies a list of Finale measure-expression assignments.
std::variant< std::monostate, dynamics::Mark, expression::Fermata, expression::BreathMark, articulation::StringMute, expression::HarpDiagram, keyboardpedal::Type, PseudoTie, expression::NonArpeggio, expression::TempoText, expression::MetronomeMark, expression::TempoAlteration, expression::TechniqueText, expression::RehearsalMark, expression::MultimeasureRestNumber, expression::MeasureRepeatCount, expression::GenericText, expression::Error, expression::Suppress > ExpressionValue
Semantic payload associated with an ExpressionClassification.
Definition expressions.h:322
ClassificationBasis
Diagnostic reason for the selected expression classification.
Definition expressions.h:72
@ Heuristic
Classification was inferred without a usable Finale category.
@ FinaleCategory
Classification follows the assigned Finale category.
@ FallbackToGenericText
No specialized classification matched the expression.
@ FinaleCategoryConfirmed
Content analysis confirmed the assigned Finale category.
@ FinaleCategoryCorrected
Content analysis overrode the assigned Finale category.
ExpressionType
Exporter-neutral semantic classes for Finale/MUSX text expressions.
Definition expressions.h:48
@ RehearsalMark
A rehearsal mark.
@ BreathMark
A breath-mark symbol.
@ MetronomeMark
A standalone metronome-note equation.
@ TechniqueText
Text identifying a performance technique.
@ StringMute
A string-mute on/off symbol.
@ KeyboardPedal
A keyboard-pedal marking.
@ HarpDiagram
A harp-pedal diagram.
@ TempoAlteration
A relative tempo alteration.
@ Suppress
An expression that should not be exported.
@ Error
An expression that could not be classified because of invalid source data.
@ MeasureRepeatCount
A count of the iterations of a measure repeat.
@ NonArpeggio
A shape expression used as a non-arpeggio sign.
@ MultimeasureRestNumber
A numeric label for a multimeasure rest.
@ TempoMark
A tempo indication.
@ Fermata
A fermata symbol.
@ GenericText
Text with no more specific recognized semantic.
ExpressionClassification classifyExpression(const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &assignment)
Classifies the expression referenced by a Finale measure-expression assignment.
Core public API for the Denigma conversion libraries.
Definition articulations.h:32
Classification paired with the Finale measure-expression assignment that produced it.
Definition expressions.h:448
musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > assignment
Source measure-expression assignment.
Definition expressions.h:450
ExpressionClassification classification
Semantic classification of the assigned expression.
Definition expressions.h:452
Exporter-neutral semantic classification of one Finale expression.
Definition expressions.h:327
std::vector< expression::RunClassification > runs
Per-run classifications for expressions containing mixed content.
Definition expressions.h:337
const expression::GenericText & genericText() const
Returns the unclassified expression text.
Definition expressions.h:436
ClassificationBasis basis
Evidence used to select type and value.
Definition expressions.h:331
const PseudoTie & pseudoTie() const
Returns the classified pseudo-tie.
Definition expressions.h:391
const expression::BreathMark & breathMark() const
Returns the classified breath mark.
Definition expressions.h:371
const expression::RehearsalMark & rehearsalMark() const
Returns the classified rehearsal mark.
Definition expressions.h:421
ExpressionValue value
Semantic payload associated with type.
Definition expressions.h:335
std::optional< musx::util::EnigmaParsingContext > enigmaCtx
Parsing context retained when the source contains Enigma text commands.
Definition expressions.h:333
const expression::MetronomeMark & metronomeMark() const
Returns the classified standalone metronome marking.
Definition expressions.h:406
const expression::TechniqueText & techniqueText() const
Returns the classified performance-technique text.
Definition expressions.h:416
const expression::TempoAlteration & tempoAlteration() const
Returns the classified relative tempo alteration.
Definition expressions.h:411
const dynamics::Mark & dynamic() const
Returns the classified dynamic mark.
Definition expressions.h:361
const articulation::StringMute & stringMute() const
Returns the classified string-mute symbol.
Definition expressions.h:376
const expression::TempoText & tempoText() const
Returns the classified absolute tempo indication.
Definition expressions.h:401
keyboardpedal::Type keyboardPedal() const
Returns the classified keyboard-pedal marking.
Definition expressions.h:386
const expression::NonArpeggio & nonArpeggio() const
Returns the classified non-arpeggio sign.
Definition expressions.h:396
ExpressionType type
Top-level semantic class.
Definition expressions.h:329
const expression::HarpDiagram & harpDiagram() const
Returns the classified harp-pedal diagram.
Definition expressions.h:381
const expression::Error & error() const
Returns the classification diagnostic.
Definition expressions.h:441
const expression::MeasureRepeatCount & measureRepeatCount() const
Returns the classified measure repeat count.
Definition expressions.h:431
const expression::Fermata & fermata() const
Returns the classified fermata.
Definition expressions.h:366
const expression::MultimeasureRestNumber & multimeasureRestNumber() const
Returns the classified multimeasure rest number.
Definition expressions.h:426
const T * as() const noexcept
Returns the payload as T when it contains that type.
Definition expressions.h:343
Visual style encoded by the source glyph variant.
Definition classifier_common.h:32
A source shape used as a stand-in for a laissez-vibrer tie or tie end.
Definition classifier_common.h:49
Classification for breath marks.
Definition articulations.h:224
Classification for fermata articulation marks.
Definition articulations.h:187
Classification for a string mute on/off symbol.
Definition articulations.h:149
Dynamic metadata attached to a source text run.
Definition dynamics.h:149
Breath-mark expression and its resolved source glyph.
Definition expressions.h:180
articulation::BreathMark breathMark
Semantic breath-mark classification.
Definition expressions.h:182
std::optional< std::string > glyphName
SMuFL glyph name when the source glyph can be resolved.
Definition expressions.h:184
Text run that qualifies a neighboring dynamic mark.
Definition expressions.h:269
std::string text
Source display text.
Definition expressions.h:273
dynamics::Change change
Dynamic change indicated by the qualifier.
Definition expressions.h:271
Classification failure caused by invalid or unsupported source data.
Definition expressions.h:279
std::string message
Human-readable diagnostic.
Definition expressions.h:281
Fermata expression and its source-specific display properties.
Definition expressions.h:166
articulation::Fermata fermata
Semantic fermata classification.
Definition expressions.h:168
std::optional< std::string > glyphName
SMuFL glyph name when the source glyph can be resolved.
Definition expressions.h:170
bool isRightBarline
Whether the fermata is assigned to the right barline.
Definition expressions.h:174
GlyphStyle glyphStyle
Visual style encoded by the source glyph.
Definition expressions.h:172
Expression text without a more specific semantic classification.
Definition expressions.h:261
std::string text
Source display text.
Definition expressions.h:263
Seven-pedal state encoded by a Finale harp-pedal diagram.
Definition expressions.h:190
PedalPosition b
B-pedal position.
Definition expressions.h:205
PedalPosition c
C-pedal position.
Definition expressions.h:203
PedalPosition a
A-pedal position.
Definition expressions.h:213
PedalPosition d
D-pedal position.
Definition expressions.h:201
PedalPosition e
E-pedal position.
Definition expressions.h:207
PedalPosition
Notated position of one harp pedal.
Definition expressions.h:194
@ Natural
Middle pedal position.
@ Sharp
Lower pedal position.
@ Flat
Upper pedal position.
PedalPosition g
G-pedal position.
Definition expressions.h:211
PedalPosition f
F-pedal position.
Definition expressions.h:209
Classified count of the iterations of a measure repeat.
Definition expressions.h:253
int count
Iteration number displayed by the marking.
Definition expressions.h:255
A standalone metronome-note equation.
Definition expressions.h:142
int displayedBeatsPerMinute
Number displayed to the right of the equals sign.
Definition expressions.h:152
std::string noteGlyphName
Canonical SMuFL name of the metronome-note glyph.
Definition expressions.h:148
std::size_t augmentationDots
Number of augmentation dots following the note.
Definition expressions.h:150
TempoInfo tempo
Source text and any independently configured Finale playback values.
Definition expressions.h:144
musx::dom::NoteType noteType
Undotted semantic value of the displayed metronome note.
Definition expressions.h:146
Classified numeric label for a multimeasure rest.
Definition expressions.h:240
int number
Measure count displayed by the marking.
Definition expressions.h:242
Shape expression recognized as a non-arpeggio sign.
Definition expressions.h:219
musx::util::ArpeggioSpanCandidate candidate
Source candidate describing the vertical arpeggio span.
Definition expressions.h:221
Classified rehearsal-mark text.
Definition expressions.h:227
std::string text
Display text of the rehearsal mark.
Definition expressions.h:229
Classification of one logical run within an expression.
Definition expressions.h:298
const T * as() const noexcept
Returns the payload as T when it contains that type.
Definition expressions.h:310
RunValue value
Semantic payload for this run.
Definition expressions.h:304
musx::util::EnigmaTextChunk chunk
Parsed Finale text chunk represented by this run.
Definition expressions.h:300
ClassificationBasis basis
Evidence used to select value.
Definition expressions.h:302
Marker payload for an expression that should not be exported.
Definition expressions.h:287
Classified text identifying a performance technique.
Definition expressions.h:85
Type type
Semantic technique identified by the classifier.
Definition expressions.h:114
std::string text
Source display text.
Definition expressions.h:116
Type
Common performance technique text values recognized by the classifier.
Definition expressions.h:89
@ Mute
Apply an unspecified mute.
@ CupMute
Apply a cup mute.
@ StopMute
Apply a stop mute.
@ HarmonMute
Apply a Harmon mute.
@ ColLegno
Unqualified col legno technique.
@ SulPonticello
Play near the bridge.
@ Arco
Bowed string technique.
@ SulTasto
Play over the fingerboard.
@ ColLegnoTratto
Draw the wood of the bow across the string.
@ Other
A recognized technique not represented by another value.
@ StraightMute
Apply a straight mute.
@ ColLegnoBattuto
Strike the string with the wood of the bow.
@ None
No technique value.
@ Pizzicato
Plucked string technique.
@ SolotoneMute
Apply a Solotone mute.
@ Ordinario
Return to ordinary technique.
@ Stopped
Use the stopped-horn technique.
@ Open
Return to an open or unmuted technique.
@ Flautando
Use a flute-like tone.
@ PlungerMute
Apply a plunger mute.
@ BucketMute
Apply a bucket mute.
Classified relative tempo alteration.
Definition expressions.h:158
TempoInfo tempo
Tempo text and any associated playback values.
Definition expressions.h:160
Text and playback data associated with a tempo expression.
Definition expressions.h:122
std::string text
Source display text.
Definition expressions.h:124
int beatUnitEdu
Finale EDU duration of one playback beat, or zero when unspecified.
Definition expressions.h:128
int beatsPerMinute
Finale playback tempo in beats per minute, or zero when unspecified.
Definition expressions.h:126
Classified absolute tempo indication.
Definition expressions.h:134
TempoInfo tempo
Tempo text and playback values.
Definition expressions.h:136