denigma 4.0.0
Loading...
Searching...
No Matches
denigma::classify Namespace Reference

Music classification helpers for Finale symbol extraction. More...

Classes

struct  ArticulationClassification
 Result returned by articulation classification. More...
 
struct  BarlineClassification
 Result returned by barline classification. More...
 
struct  ChordSuffixClassification
 Classified logical strings reconstructed from Finale chord-suffix elements. More...
 
struct  ClefClassification
 Result returned by clef classification. More...
 
struct  EntryNoteheadClassification
 Result returned by chord-level notehead-pattern classification. More...
 
struct  ExpressionAssignmentClassification
 Classification paired with the Finale measure-expression assignment that produced it. More...
 
struct  ExpressionClassification
 Exporter-neutral semantic classification of one Finale expression. More...
 
struct  GlyphStyle
 Visual style encoded by the source glyph variant. More...
 
struct  JumpClassification
 Classification of a Finale text repeat assignment. More...
 
struct  KeyboardPedalClassification
 A keyboard-pedal marking recognized in Finale text or in a custom line's text. More...
 
struct  NoteheadClassification
 Result returned by notehead classification. More...
 
struct  OctaveMarkingClassification
 An octave-displacement marking ("8va", "15mb", the SMuFL ottava glyphs, etc.) recognized in Finale text. More...
 
struct  PseudoTie
 A source shape used as a stand-in for a laissez-vibrer tie or tie end. More...
 
struct  SmartShapeClassification
 Result returned by smart-shape classification. More...
 

Typedefs

using ArticulationValue = std::variant< std::monostate, articulation::ArticulationMarks, articulation::TechniqueMark, articulation::HarmonMute, articulation::PluckedDamp, articulation::StringMute, articulation::Tremolo, articulation::Fermata, articulation::BreathMark, articulation::Caesura, articulation::Arpeggio, articulation::Ornament, articulation::VerticalEntryBracket, articulation::Parenthesis, PseudoTie, articulation::OtherMark >
 Variant payload for articulation classification.
 
using ExpressionCategoryType = musx::dom::others::MarkingCategory::CategoryType
 Finale marking-category type used while classifying expressions.
 
using ExpressionValue = 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 >
 Semantic payload associated with an ExpressionClassification.
 
using SmartShapeValue = 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 >
 The semantic payload of a classified smart shape.
 

Enumerations

enum class  ExpressionType {
  GenericText , Dynamic , Fermata , BreathMark ,
  StringMute , HarpDiagram , KeyboardPedal , PseudoTie ,
  NonArpeggio , TempoMark , MetronomeMark , TempoAlteration ,
  TechniqueText , RehearsalMark , MultimeasureRestNumber , MeasureRepeatCount ,
  Error , Suppress
}
 Exporter-neutral semantic classes for Finale/MUSX text expressions. More...
 
enum class  ClassificationBasis {
  FinaleCategory , Heuristic , FinaleCategoryConfirmed , FinaleCategoryCorrected ,
  FallbackToGenericText
}
 Diagnostic reason for the selected expression classification. More...
 

Functions

ArticulationClassification classifyArticulation (const musx::dom::MusxInstance< musx::dom::details::ArticulationAssign > &assignment, const musx::dom::EntryInfoPtr &entryInfo)
 Classifies an articulation assignment for an entry.
 
ArticulationClassification classifyArticulationSymbol (const musx::dom::MusxInstance< musx::dom::FontInfo > &fontInfo, char32_t symbol)
 Classifies an articulation symbol from a font and character code.
 
BarlineClassification classifyBarline (const musx::dom::MusxInstance< musx::dom::others::Staff > &staff, const musx::dom::MusxInstance< musx::dom::others::Measure > &measure, bool isFinalMeasure, const musx::dom::MusxInstance< musx::dom::options::BarlineOptions > &barlineOptions)
 Classifies the effective right barline for a Finale measure in staff context.
 
ChordSuffixClassification classifyChordSuffix (const musx::dom::MusxInstanceList< musx::dom::others::ChordSuffixElement > &suffix)
 Reconstructs a Finale chord suffix as Unicode text, resolving SMuFL and known legacy-font glyphs.
 
ChordSuffixClassification classifyChordSuffix ()
 Classifies a Finale chord with no displayed suffix as a major triad.
 
musx::dom::MusxInstance< musx::dom::FontInfo > singleVisibleFont (const musx::util::EnigmaParsingContext &textContext)
 Returns the common effective font of all nonempty visible text chunks.
 
ClefClassification classifyClef (const musx::dom::MusxInstance< musx::dom::options::ClefOptions::ClefDef > &clefDef, const musx::dom::MusxInstance< musx::dom::others::Staff > &staff=nullptr)
 Classifies a Finale clef definition, optionally in the context of a staff.
 
std::optional< dynamics::MarkclassifyDynamicRun (const musx::util::EnigmaTextChunk &chunk)
 Classifies a source text chunk as a single plain dynamic mark.
 
dynamics::Composition dynamicComposition (dynamics::Dynamic dynamic)
 Decomposes a dynamic into its constituent parts.
 
dynamics::Composition dynamicCompositionFromLetters (std::string_view letters)
 Decomposes dynamic letters such as "sffz" into their constituent parts, whether or not the spelling is one that dynamics::Dynamic enumerates.
 
dynamics::Dynamic dynamicFromLevel (dynamics::Level level)
 Returns the dynamics::Dynamic that names a level, so that a level can be passed to the functions keyed on dynamics::Dynamic.
 
std::string dynamicCanonicalText (dynamics::Dynamic dynamic)
 Returns the canonical text spelling for a dynamic.
 
std::vector< std::string > dynamicCanonicalGlyphs (dynamics::Dynamic dynamic)
 Returns canonical SMuFL glyph names for a dynamic.
 
std::vector< std::string > dynamicCanonicalLetterGlyphs (dynamics::Dynamic dynamic)
 Returns canonical per-letter SMuFL glyph names for a dynamic.
 
std::vector< std::string > dynamicLettersToLetterGlyphs (std::string_view letters)
 Returns per-letter SMuFL glyph names for recognized dynamic letters, omitting other characters.
 
std::string dynamicGlyphsToLetters (const std::vector< std::string > &glyphs)
 Returns the dynamic letters represented by known dynamic glyph names.
 
EntryNoteheadClassification classifyEntryNoteheads (const musx::dom::EntryInfoPtr &entry)
 Classifies chord-level notehead patterns (e.g.
 
ExpressionClassification classifyExpression (const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &assignment)
 Classifies the expression referenced by a Finale measure-expression assignment.
 
std::vector< ExpressionAssignmentClassificationclassifyExpressionAssignments (const musx::dom::MusxInstanceList< musx::dom::others::MeasureExprAssign > &assignments)
 Classifies a list of Finale measure-expression assignments.
 
ExpressionClassification classifyExpression (const musx::dom::MusxInstance< musx::dom::others::TextExpressionDef > &def, const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &assignment={})
 Classifies a Finale text-expression definition.
 
ExpressionClassification classifyExpression (const musx::dom::MusxInstance< musx::dom::others::ShapeExpressionDef > &def, const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &assignment={})
 Classifies a Finale shape-expression definition.
 
std::optional< smartshape::GeneralLineclassifyGeneralLine (const musx::dom::MusxInstance< musx::dom::others::SmartShapeCustomLine > &customLine)
 Describes a custom line style as a smartshape::GeneralLine.
 
std::optional< smartshape::GeneralLineclassifyGeneralLine (const musx::dom::MusxInstance< musx::dom::others::SmartShape > &shape)
 Describes a line-type smart shape (built-in or custom) as a smartshape::GeneralLine.
 
JumpClassification classifyJump (const musx::dom::MusxInstance< musx::dom::others::TextRepeatDef > &def)
 Classifies a Finale text repeat definition by text/glyph only.
 
JumpClassification classifyJump (const musx::dom::MusxInstance< musx::dom::others::TextRepeatAssign > &assignment)
 Classifies a Finale text repeat assignment by both visible text/glyph and playback behavior.
 
std::optional< KeyboardPedalClassificationclassifyKeyboardPedal (std::string_view text)
 Classifies plain text as a keyboard-pedal marking.
 
std::optional< KeyboardPedalClassificationclassifyKeyboardPedal (const musx::util::EnigmaParsingContext &textContext)
 Classifies Finale text as a keyboard-pedal marking, resolving SMuFL pedal glyphs.
 
NoteheadClassification classifyNoteheadSymbol (const musx::dom::MusxInstance< musx::dom::FontInfo > &fontInfo, char32_t symbol)
 Classifies a notehead symbol from a font and character code.
 
NoteheadClassification classifyNotehead (const musx::dom::NoteInfoPtr &note)
 Classifies the effective notehead for a note, resolving the note's font/character via #musx::dom::NoteInfoPtr::calcNoteheadInfo.
 
std::optional< OctaveMarkingClassificationclassifyOctaveMarking (std::string_view text)
 Classifies plain text as an octave-displacement marking.
 
std::optional< OctaveMarkingClassificationclassifyOctaveMarking (const musx::util::EnigmaParsingContext &textContext)
 Classifies Finale text as an octave-displacement marking, resolving SMuFL ottava glyphs (including parenthesized and letter-composed forms).
 
SmartShapeClassification classifySmartShape (const musx::dom::MusxInstance< musx::dom::others::SmartShape > &shape)
 Classifies a smart shape's meaning.
 
std::optional< smartshape::KeyboardPedalclassifyKeyboardPedalCustomLine (const musx::dom::MusxInstance< musx::dom::others::SmartShapeCustomLine > &customLine)
 Classifies a custom line style as keyboard pedaling.
 

Detailed Description

Music classification helpers for Finale symbol extraction.

Typedef Documentation

◆ SmartShapeValue

The semantic payload of a classified smart shape.

std::monostate means the shape was not classified: it is invalid, or its type carries no semantics Denigma models. A smartshape::GeneralLine is the fallback for a line-type shape that no more specific classification claimed.

Enumeration Type Documentation

◆ ClassificationBasis

Diagnostic reason for the selected expression classification.

Enumerator
FinaleCategory 

Classification follows the assigned Finale category.

Heuristic 

Classification was inferred without a usable Finale category.

FinaleCategoryConfirmed 

Content analysis confirmed the assigned Finale category.

FinaleCategoryCorrected 

Content analysis overrode the assigned Finale category.

FallbackToGenericText 

No specialized classification matched the expression.

◆ ExpressionType

Exporter-neutral semantic classes for Finale/MUSX text expressions.

Enumerator
GenericText 

Text with no more specific recognized semantic.

Dynamic 

A dynamic mark.

Fermata 

A fermata symbol.

BreathMark 

A breath-mark symbol.

StringMute 

A string-mute on/off symbol.

HarpDiagram 

A harp-pedal diagram.

KeyboardPedal 

A keyboard-pedal marking.

PseudoTie 

A shape expression used as a stand-in for a tie.

NonArpeggio 

A shape expression used as a non-arpeggio sign.

TempoMark 

A tempo indication.

MetronomeMark 

A standalone metronome-note equation.

TempoAlteration 

A relative tempo alteration.

TechniqueText 

Text identifying a performance technique.

RehearsalMark 

A rehearsal mark.

MultimeasureRestNumber 

A numeric label for a multimeasure rest.

MeasureRepeatCount 

A count of the iterations of a measure repeat.

Error 

An expression that could not be classified because of invalid source data.

Suppress 

An expression that should not be exported.

Function Documentation

◆ classifyChordSuffix()

ChordSuffixClassification denigma::classify::classifyChordSuffix ( const musx::dom::MusxInstanceList< musx::dom::others::ChordSuffixElement > &  suffix)

Reconstructs a Finale chord suffix as Unicode text, resolving SMuFL and known legacy-font glyphs.

Parameters
suffixThe chord suffix elements, normally from details::ChordAssign::getChordSuffix.

◆ classifyDynamicRun()

std::optional< dynamics::Mark > denigma::classify::classifyDynamicRun ( const musx::util::EnigmaTextChunk &  chunk)

Classifies a source text chunk as a single plain dynamic mark.

Recognition is driven by the text and its glyphs alone: a marking is a dynamic because it is spelled as one, not because Finale files it under the Dynamics category.

◆ classifyEntryNoteheads()

EntryNoteheadClassification denigma::classify::classifyEntryNoteheads ( const musx::dom::EntryInfoPtr &  entry)

Classifies chord-level notehead patterns (e.g.

artificial harmonics) for an entry.

This does not replace per-note notehead classification (classifyNotehead); it identifies additional structure across the notes of a chord. std::monostate means no such pattern was found, in which case each note's notehead should still be classified individually via classifyNotehead.

◆ classifyExpression() [1/3]

ExpressionClassification denigma::classify::classifyExpression ( const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &  assignment)

Classifies the expression referenced by a Finale measure-expression assignment.

Parameters
assignmentSource assignment whose expression definition is resolved and classified.
Returns
Exporter-neutral expression classification.

◆ classifyExpression() [2/3]

ExpressionClassification denigma::classify::classifyExpression ( const musx::dom::MusxInstance< musx::dom::others::ShapeExpressionDef > &  def,
const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &  assignment = {} 
)

Classifies a Finale shape-expression definition.

Parameters
defSource shape-expression definition.
assignmentOptional assignment providing placement and category context.
Returns
Exporter-neutral expression classification.

◆ classifyExpression() [3/3]

ExpressionClassification denigma::classify::classifyExpression ( const musx::dom::MusxInstance< musx::dom::others::TextExpressionDef > &  def,
const musx::dom::MusxInstance< musx::dom::others::MeasureExprAssign > &  assignment = {} 
)

Classifies a Finale text-expression definition.

Parameters
defSource text-expression definition.
assignmentOptional assignment providing placement and category context.
Returns
Exporter-neutral expression classification.

◆ classifyExpressionAssignments()

std::vector< ExpressionAssignmentClassification > denigma::classify::classifyExpressionAssignments ( const musx::dom::MusxInstanceList< musx::dom::others::MeasureExprAssign > &  assignments)

Classifies a list of Finale measure-expression assignments.

Parameters
assignmentsSource assignments to classify.
Returns
One assignment/classification pair for each input assignment.

◆ classifyGeneralLine() [1/2]

std::optional< smartshape::GeneralLine > denigma::classify::classifyGeneralLine ( const musx::dom::MusxInstance< musx::dom::others::SmartShape > &  shape)

Describes a line-type smart shape (built-in or custom) as a smartshape::GeneralLine.

Entry-attached shapes are never classified as general lines: they carry specific meanings and are classified separately.

Returns
std::nullopt when the shape is entry-attached, is not a line type, or its custom line style cannot be resolved.

◆ classifyGeneralLine() [2/2]

std::optional< smartshape::GeneralLine > denigma::classify::classifyGeneralLine ( const musx::dom::MusxInstance< musx::dom::others::SmartShapeCustomLine > &  customLine)

Describes a custom line style as a smartshape::GeneralLine.

Returns
std::nullopt when customLine is null.

◆ classifyKeyboardPedal() [1/2]

std::optional< KeyboardPedalClassification > denigma::classify::classifyKeyboardPedal ( const musx::util::EnigmaParsingContext &  textContext)

Classifies Finale text as a keyboard-pedal marking, resolving SMuFL pedal glyphs.

This form additionally recognizes the glyph-only markings that have no spelled-out equivalent, such as the half-pedal, notched-release, and pedal-line hook glyphs. Hidden text chunks are ignored.

Returns
std::nullopt when textContext is empty or is not a recognized marking.

◆ classifyKeyboardPedal() [2/2]

std::optional< KeyboardPedalClassification > denigma::classify::classifyKeyboardPedal ( std::string_view  text)

Classifies plain text as a keyboard-pedal marking.

Recognizes the spelled-out markings ("Ped.", "sost.", "una corda", "senza Ped.", the release star), the Roman-numeral and numeric pedal identifiers ("Ped. II"), and the usual qualifiers ("sempre", "simile", "ad lib.", "con"). Punctuation and letter case are ignored.

Returns
std::nullopt when text is not a recognized marking.

◆ classifyKeyboardPedalCustomLine()

std::optional< smartshape::KeyboardPedal > denigma::classify::classifyKeyboardPedalCustomLine ( const musx::dom::MusxInstance< musx::dom::others::SmartShapeCustomLine > &  customLine)

Classifies a custom line style as keyboard pedaling.

This is the line-style half of classifySmartShape's keyboard-pedal path, exposed for callers that have a line style but no shape.

Returns
std::nullopt when customLine is null or names no pedal marking in either its texts or its caps.

◆ classifyOctaveMarking()

std::optional< OctaveMarkingClassification > denigma::classify::classifyOctaveMarking ( std::string_view  text)

Classifies plain text as an octave-displacement marking.

Only unmistakable spellings are recognized (e.g., "8va", "8vb", "15ma", "22mb", "8va bassa"). A bare ASCII number is never classified.

◆ classifySmartShape()

SmartShapeClassification denigma::classify::classifySmartShape ( const musx::dom::MusxInstance< musx::dom::others::SmartShape > &  shape)

Classifies a smart shape's meaning.

An invalid shape, or one whose type Denigma does not model, yields a classification whose value is std::monostate.

◆ dynamicComposition()

dynamics::Composition denigma::classify::dynamicComposition ( dynamics::Dynamic  dynamic)

Decomposes a dynamic into its constituent parts.

Returns an empty dynamics::Composition for dynamics::Dynamic::None and dynamics::Dynamic::Other, whose spelling is not known from the enumerator alone; use dynamicCompositionFromLetters or dynamics::Mark::composition for those.

◆ dynamicCompositionFromLetters()

dynamics::Composition denigma::classify::dynamicCompositionFromLetters ( std::string_view  letters)

Decomposes dynamic letters such as "sffz" into their constituent parts, whether or not the spelling is one that dynamics::Dynamic enumerates.

Returns an empty dynamics::Composition if the letters do not spell a dynamic.

◆ dynamicFromLevel()

dynamics::Dynamic denigma::classify::dynamicFromLevel ( dynamics::Level  level)

Returns the dynamics::Dynamic that names a level, so that a level can be passed to the functions keyed on dynamics::Dynamic.

Returns dynamics::Dynamic::None for Level::None.

◆ singleVisibleFont()

musx::dom::MusxInstance< musx::dom::FontInfo > denigma::classify::singleVisibleFont ( const musx::util::EnigmaParsingContext &  textContext)

Returns the common effective font of all nonempty visible text chunks.

Returns
The common font, or null when there is no visible text, a chunk has no font, or the visible chunks do not all use the same typeface, size, and effects.