25#include "CommonClasses.h"
26#include "Enumerations.h"
27#include "EventMarkings.h"
100 using ArrayElementObject::ArrayElementObject;
128 set_octave(inpOctave);
130 set_alter(inpAlter.value());
192 Tie(
Base&
parent,
const std::string_view& key,
const std::optional<std::string>& target = std::nullopt)
196 set_target(target.value());
229 create_pitch(step, octave, alter);
262 set_text(syllableText);
298 Event(
Base&
parent,
const std::string_view& key, std::optional<NoteValue::Initializer> noteValue = std::nullopt)
303 create_duration(noteValue.value());
324 std::optional<Note>
findNote(
const std::string& noteId)
const;
356 create_duration(duration);
420 create_inner(innerCount, innerNoteValue);
421 create_outer(outerCount, outerNoteValue);
Represents an MNX object that is included as an array element.
Definition BaseTypes.h:615
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:483
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:210
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:271
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:258
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:288
Class for content arrays.
Definition BaseTypes.h:700
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:640
static constexpr std::string_view ContentTypeValueDefault
default type value that identifies the type within the content array
Definition BaseTypes.h:642
Represents an MNX dictionary, where each key is a user-defined string.
Definition BaseTypes.h:769
Represents a fraction of a whole note, for measuring musical time.
Definition CommonClasses.h:34
std::pair< NumType, NumType > Initializer
initializer for Fraction class (numerator, denominator)
Definition CommonClasses.h:43
Represents a quantity of symbolic note values=.
Definition CommonClasses.h:232
Definition CommonClasses.h:193
Represents a symbolic note value (not necessarily a duration)
Definition CommonClasses.h:190
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:420
Object(const std::shared_ptr< json > &root, json_pointer pointer)
Wraps an Object class around an existing JSON object node.
Definition BaseTypes.h:425
A sequence of events and other items in this measure for a voice in a part.
Definition Sequence.h:444
Sequence(Base &parent, const std::string_view &key)
Creates a new Sequence class as a child of a JSON element.
Definition Sequence.h:455
MNX_OPTIONAL_PROPERTY(std::string, voice)
the unique (per measure) voice label for this sequence.
MNX_REQUIRED_CHILD(ContentArray, content)
MNX_OPTIONAL_PROPERTY(int, staff)
the staff number for this sequence
Sequence(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Sequence objects.
Definition Sequence.h:447
Represents an explicit directive to show or hide an accidental.
Definition Sequence.h:70
AccidentalDisplay(Base &parent, const std::string_view &key, bool showAcci)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:82
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, force, false)
Whether this accidental was set intentionally (e.g., a courtesy accidental).
MNX_OPTIONAL_CHILD(AccidentalEnclosure, enclosure)
The enclosure type (brackets or parentheses). Omit if none.
MNX_REQUIRED_PROPERTY(bool, show)
Whether to show or hide the accidental.
AccidentalDisplay(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing AccidentalEnclosure objects.
Definition Sequence.h:73
Represents the enclosure on an accidental.
Definition Sequence.h:44
AccidentalEnclosure(Base &parent, const std::string_view &key, AccidentalEnclosureSymbol inSymbol)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:56
AccidentalEnclosure(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing AccidentalEnclosure objects.
Definition Sequence.h:47
MNX_REQUIRED_PROPERTY(AccidentalEnclosureSymbol, symbol)
The symbol to use for the enclosure.
Contains information about a lyric syllable from one lyric line on a note.
Definition Sequence.h:247
MNX_REQUIRED_PROPERTY(std::string, text)
the syllable text
EventLyricLine(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing EventLyricLine objects.
Definition Sequence.h:250
EventLyricLine(Base &parent, const std::string_view &key, const std::string &syllableText)
Creates a new EventLyricLine class as a child of a JSON element.
Definition Sequence.h:259
MNX_OPTIONAL_PROPERTY(LyricLineType, type)
the type of syllable (in relation to the complete word)
Contains information about the lyric syllables on the event.
Definition Sequence.h:274
MNX_OPTIONAL_CHILD(Dictionary< EventLyricLine >, lines)
the syllables per lyric line
Container for any markings on an event.
Definition EventMarkings.h:177
Represents a musical event within a sequence.
Definition Sequence.h:286
Event(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Event objects.
Definition Sequence.h:289
MNX_OPTIONAL_PROPERTY(StemDirection, stemDirection)
Forced stem direction.
std::optional< Note > findNote(const std::string ¬eId) const
Finds a note in the event by its ID.
Definition Implementations.cpp:182
MNX_OPTIONAL_CHILD(Rest, rest)
indicates this event is a rest.
MNX_OPTIONAL_CHILD(Array< Slur >, slurs)
The slurs that start on this event.
bool isGrace() const
Returns true if this event is part of a grace note sequence.
Definition Implementations.cpp:194
Sequence getSequence() const
Returns the Sequence instance for this event.
Definition Implementations.cpp:204
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:333
MNX_OPTIONAL_CHILD(NoteValue, duration)
Symbolic duration of the event.
MNX_OPTIONAL_CHILD(EventMarkings, markings)
Articulation markings on this event.
Event(Base &parent, const std::string_view &key, std::optional< NoteValue::Initializer > noteValue=std::nullopt)
Creates a new Event class as a child of a JSON element.
Definition Sequence.h:298
MNX_OPTIONAL_CHILD(EventLyrics, lyrics)
The lyric syllables on this event.
MNX_OPTIONAL_PROPERTY(int, staff)
Staff number override (e.g., for cross-staff events.)
MNX_OPTIONAL_CHILD(Array< Note >, notes)
MNX_OPTIONAL_PROPERTY(std::string, id)
Identifying string for the event.
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, measure, false)
Whether this event is a whole-measure event.
Represents a grace note sequence within a sequence.
Definition Sequence.h:369
MNX_OPTIONAL_NAMED_PROPERTY(std::string, styleClass, "class")
style class
MNX_REQUIRED_CHILD(ContentArray, content)
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:392
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, slash, true)
whether to show a slash on the grace note
Grace(Base &parent, const std::string_view &key)
Creates a new Grace class as a child of a JSON element.
Definition Sequence.h:380
Grace(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Grace objects.
Definition Sequence.h:372
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the grace note sequence
Represents a single note (i.e., within a chord) within a musical event within a sequence.
Definition Sequence.h:212
MNX_OPTIONAL_CHILD(Array< Tie >, ties)
The (forward) ties, if any.
MNX_OPTIONAL_PROPERTY(std::string, smuflFont)
The SMuFL-complaint font to use for rendering the note.
MNX_OPTIONAL_PROPERTY(int, staff)
Staff number override (e.g., for cross-staff notes.)
MNX_OPTIONAL_CHILD(AccidentalDisplay, accidentalDisplay)
the forced show/hide state of the accidental
Note(Base &parent, const std::string_view &key, NoteStep step, int octave, std::optional< int > alter=std::nullopt)
Creates a new Note class as a child of a JSON element.
Definition Sequence.h:226
MNX_REQUIRED_CHILD(Pitch, pitch)
the pitch of the note
Note(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Note objects.
Definition Sequence.h:215
MNX_OPTIONAL_PROPERTY(std::string, id)
MNX_OPTIONAL_NAMED_PROPERTY(std::string, styleClass, "class")
style class
Represents the pitch of a note.
Definition Sequence.h:110
Pitch(Base &parent, const std::string_view &key, NoteStep inpStep, int inpOctave, std::optional< int > inpAlter=std::nullopt)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:124
Pitch(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Pitch objects.
Definition Sequence.h:113
MNX_OPTIONAL_PROPERTY(int, alter)
chromatic alteration
MNX_REQUIRED_PROPERTY(int, octave)
the octave number
bool isSamePitch(const Pitch &src) const
Checks if the input pitch is the same as this pitch, including enharmonic equivalents.
Definition Implementations.cpp:217
MNX_REQUIRED_PROPERTY(NoteStep, step)
the note step, (i.e., "A".."G")
Represents a rest within a musical event within a sequence.
Definition Sequence.h:98
MNX_OPTIONAL_PROPERTY(int, staffPosition)
The staff position of non-floating rests.
Contains information about a tie on a note.
Definition Sequence.h:149
MNX_OPTIONAL_PROPERTY(SlurTieSide, side)
used to force slur direction (if present)
MNX_OPTIONAL_PROPERTY(SlurTieSide, sideEnd)
used to force slur's endpoint direction (if different than side)
Slur(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Slur objects.
Definition Sequence.h:152
MNX_OPTIONAL_PROPERTY(std::string, startNote)
the specific note ID this slur starts on
MNX_OPTIONAL_PROPERTY(std::string, endNote)
the specific note ID this slur ends on
Slur(Base &parent, const std::string_view &key, const std::string &target)
Creates a new Slur class as a child of a JSON element.
Definition Sequence.h:161
MNX_OPTIONAL_PROPERTY(LineType, lineType)
the type of line for the slur
MNX_REQUIRED_PROPERTY(std::string, target)
the event ID this slur ends on (if present)
Occupies metric space without showing anything.
Definition Sequence.h:341
MNX_REQUIRED_CHILD(Fraction, duration)
Duration of space to occupy.
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:361
Space(Base &parent, const std::string_view &key, const Fraction::Initializer &duration)
Creates a new Space class as a child of a JSON element.
Definition Sequence.h:353
Space(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Sequence.h:344
Contains information about a tie on a note.
Definition Sequence.h:180
Tie(Base &parent, const std::string_view &key, const std::optional< std::string > &target=std::nullopt)
Creates a new Tie class as a child of a JSON element.
Definition Sequence.h:192
MNX_OPTIONAL_PROPERTY(std::string, target)
the note id of the tied-to note
MNX_OPTIONAL_PROPERTY(SlurTieSide, side)
used to force tie direction (if present)
Tie(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tie objects.
Definition Sequence.h:183
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, lv, false)
Indicates the presence of an l.v. tie (instead of target)
Represents a tuplet sequence within a sequence.
Definition Sequence.h:400
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showValue, TupletDisplaySetting::NoNumber)
How and whether to show the tuplet note value(s)
MNX_REQUIRED_CHILD(NoteValueQuantity, inner)
Inner quantity: 3 quarters in the time of 2 quarters.
Tuplet(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tuplet objects.
Definition Sequence.h:403
Tuplet(Base &parent, const std::string_view &key, unsigned innerCount, const NoteValue::Initializer &innerNoteValue, unsigned outerCount, const NoteValue::Initializer &outerNoteValue)
Creates a new Tuplet class as a child of a JSON element.
Definition Sequence.h:415
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:434
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(AutoYesNo, bracket, AutoYesNo::Auto)
bracket style
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showNumber, TupletDisplaySetting::Inner)
How and whether to show the tuplet number(s)
MNX_OPTIONAL_PROPERTY(int, staff)
Staff number override (e.g., for cross-staff notes.)
MNX_REQUIRED_CHILD(NoteValueQuantity, outer)
MNX_REQUIRED_CHILD(ContentArray, content)
array of events (and tuplets, at least for now)
object model for MNX format
LineType
Specifies the visual style of a line in (specifically) slurs.
Definition Enumerations.h:136
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:197
LyricLineType
The symbols available to bracket a staff group.
Definition Enumerations.h:148
AccidentalEnclosureSymbol
The types of accidental enclosure symbols.
Definition Enumerations.h:31
AutoYesNo
3-state choice enum
Definition Enumerations.h:41
NoteStep
The diatonic note step values.
Definition Enumerations.h:172
SlurTieSide
Specifies the direction of a slur or tie.
Definition Enumerations.h:256
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:292
StemDirection
The values available in a labelref.
Definition Enumerations.h:266