81 Clef(
Base&
parent, std::string_view key,
ClefSign clefSign,
int staffPosition, std::optional<OttavaAmountOrZero> octaveAdjustment = std::nullopt)
85 set_staffPosition(staffPosition);
86 if (octaveAdjustment.has_value()) {
87 set_octave(octaveAdjustment.value());
121 create_position(position);
154 create_position(position);
155 create_end(endMeasureId, endPosition);
187 set_staffPosition(staffPosition);
216 create_interval(diatonic, chromatic);
247 create_clef(clefSign, staffPosition, octaveAdjustment);
262 using ArrayElementObject::ArrayElementObject;
300 using ArrayElementObject::ArrayElementObject;
Represents an MNX object that is included as an array element.
Definition BaseTypes.h:631
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:493
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:294
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:656
Represents an MNX dictionary, where each key is a user-defined string.
Definition BaseTypes.h:785
Represents a musical chromatic interval.
Definition CommonClasses.h:474
Represents a system on a page in a score.
Definition CommonClasses.h:445
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:426
Represents a single part in an MNX document.
Definition Part.h:298
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.
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Part.h:310
MNX_OPTIONAL_PROPERTY(std::string, smuflFont)
Name of SMuFL-font for notation elements in the part (can be overridden by children)
MNX_OPTIONAL_CHILD(part::PartTransposition, transposition)
the instrument transposition for the part
MNX_OPTIONAL_CHILD(Dictionary< part::KitComponent >, kit)
The definition of a kit of (usually percussion) instruments that are used by the part.
MNX_OPTIONAL_PROPERTY(std::string, shortName)
Specifies the user-facing abbreviated name of this part.
MNX_OPTIONAL_CHILD(Array< part::Measure >, measures)
Contains all the musical data for this part.
Represents a system on a page in a score.
Definition CommonClasses.h:417
Represents a single global measure instance within an MNX document.
Definition Global.h:245
Contains information about each level of bea.
Definition Part.h:40
Beam(Base &parent, std::string_view key)
Creates a new Beam class as a child of a JSON element.
Definition Part.h:51
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:43
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:67
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 displayedon the clef
MNX_REQUIRED_PROPERTY(ClefSign, sign)
the clef sign
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:70
Clef(Base &parent, std::string_view key, ClefSign clefSign, int staffPosition, std::optional< OttavaAmountOrZero > octaveAdjustment=std::nullopt)
Creates a new Clef class as a child of a JSON element.
Definition Part.h:81
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(OttavaAmountOrZero, octave, OttavaAmountOrZero::NoTransposition)
the number of octaves by which the clef transposes
Represents a dynamic positioned with the next event in the sequence.
Definition Part.h:104
MNX_REQUIRED_PROPERTY(std::string, value)
The value of the dynamic. Currently the MNX spec allows any string here.
MNX_OPTIONAL_PROPERTY(std::string, glyph)
The SMuFL glyph name (if any)
Dynamic(Base &parent, std::string_view key, const std::string &value, const FractionValue &position)
Creates a new Space class as a child of a JSON element.
Definition Part.h:117
MNX_REQUIRED_CHILD(RhythmicPosition, position)
The rhythmic position of the dynamic within the measure.
MNX_OPTIONAL_PROPERTY(std::string, voice)
Optionally specify the voice this dynamic applies to.
Dynamic(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Part.h:107
MNX_OPTIONAL_PROPERTY(int, staff)
The staff (within the part) this dynamic applies to.
Describes a single instrument of a drum kit associated with the part.
Definition Part.h:172
MNX_OPTIONAL_PROPERTY(std::string, name)
Human-readable name of the kit component.
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:184
KitComponent(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Clef instances.
Definition Part.h:175
Represents a single measure in a part in an MNX document. It contains the majority of the musical inf...
Definition Part.h:260
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:267
MNX_OPTIONAL_CHILD(Array< Dynamic >, dynamics)
the dynamics in this measure
MNX_OPTIONAL_CHILD(Array< Ottava >, ottavas)
the ottavas in this measure
mnx::global::Measure getGlobalMeasure() const
Returns the global measure for this part measure.
Definition Implementations.cpp:305
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Part.h:288
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:315
MNX_OPTIONAL_CHILD(Array< Beam >, beams)
the beams in this measure
Represents an ottava starting with the next event in the sequence.
Definition Part.h:136
MNX_OPTIONAL_PROPERTY(std::string, voice)
Optionally specify the voice this ottava applies to.
MNX_REQUIRED_CHILD(MeasureRhythmicPosition, end)
Ottava(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Part.h:139
Ottava(Base &parent, std::string_view key, OttavaAmount value, const FractionValue &position, int endMeasureId, const FractionValue &endPosition)
Creates a new Space class as a child of a JSON element.
Definition Part.h:151
MNX_REQUIRED_PROPERTY(OttavaAmount, value)
The type of ottava (amount of displacement, in octaves)
MNX_REQUIRED_CHILD(RhythmicPosition, position)
The start position of the ottava.
MNX_OPTIONAL_PROPERTY(int, staff)
The staff (within the part) this ottava applies to.
Describes a part's instrument transposition.
Definition Part.h:200
PartTransposition(Base &parent, std::string_view key, int diatonic, int chromatic)
Creates a new Clef class as a child of a JSON element.
Definition Part.h:213
MNX_OPTIONAL_PROPERTY(int, keyFifthsFlipAt)
the number of sharps (positive) or flats (negative) at which to simplify the key signature
MNX_REQUIRED_CHILD(Interval, interval)
the transposition interval
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, prefersWrittenPitches, false)
concert-pitch score. (Examples could be piccolo, double base, glockenspiel, etc.)
PartTransposition(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Clef instances.
Definition Part.h:203
Represents a positioned clef for the measure.
Definition Part.h:230
MNX_OPTIONAL_CHILD(RhythmicPosition, position)
location within the measure of the tempo marking
MNX_REQUIRED_CHILD(Clef, clef)
the beats per minute of this tempo marking
PositionedClef(Base &parent, std::string_view key, ClefSign clefSign, int staffPosition, std::optional< OttavaAmountOrZero > octaveAdjustment=std::nullopt)
Creates a new PositionedClef class as a child of a JSON element.
Definition Part.h:244
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, staff, 1)
the staff number (for multistaff parts)
PositionedClef(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing PositionedClef instances.
Definition Part.h:233
object model for MNX format
ClefSign
The values available in a clef sign object.
Definition Enumerations.h:94
OttavaAmount
Valid values for ottava amount.
Definition Enumerations.h:223
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:198
OttavaAmountOrZero
Valid values for octave displacment amount, including zero for no transposition.
Definition Enumerations.h:242
@ NoTransposition
No transposition.
BeamHookDirection
The types of jumps.
Definition Enumerations.h:71
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:59