MNX Document Model
Loading...
Searching...
No Matches
Sequence.h
1/*
2 * Copyright (C) 2025, Robert Patterson
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22#pragma once
23
24#include "BaseTypes.h"
25#include "CommonClasses.h"
26#include "Enumerations.h"
27#include "EventMarkings.h"
28
29namespace mnx {
30class Sequence; // forward declaration
31
36namespace sequence {
42{
43public:
49
51 AccidentalEnclosure(const std::shared_ptr<json>& root, json_pointer pointer)
53 {
54 }
55
61 : Object(parent, key)
62 {
63 set_symbol(symbol);
64 }
65
67 operator Required() const { return { symbol() }; }
68
70 static Required make(AccidentalEnclosureSymbol symbol) { return { symbol }; }
71
73};
74
80{
81public:
83 struct Required
84 {
85 bool show{};
86 };
87
89 AccidentalDisplay(const std::shared_ptr<json>& root, json_pointer pointer)
91 {
92 }
93
98 AccidentalDisplay(Base& parent, std::string_view key, bool show)
99 : Object(parent, key)
100 {
101 set_show(show);
102 }
103
105 operator Required() const { return { show() }; }
106
108 static Required make(bool show) { return { show }; }
109
111 (AccidentalEnclosureSymbol, symbol));
114};
115
121{
122public:
123 using ArrayElementObject::ArrayElementObject;
124
125 MNX_OPTIONAL_PROPERTY(int, staffPosition);
126};
127
133{
134public:
135 using Object::Object;
136
137 MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, diatonicDelta, 0);
138};
139
144class Pitch : public Object
145{
146public:
148 struct Required
149 {
151 int octave{};
152 int alter{};
153 };
154
156 Pitch(const std::shared_ptr<json>& root, json_pointer pointer)
158 {
159 }
160
167 Pitch(Base& parent, std::string_view key, NoteStep step, int octave, int alter = 0)
168 : Object(parent, key)
169 {
170 set_step(step);
171 set_octave(octave);
172 set_or_clear_alter(alter);
173 }
174
176 operator Required() const { return { step(), octave(), alter() }; }
177
179 static Required make(NoteStep step, int octave, int alter = 0) { return { step, octave, alter }; }
180
184
188 [[nodiscard]] bool isSamePitch(const Required& src) const;
189
192 [[nodiscard]] Required calcTransposed() const;
193};
194
200{
201public:
203 struct Required
204 {
205 std::string target;
206 };
207
209 Slur(const std::shared_ptr<json>& root, json_pointer pointer)
211 {
212 }
213
218 Slur(Base& parent, std::string_view key, const std::string& target)
220 {
221 set_target(target);
222 }
223
225 operator Required() const { return { target() }; }
226
228 static Required make(const std::string& target) { return { target }; }
229
230 MNX_OPTIONAL_PROPERTY(std::string, endNote);
234 MNX_OPTIONAL_PROPERTY(std::string, startNote);
235 MNX_REQUIRED_PROPERTY(std::string, target);
236};
237
243{
244public:
246 Tie(const std::shared_ptr<json>& root, json_pointer pointer)
248 {
249 }
250
254 Tie(Base& parent, std::string_view key)
256 {}
257
260 MNX_OPTIONAL_PROPERTY(std::string, target);
262};
263
269{
270public:
271 using ArrayElementObject::ArrayElementObject;
272
276};
277
282class KitNote : public NoteBase
283{
284public:
286 struct Required
287 {
288 std::string kitComponentId;
289 };
290
292 KitNote(const std::shared_ptr<json>& root, json_pointer pointer)
294 {
295 }
296
301 KitNote(Base& parent, std::string_view key, const std::string& kitComponentId)
302 : NoteBase(parent, key)
303 {
304 set_kitComponent(kitComponentId);
305 }
306
308 operator Required() const { return { kitComponent() }; }
309
311 static Required make(const std::string& kitComponentId) { return { kitComponentId }; }
312
313 MNX_REQUIRED_PROPERTY(std::string, kitComponent);
314
315 inline static constexpr std::string_view JsonSchemaTypeName = "kit-note";
316};
317
322class Note : public NoteBase
323{
324public:
326 struct Required
327 {
329 };
330
332 Note(const std::shared_ptr<json>& root, json_pointer pointer)
334 {
335 }
336
341 Note(Base& parent, std::string_view key, const Pitch::Required& pitch)
342 : NoteBase(parent, key)
343 {
344 create_pitch(pitch.step, pitch.octave, pitch.alter);
345 }
346
348 operator Required() const { return { pitch() }; }
349
351 static Required make(const Pitch::Required& pitch) { return { pitch }; }
352
354 AccidentalDisplay, accidentalDisplay,
355 (bool, show));
356 MNX_REQUIRED_CHILD(Pitch, pitch, (NoteStep, step), (int, octave), (int, alter));
358
359 inline static constexpr std::string_view JsonSchemaTypeName = "note";
360};
361
367{
368public:
370 struct Required
371 {
372 std::string syllableText;
373 };
374
376 EventLyricLine(const std::shared_ptr<json>& root, json_pointer pointer)
378 {
379 }
380
385 EventLyricLine(Base& parent, std::string_view key, const std::string& syllableText)
387 {
388 set_text(syllableText);
389 }
390
392 operator Required() const { return { text() }; }
393
395 static Required make(const std::string& syllableText) { return { syllableText }; }
396
397 MNX_REQUIRED_PROPERTY(std::string, text);
399};
400
405class EventLyrics : public Object
406{
407public:
408 using Object::Object;
409
411};
412
417class Event : public ContentObject
418{
419public:
425
427 Event(const std::shared_ptr<json>& root, json_pointer pointer)
429 {
430 }
431
437 Event(Base& parent, std::string_view key, NoteValueBase base, unsigned dots = 0)
438 : ContentObject(parent, key)
439 {
440 create_duration(base, dots);
441 }
442
444 operator Required() const { return { duration() }; }
445
447 static Required make(NoteValueBase base, unsigned dots = 0) { return { { base, dots } }; }
448
450 (NoteValueBase, base), (unsigned, dots));
460
464 [[nodiscard]] std::optional<Note> findNote(const std::string& noteId) const;
465
467 [[nodiscard]] bool isGrace() const;
468
470 [[nodiscard]] bool isTremolo() const;
471
474 [[nodiscard]] Sequence getSequence() const;
475
478 [[nodiscard]] size_t getSequenceIndex() const;
479
481 [[nodiscard]] FractionValue calcStartTime() const;
482
483 inline static constexpr std::string_view ContentTypeValue = ContentObject::ContentTypeValueDefault;
484 inline static constexpr std::string_view JsonSchemaTypeName = "event";
485};
486
491class Space : public ContentObject
492{
493public:
495 struct Required
496 {
498 };
499
501 Space(const std::shared_ptr<json>& root, json_pointer pointer)
503 {
504 }
505
510 Space(Base& parent, std::string_view key, const FractionValue& duration)
511 : ContentObject(parent, key)
512 {
513 create_duration(duration);
514 }
515
517 operator Required() const { return { duration() }; }
518
520 static Required make(const FractionValue& duration) { return { duration }; }
521
523 Fraction, duration,
524 (const FractionValue&, value));
525
526 inline static constexpr std::string_view ContentTypeValue = "space";
527};
528
533class Grace : public ContentObject
534{
535public:
537 Grace(const std::shared_ptr<json>& root, json_pointer pointer)
539 {
540 }
541
545 Grace(Base& parent, std::string_view key)
546 : ContentObject(parent, key)
547 {
548 create_content();
549 }
550
551 MNX_OPTIONAL_PROPERTY(std::string, color);
555
556 inline static constexpr std::string_view ContentTypeValue = "grace";
557};
558
564{
565public:
572
574 MultiNoteTremolo(const std::shared_ptr<json>& root, json_pointer pointer)
576 {
577 }
578
584 MultiNoteTremolo(Base& parent, std::string_view key, int numberOfMarks, const NoteValueQuantity::Required& noteValueQuant)
585 : ContentObject(parent, key)
586 {
587 create_content();
588 set_marks(numberOfMarks);
589 create_outer(noteValueQuant.count, noteValueQuant.noteValue);
590 }
591
593 operator Required() const { return { marks(), outer() }; }
594
596 static Required make(int numberOfMarks, const NoteValueQuantity::Required& noteValueQuant)
597 { return { numberOfMarks, noteValueQuant }; }
598
601 NoteValue, individualDuration,
602 (NoteValueBase, base), (unsigned, dots));
605 (unsigned, count), (const NoteValue::Required&, noteValue));
606
607 inline static constexpr std::string_view ContentTypeValue = "tremolo";
608};
609
614class Tuplet : public ContentObject
615{
616public:
623
625 Tuplet(const std::shared_ptr<json>& root, json_pointer pointer)
627 {
628 }
629
635 Tuplet(Base& parent, std::string_view key, const NoteValueQuantity::Required& innerNoteValueQuant, const NoteValueQuantity::Required& outerNoteValueQuant)
636 : ContentObject(parent, key)
637 {
638 create_inner(innerNoteValueQuant.count, innerNoteValueQuant.noteValue);
639 create_outer(outerNoteValueQuant.count, outerNoteValueQuant.noteValue);
640 create_content();
641 }
642
644 operator Required() const { return { inner(), outer() }; }
645
647 static Required make(const NoteValueQuantity::Required& innerNoteValueQuant, const NoteValueQuantity::Required& outerNoteValueQuant)
648 { return { innerNoteValueQuant, outerNoteValueQuant }; }
649
653 (unsigned, count), (const NoteValue::Required&, noteValue));
655 (unsigned, count), (const NoteValue::Required&, noteValue));
657 MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showNumber, TupletDisplaySetting::Inner);
658 MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showValue, TupletDisplaySetting::NoNumber);
660
662 [[nodiscard]] FractionValue ratio() const
663 { return outer() / inner(); }
664
665 inline static constexpr std::string_view ContentTypeValue = "tuplet";
666};
667
673{
674public:
675 using Object::Object;
676
680 FullMeasureRest(Base& parent, std::string_view key)
681 : Object(parent, key)
682 {}
683
684 MNX_OPTIONAL_PROPERTY(int, staffPosition);
686 (NoteValueBase, base), (unsigned, dots));
687};
688} // namespace sequence
689
695{
696public:
698 Sequence(const std::shared_ptr<json>& root, json_pointer pointer)
700 {
701 }
702
706 Sequence(Base& parent, std::string_view key)
708 {
709 create_content();
710 }
711
716 MNX_OPTIONAL_PROPERTY(std::string, voice);
717};
718
719} // namespace mnx
Represents an MNX object that is included as an array element.
Definition BaseTypes.h:664
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:499
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:198
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:260
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:246
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:280
Class for content arrays.
Definition BaseTypes.h:763
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:685
static constexpr std::string_view ContentTypeValueDefault
default type value that identifies the type within the content array
Definition BaseTypes.h:687
Represents an MNX dictionary, where each key is a user-defined string.
Definition BaseTypes.h:856
Represents a fraction of a whole note, for measuring musical time.
Definition CommonClasses.h:386
Represents a quantity of symbolic note values=.
Definition CommonClasses.h:649
Represents a symbolic note value (not necessarily a duration)
Definition CommonClasses.h:599
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:412
Object(const std::shared_ptr< json > &root, json_pointer pointer)
Wraps an Object class around an existing JSON object node.
Definition BaseTypes.h:417
A sequence of events and other items in this measure for a voice in a part.
Definition Sequence.h:695
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, staff, 1)
the staff number for this sequence
Sequence(Base &parent, std::string_view key)
Creates a new Sequence class as a child of a JSON element.
Definition Sequence.h:706
MNX_OPTIONAL_PROPERTY(std::string, voice)
the unique (per measure) voice label for this sequence.
MNX_REQUIRED_CHILD(ContentArray, content)
the content of the sequence
Sequence(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Sequence objects.
Definition Sequence.h:698
MNX_OPTIONAL_CHILD(sequence::FullMeasureRest, fullMeasure)
Represents an explicit directive to show or hide an accidental.
Definition Sequence.h:80
static Required make(bool show)
Create a Required instance for AccidentalDisplay.
Definition Sequence.h:108
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, force, false)
Whether this accidental was set intentionally (e.g., a courtesy accidental).
AccidentalDisplay(Base &parent, std::string_view key, bool show)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:98
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:89
MNX_OPTIONAL_CHILD(AccidentalEnclosure, enclosure,(AccidentalEnclosureSymbol, symbol))
The enclosure type (brackets or parentheses). Omit if none.
Represents the enclosure on an accidental.
Definition Sequence.h:42
AccidentalEnclosure(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing AccidentalEnclosure objects.
Definition Sequence.h:51
AccidentalEnclosure(Base &parent, std::string_view key, AccidentalEnclosureSymbol symbol)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:60
MNX_REQUIRED_PROPERTY(AccidentalEnclosureSymbol, symbol)
The symbol to use for the enclosure.
static Required make(AccidentalEnclosureSymbol symbol)
Create a Required instance for AccidentalEnclosure.
Definition Sequence.h:70
Contains information about a lyric syllable from one lyric line on a note.
Definition Sequence.h:367
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:376
EventLyricLine(Base &parent, std::string_view key, const std::string &syllableText)
Creates a new EventLyricLine class as a child of a JSON element.
Definition Sequence.h:385
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(LyricLineType, type, LyricLineType::Whole)
the type of syllable (in relation to the complete word)
static Required make(const std::string &syllableText)
Create a Required instance for EventLyricLine.
Definition Sequence.h:395
Contains information about the lyric syllables on the event.
Definition Sequence.h:406
MNX_OPTIONAL_CHILD(Dictionary< EventLyricLine >, lines)
the syllables per lyric line
Container for any markings on an event.
Definition EventMarkings.h:189
Represents a musical event within a sequence.
Definition Sequence.h:418
Event(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Event objects.
Definition Sequence.h:427
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Sequence.h:484
MNX_OPTIONAL_PROPERTY(StemDirection, stemDirection)
Forced stem direction.
static Required make(NoteValueBase base, unsigned dots=0)
Create a Required instance for Event.
Definition Sequence.h:447
std::optional< Note > findNote(const std::string &noteId) const
Finds a note in the event by its ID.
Definition Implementations.cpp:684
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:696
Sequence getSequence() const
Returns the Sequence instance for this event.
Definition Implementations.cpp:716
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:483
FractionValue calcStartTime() const
Calculates and returns the start time of this event within the measure.
Definition Implementations.cpp:734
MNX_REQUIRED_CHILD(NoteValue, duration,(NoteValueBase, base),(unsigned, dots))
Symbolic duration of the event.
MNX_OPTIONAL_CHILD(EventMarkings, markings)
Articulation markings on this event.
size_t getSequenceIndex() const
Returns the index of the event (or its container) in the Sequence instance for this event.
Definition Implementations.cpp:725
Event(Base &parent, std::string_view key, NoteValueBase base, unsigned dots=0)
Creates a new Event class as a child of a JSON element.
Definition Sequence.h:437
MNX_OPTIONAL_CHILD(EventLyrics, lyrics)
The lyric syllables on this event.
MNX_OPTIONAL_CHILD(Array< KitNote >, kitNotes)
KitNote array for percussion kit notation.
MNX_OPTIONAL_PROPERTY(int, staff)
Staff number override (e.g., for cross-staff events.)
MNX_OPTIONAL_CHILD(Array< Note >, notes)
bool isTremolo() const
Returns true if this event is part of a multi-note tremolo sequence.
Definition Implementations.cpp:706
Represents a page in a score.
Definition Sequence.h:673
FullMeasureRest(Base &parent, std::string_view key)
Creates a new Page class as a child of a JSON element.
Definition Sequence.h:680
MNX_OPTIONAL_PROPERTY(int, staffPosition)
the forced staff position of the full-measure rest
MNX_OPTIONAL_CHILD(NoteValue, visualDuration,(NoteValueBase, base),(unsigned, dots))
the visual duration of the full-measure rest (defaults to importer defaults).
Represents a grace note sequence within a sequence.
Definition Sequence.h:534
MNX_REQUIRED_CHILD(ContentArray, content)
array of events
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:556
Grace(Base &parent, std::string_view key)
Creates a new Grace class as a child of a JSON element.
Definition Sequence.h:545
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, slash, true)
whether to show a slash on the grace note
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(GraceType, graceType, GraceType::StealPrevious)
The playback type of the grace note.
Grace(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Grace objects.
Definition Sequence.h:537
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the grace note sequence
Represents a single note in a (drum) kit within a musical event within a sequence.
Definition Sequence.h:283
static Required make(const std::string &kitComponentId)
Create a Required instance for KitNote.
Definition Sequence.h:311
KitNote(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Note objects.
Definition Sequence.h:292
MNX_REQUIRED_PROPERTY(std::string, kitComponent)
The ID within the kit for this part.
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Sequence.h:315
KitNote(Base &parent, std::string_view key, const std::string &kitComponentId)
Creates a new Note class as a child of a JSON element.
Definition Sequence.h:301
Represents a multi-note tremolo sequence within a sequence.
Definition Sequence.h:564
MultiNoteTremolo(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tuplet objects.
Definition Sequence.h:574
MultiNoteTremolo(Base &parent, std::string_view key, int numberOfMarks, const NoteValueQuantity::Required &noteValueQuant)
Creates a new MultiNoteTremolo class as a child of a JSON element.
Definition Sequence.h:584
MNX_REQUIRED_CHILD(ContentArray, content)
array of events
MNX_REQUIRED_PROPERTY(int, marks)
the number of marks (beams)
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:607
MNX_REQUIRED_CHILD(NoteValueQuantity, outer,(unsigned, count),(const NoteValue::Required &, noteValue))
a half note tremolo would be 2 quarters here
static Required make(int numberOfMarks, const NoteValueQuantity::Required &noteValueQuant)
Create a Required instance for MultiNoteTremolo.
Definition Sequence.h:596
MNX_OPTIONAL_CHILD(NoteValue, individualDuration,(NoteValueBase, base),(unsigned, dots))
optional value that specifies the individual duration of each event in the tremolo.
Represents common elements between Note and KitNote.
Definition Sequence.h:269
MNX_OPTIONAL_CHILD(Array< Tie >, ties)
The (forward) ties, if any.
MNX_OPTIONAL_PROPERTY(int, staff)
Staff number override (e.g., for cross-staff notes.)
Represents a single note (i.e., within a chord) within a musical event within a sequence.
Definition Sequence.h:323
MNX_OPTIONAL_CHILD(AccidentalDisplay, accidentalDisplay,(bool, show))
the forced show/hide state of the accidental
MNX_REQUIRED_CHILD(Pitch, pitch,(NoteStep, step),(int, octave),(int, alter))
the pitch of the note
MNX_OPTIONAL_CHILD(TransposeWritten, written)
How to write this note when it is displayed transposed.
static Required make(const Pitch::Required &pitch)
Create a Required instance for Note.
Definition Sequence.h:351
Note(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Note objects.
Definition Sequence.h:332
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Sequence.h:359
Note(Base &parent, std::string_view key, const Pitch::Required &pitch)
Creates a new Note class as a child of a JSON element.
Definition Sequence.h:341
Represents the pitch of a note.
Definition Sequence.h:145
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, alter, 0)
chromatic alteration
static Required make(NoteStep step, int octave, int alter=0)
Create a Required instance for Pitch.
Definition Sequence.h:179
Pitch(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Pitch objects.
Definition Sequence.h:156
Required calcTransposed() const
Calculates the transposed version of this pitch, taking into account the part transposition for the p...
Definition Implementations.cpp:774
MNX_REQUIRED_PROPERTY(int, octave)
the octave number
Pitch(Base &parent, std::string_view key, NoteStep step, int octave, int alter=0)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:167
MNX_REQUIRED_PROPERTY(NoteStep, step)
the note step, (i.e., "A".."G")
bool isSamePitch(const Required &src) const
Checks if the input pitch is the same as this pitch, including enharmonic equivalents.
Definition Implementations.cpp:763
Represents a rest within a musical event within a sequence.
Definition Sequence.h:121
MNX_OPTIONAL_PROPERTY(int, staffPosition)
The staff position of non-floating rests.
Contains information about a tie on a note.
Definition Sequence.h:200
MNX_OPTIONAL_PROPERTY(SlurTieSide, side)
used to force slur direction (if present)
Slur(Base &parent, std::string_view key, const std::string &target)
Creates a new Slur class as a child of a JSON element.
Definition Sequence.h:218
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:209
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
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)
static Required make(const std::string &target)
Create a Required instance for Slur.
Definition Sequence.h:228
Occupies metric space without showing anything.
Definition Sequence.h:492
static Required make(const FractionValue &duration)
Create a Required instance for Space.
Definition Sequence.h:520
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:526
MNX_REQUIRED_CHILD(Fraction, duration,(const FractionValue &, value))
Duration of space to occupy.
Space(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Sequence.h:501
Space(Base &parent, std::string_view key, const FractionValue &duration)
Creates a new Space class as a child of a JSON element.
Definition Sequence.h:510
Contains information about a tie on a note.
Definition Sequence.h:243
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:246
MNX_OPTIONAL_PROPERTY(TieTargetType, targetType)
The type of target for this tie (if present).
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, lv, false)
Indicates the presence of an l.v. tie (instead of target).
Tie(Base &parent, std::string_view key)
Creates a new Tie class as a child of a JSON element.
Definition Sequence.h:254
Represents the options for how a note is written when transposed.
Definition Sequence.h:133
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, diatonicDelta, 0)
the number of enharmonic transpositions to apply
Represents a tuplet sequence within a sequence.
Definition Sequence.h:615
static Required make(const NoteValueQuantity::Required &innerNoteValueQuant, const NoteValueQuantity::Required &outerNoteValueQuant)
Create a Required instance for Tuplet.
Definition Sequence.h:647
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showValue, TupletDisplaySetting::NoNumber)
How and whether to show the tuplet note value(s)
MNX_REQUIRED_CHILD(NoteValueQuantity, outer,(unsigned, count),(const NoteValue::Required &, noteValue))
FractionValue ratio() const
Return the triplet ratio as a FractionValue.
Definition Sequence.h:662
Tuplet(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tuplet objects.
Definition Sequence.h:625
MNX_REQUIRED_CHILD(NoteValueQuantity, inner,(unsigned, count),(const NoteValue::Required &, noteValue))
Inner quantity: 3 quarters in the time of 2 quarters.
Tuplet(Base &parent, std::string_view key, const NoteValueQuantity::Required &innerNoteValueQuant, const NoteValueQuantity::Required &outerNoteValueQuant)
Creates a new Tuplet class as a child of a JSON element.
Definition Sequence.h:635
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:665
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(ContentArray, content)
array of events, tuplets, and grace notes
object model for MNX format
LineType
Specifies the visual style of a line in (specifically) slurs.
Definition Enumerations.h:147
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
LyricLineType
The symbols available to bracket a staff group.
Definition Enumerations.h:159
@ Whole
this lyric is a whole word
AccidentalEnclosureSymbol
The types of accidental enclosure symbols.
Definition Enumerations.h:31
AutoYesNo
3-state choice enum
Definition Enumerations.h:41
TieTargetType
The values that describe the target of a tie.
Definition Enumerations.h:305
NoteStep
The diatonic note step values.
Definition Enumerations.h:183
SlurTieSide
Specifies the direction of a slur or tie.
Definition Enumerations.h:257
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:333
GraceType
Options for how to perform grace notes.
Definition Enumerations.h:105
@ StealPrevious
steal time from the previous non-grace.
StemDirection
The values available in a labelref.
Definition Enumerations.h:295
NoteValueBase
The note values allowed in MNX.
Definition Enumerations.h:198
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:59
initializer class for NoteValueQuantity
Definition CommonClasses.h:653
unsigned count
The quantity of note values.
Definition CommonClasses.h:654
NoteValue::Required noteValue
the note value base to initialize
Definition CommonClasses.h:655
initializer class for NoteValue
Definition CommonClasses.h:603
initializer class for AccidentalDisplay
Definition Sequence.h:84
bool show
whether to show or hide the accidental
Definition Sequence.h:85
initializer class for AccidentalEnclosure
Definition Sequence.h:46
AccidentalEnclosureSymbol symbol
the symbol to use for the enclosure
Definition Sequence.h:47
initializer class for EventLyricLine
Definition Sequence.h:371
std::string syllableText
the syllable text
Definition Sequence.h:372
initializer class for Event
Definition Sequence.h:422
NoteValue::Required duration
Symbolic duration of the event.
Definition Sequence.h:423
initializer class for KitNote
Definition Sequence.h:287
std::string kitComponentId
the ID within the kit for this part
Definition Sequence.h:288
initializer class for MultiNoteTremolo
Definition Sequence.h:568
NoteValueQuantity::Required noteValueQuant
the note value quantity
Definition Sequence.h:570
int numberOfMarks
the number of marks (beams)
Definition Sequence.h:569
initializer class for Note
Definition Sequence.h:327
Pitch::Required pitch
the pitch of the note
Definition Sequence.h:328
initializer class for Pitch
Definition Sequence.h:149
NoteStep step
the letter spelling of the note.
Definition Sequence.h:150
int alter
the chromatic alteration of the note (positive for sharp, negative for flat).
Definition Sequence.h:152
int octave
the octave number of the note (where C4 is middle C).
Definition Sequence.h:151
initializer class for Slur
Definition Sequence.h:204
std::string target
the target note id of the slur
Definition Sequence.h:205
initializer class for Space
Definition Sequence.h:496
FractionValue duration
duration of the space
Definition Sequence.h:497
initializer class for Tuplet
Definition Sequence.h:619
NoteValueQuantity::Required innerNoteValueQuant
inner amount
Definition Sequence.h:620
NoteValueQuantity::Required outerNoteValueQuant
outer amount
Definition Sequence.h:621