25#include "ContentArray.h"
58 create_position(position);
67 (
const std::string&, startId),
68 (
const std::string&, endId));
154 set_staffPosition(staffPosition);
155 set_or_clear_octave(octaveAdjustment);
159 operator Required()
const {
return { sign(), staffPosition(), octave() }; }
163 {
return { clefSign, staffPosition, octaveAdjustment }; }
204 create_position(position);
212 return { value(), position().fraction(), end().measure(), end().
position().fraction() };
220 (
const std::string&, measureId), (
const FractionValue&, position));
255 set_staffPosition(staffPosition);
259 operator Required()
const {
return { staffPosition() }; }
299 operator Required()
const {
return { interval() }; }
305 (
int, staffDistance), (
int, halfSteps));
345 create_clef(clefSign, staffPosition, octaveAdjustment);
353 {
return { clefSign, staffPosition, octaveAdjustment }; }
369 using ArrayElementObject::ArrayElementObject;
409 using ArrayElementObject::ArrayElementObject;
Represents an MNX object that is included as an array element.
Definition BaseTypes.h:719
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:531
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:212
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:274
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:260
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:297
Represents an MNX dictionary, where each key is a user-defined string.
Definition BaseTypes.h:816
Represents a start and end id pair.
Definition CommonClasses.h:447
Represents a musical chromatic interval.
Definition CommonClasses.h:604
Represents a system on a page in a score.
Definition CommonClasses.h:550
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:429
Represents a single part in an MNX document.
Definition Part.h:407
MNX_OPTIONAL_CHILD(part::PartTransposition, transposition,(const Interval::Required &, interval))
the instrument transposition for the part
MNX_OPTIONAL_PROPERTY(std::string, name)
Specifies the user-facing full name of this part.
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, staves, 1)
The number of staves in this part.
MNX_REQUIRED_CHILD(Array< part::Measure >, measures)
Contains all the musical data for this part.
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Part.h:430
MNX_OPTIONAL_PROPERTY(std::string, smuflFont)
Name of SMuFL-font for notation elements in the part (can be overridden by children)
MNX_OPTIONAL_CHILD(Dictionary< part::KitComponent >, kit)
The definition of a kit of (usually percussion) instruments that are used by the part.
Part(Base &parent, std::string_view key)
Creates a new Part class as a child of a JSON element.
Definition Part.h:414
MNX_OPTIONAL_PROPERTY(std::string, shortName)
Specifies the user-facing abbreviated name of this part.
Represents a system on a page in a score.
Definition CommonClasses.h:489
Represents a single global measure instance within an MNX document.
Definition Global.h:324
Contains information about both arpeggios and non arpeggios.
Definition Part.h:42
MNX_REQUIRED_CHILD(IdPair, span,(const std::string &, startId),(const std::string &, endId))
the span of the arpeggio
ArpeggioBase(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Beam objects.
Definition Part.h:45
ArpeggioBase(Base &parent, std::string_view key, const FractionValue &position, const IdPair::Required &span)
Creates a new Beam class as a child of a JSON element.
Definition Part.h:55
MNX_REQUIRED_CHILD(RhythmicPosition, position,(FractionValue, value))
the rhythmic position of the arpeggio
Contains information about arpeggios.
Definition Part.h:76
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(MarkingUpDownAuto, direction, MarkingUpDownAuto::Auto)
the direction of the arpeggio
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, arrow, false)
specifies if the arpeggio has an arrow
Contains information about each level of beam.
Definition Part.h:99
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Part.h:120
Beam(Base &parent, std::string_view key)
Creates a new Beam class as a child of a JSON element.
Definition Part.h:110
MNX_OPTIONAL_CHILD(Array< Beam >, beams)
the beams that comprise the next beam level (may be omitted)
MNX_REQUIRED_CHILD(Array< std::string >, events)
the events that comprise this beam level
Beam(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Beam objects.
Definition Part.h:102
MNX_OPTIONAL_PROPERTY(BeamHookDirection, direction)
the forced direction of a beam hook (if this beam contains one event).
Represents a visible clef in the measure.
Definition Part.h:128
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the ending
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, showOctave, true)
if octave is non-zero, this value determines whether the octave should be displayed on the clef
MNX_REQUIRED_PROPERTY(ClefSign, sign)
the clef sign
Clef(Base &parent, std::string_view key, ClefSign clefSign, int staffPosition, OttavaAmountOrZero octaveAdjustment=OttavaAmountOrZero::NoTransposition)
Creates a new Clef class as a child of a JSON element.
Definition Part.h:150
MNX_OPTIONAL_PROPERTY(std::string, glyph)
the specific SMuFL glyph to use for rendering the clef
MNX_REQUIRED_PROPERTY(int, staffPosition)
staff position offset from center of staff (in half-spaces)
Clef(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Clef instances.
Definition Part.h:139
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(OttavaAmountOrZero, octave, OttavaAmountOrZero::NoTransposition)
the number of octaves by which the clef transposes
static Required make(ClefSign clefSign, int staffPosition, OttavaAmountOrZero octaveAdjustment=OttavaAmountOrZero::NoTransposition)
Create a Required instance for Clef.
Definition Part.h:162
Definition Dynamics.h:257
Describes a single instrument of a drum kit associated with the part.
Definition Part.h:234
MNX_OPTIONAL_PROPERTY(std::string, name)
Human-readable name of the kit component.
static Required make(int staffPosition)
Create a Required instance for KitComponent.
Definition Part.h:262
MNX_OPTIONAL_PROPERTY(std::string, sound)
The sound ID in global.sounds.
MNX_REQUIRED_PROPERTY(int, staffPosition)
The staff position of the kit component, where 0 is the middle line.
KitComponent(Base &parent, std::string_view key, int staffPosition)
Creates a new Clef class as a child of a JSON element.
Definition Part.h:252
KitComponent(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Clef instances.
Definition Part.h:243
Represents a single measure in a part in an MNX document. It contains the majority of the musical inf...
Definition Part.h:367
MNX_OPTIONAL_CHILD(Array< PositionedClef >, clefs)
the clef changes in this bar
Measure(Base &parent, std::string_view key)
Creates a new Measure class as a child of a JSON element.
Definition Part.h:374
MNX_OPTIONAL_CHILD(Array< Ottava >, ottavas)
the ottavas in this measure
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Part.h:397
MNX_OPTIONAL_CHILD(DynamicGroupArray, dynamics)
the dynamics in this measure
MNX_REQUIRED_CHILD(Array< Sequence >, sequences)
sequences that contain all the musical details in each measure
std::optional< TimeSignature > calcCurrentTime() const
Caculates the time signature at this measure.
Definition Implementations.cpp:637
MNX_OPTIONAL_CHILD(Array< Beam >, beams)
the beams in this measure
MNX_OPTIONAL_CHILD(Array< Arpeggio >, arpeggios)
the arpeggios in this measure
mnx::global::Measure getGlobalMeasure() const
Returns the global measure for this part measure.
Definition Implementations.cpp:627
MNX_OPTIONAL_CHILD(Array< NonArpeggio >, nonArpeggios)
the non-arpeggios in this measure
Contains information about non-arpeggios.
Definition Part.h:89
Represents an ottava starting with the next event in the sequence.
Definition Part.h:178
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(Orientation, orient, Orientation::Auto)
Whether the ottava is above or below the staff
MNX_OPTIONAL_PROPERTY(std::string, voice)
Optionally specify the voice this ottava applies to.
Ottava(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Part.h:190
static Required make(OttavaAmount value, const FractionValue &position, const MeasureRhythmicPosition::Required &endPosition)
Create a Required instance for Ottava.
Definition Part.h:216
MNX_REQUIRED_CHILD(MeasureRhythmicPosition, end,(const std::string &, measureId),(const FractionValue &, position))
The end of the ottava; omit graceIndex at the start to include preceding grace notes,...
Ottava(Base &parent, std::string_view key, OttavaAmount value, const FractionValue &position, const MeasureRhythmicPosition::Required &endPosition)
Creates a new Space class as a child of a JSON element.
Definition Part.h:201
MNX_REQUIRED_PROPERTY(OttavaAmount, value)
The type of ottava (amount of displacement, in octaves)
MNX_REQUIRED_CHILD(RhythmicPosition, position,(const FractionValue &, position))
The start position of the ottava.
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, staff, 1)
The staff (within the part) this ottava applies to.
Describes a part's instrument transposition.
Definition Part.h:274
KeySignature::Required calcTransposedKey(const KeySignature::Required &concertKey) const
Calculates and returns the transposed keyFifths value for the input key.
Definition Implementations.cpp:661
MNX_OPTIONAL_PROPERTY(int, keyFifthsFlipAt)
the number of sharps (positive) or flats (negative) at which to simplify the key signature
static Required make(const Interval::Required &interval)
Create a Required instance for PartTransposition.
Definition Part.h:302
MNX_REQUIRED_CHILD(Interval, interval,(int, staffDistance),(int, halfSteps))
the transposition interval
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, prefersWrittenPitches, false)
concert-pitch score. (Examples could be piccolo, double base, glockenspiel, etc.)
PartTransposition(Base &parent, std::string_view key, const Interval::Required &interval)
Creates a new Clef class as a child of a JSON element.
Definition Part.h:292
PartTransposition(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Clef instances.
Definition Part.h:283
Represents a positioned clef for the measure.
Definition Part.h:320
PositionedClef(Base &parent, std::string_view key, ClefSign clefSign, int staffPosition, OttavaAmountOrZero octaveAdjustment=OttavaAmountOrZero::NoTransposition)
Creates a new PositionedClef class as a child of a JSON element.
Definition Part.h:342
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, staff, 1)
the staff number (for multistaff parts)
MNX_REQUIRED_CHILD(Clef, clef,(ClefSign, clefSign),(int, staffPosition),(OttavaAmountOrZero, octaveAdjustment))
the beats per minute of this tempo marking
PositionedClef(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing PositionedClef instances.
Definition Part.h:331
static Required make(ClefSign clefSign, int staffPosition, OttavaAmountOrZero octaveAdjustment=OttavaAmountOrZero::NoTransposition)
Create a Required instance for PositionedClef.
Definition Part.h:352
MNX_OPTIONAL_CHILD(RhythmicPosition, position,(const FractionValue &, position))
location within the measure of the tempo marking
object model for MNX format
MarkingUpDownAuto
Specifies up or down or auto for a marking symbol.
Definition Enumerations.h:267
@ Auto
determined by consuming property
ClefSign
The values available in a clef sign object.
Definition Enumerations.h:94
OttavaAmount
Valid values for ottava amount.
Definition Enumerations.h:343
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
OttavaAmountOrZero
Valid values for octave displacment amount, including zero for no transposition.
Definition Enumerations.h:362
@ NoTransposition
No transposition.
BeamHookDirection
The types of jumps.
Definition Enumerations.h:71
Orientation
Specifies the vertical visual orientation of a glyph with respect to its corresponding notation.
Definition Enumerations.h:332
@ Auto
the default value determined by implementation
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:74
initializer class for IdPair
Definition CommonClasses.h:451
std::string startId
the start id of the pair
Definition CommonClasses.h:452
std::string endId
the end id of the pair
Definition CommonClasses.h:453
initializer class for Interval
Definition CommonClasses.h:608
int halfSteps
the number of 12-EDO chromatic halfsteps in the interval (negative is down)
Definition CommonClasses.h:610
int staffDistance
the number of diatonic steps in the interval (negative is down)
Definition CommonClasses.h:609
initializer class for KeySignature
Definition CommonClasses.h:650
initializer class for MeasureRhythmicPosition
Definition CommonClasses.h:554
std::string measureId
the global measure id of the position
Definition CommonClasses.h:555
FractionValue position
the position within the measure
Definition CommonClasses.h:556
initializer class for Clef
Definition Part.h:132
ClefSign clefSign
the type of clef symbol
Definition Part.h:133
OttavaAmountOrZero octaveAdjustment
octave adjustment (NoTransposition when unset)
Definition Part.h:135
int staffPosition
staff position offset from center of staff
Definition Part.h:134
initializer class for KitComponent
Definition Part.h:238
int staffPosition
the staff position of the kit component
Definition Part.h:239
initializer class for Ottava
Definition Part.h:182
FractionValue position
the start position of the ottava
Definition Part.h:184
std::string endMeasureId
the global id of the end measure of the ottava
Definition Part.h:185
FractionValue endPosition
the position within the end measure
Definition Part.h:186
OttavaAmount value
the value (type) of ottava
Definition Part.h:183
initializer class for PartTransposition
Definition Part.h:278
Interval::Required interval
the transposition interval for the part
Definition Part.h:279
initializer class for PositionedClef
Definition Part.h:324
ClefSign clefSign
the type of clef symbol
Definition Part.h:325
int staffPosition
staff position offset from center of staff
Definition Part.h:326
OttavaAmountOrZero octaveAdjustment
the octave adjustment
Definition Part.h:327