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 "ContentArray.h"
26#include "CommonClasses.h"
27#include "Enumerations.h"
28#include "EventMarkings.h"
29
30namespace mnx {
31class Sequence; // forward declaration
32
37namespace sequence {
38class Event;
39class Grace;
40class MultiNoteTremolo;
41class Space;
42class Tuplet;
43
44class SequenceContentObject : public ContentObject<SequenceContentObject>
45{
46public:
47 using ContentObject::ContentObject;
48 std::string_view defaultType() const override { return "event"; }
49};
50
51class SequenceContent : public ContentArray<SequenceContentObject>
52{
53public:
54 using ContentArray<SequenceContentObject>::ContentArray;
55
56 Event appendEvent(NoteValueBase base, unsigned dots = 0);
57 Grace appendGrace();
58 MultiNoteTremolo appendMultiNoteTremolo(int numberOfMarks, const NoteValueQuantity::Required& noteValueQuant);
59 Space appendSpace(const FractionValue& duration);
60 Tuplet appendTuplet(const NoteValueQuantity::Required& innerNoteValueQuant,
61 const NoteValueQuantity::Required& outerNoteValueQuant);
62};
63
69{
70public:
76
78 AccidentalEnclosure(const std::shared_ptr<json>& root, json_pointer pointer)
80 {
81 }
82
88 : Object(parent, key)
89 {
90 set_symbol(symbol);
91 }
92
94 operator Required() const { return { symbol() }; }
95
97 static Required make(AccidentalEnclosureSymbol symbol) { return { symbol }; }
98
100};
101
107{
108public:
110 struct Required
111 {
112 bool show{};
113 };
114
116 AccidentalDisplay(const std::shared_ptr<json>& root, json_pointer pointer)
118 {
119 }
120
125 AccidentalDisplay(Base& parent, std::string_view key, bool show)
126 : Object(parent, key)
127 {
128 set_show(show);
129 }
130
132 operator Required() const { return { show() }; }
133
135 static Required make(bool show) { return { show }; }
136
138 (AccidentalEnclosureSymbol, symbol));
141};
142
148{
149public:
150 using ArrayElementObject::ArrayElementObject;
151
152 MNX_OPTIONAL_PROPERTY(int, staffPosition);
153};
154
160{
161public:
162 using Object::Object;
163
164 MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(int, diatonicDelta, 0);
165};
166
171class Pitch : public Object
172{
173public:
175 struct Required
176 {
178 int octave{};
179 int alter{};
180 };
181
183 Pitch(const std::shared_ptr<json>& root, json_pointer pointer)
185 {
186 }
187
194 Pitch(Base& parent, std::string_view key, NoteStep step, int octave, int alter = 0)
195 : Object(parent, key)
196 {
197 set_step(step);
198 set_octave(octave);
199 set_or_clear_alter(alter);
200 }
201
203 operator Required() const { return { step(), octave(), alter() }; }
204
206 static Required make(NoteStep step, int octave, int alter = 0) { return { step, octave, alter }; }
207
211
215 [[nodiscard]] bool isSamePitch(const Required& src) const;
216
219 [[nodiscard]] Required calcTransposed() const;
220};
221
227{
228public:
230 struct Required
231 {
232 std::string target;
233 };
234
236 Slur(const std::shared_ptr<json>& root, json_pointer pointer)
238 {
239 }
240
245 Slur(Base& parent, std::string_view key, const std::string& target)
247 {
248 set_target(target);
249 }
250
252 operator Required() const { return { target() }; }
253
255 static Required make(const std::string& target) { return { target }; }
256
257 MNX_OPTIONAL_PROPERTY(std::string, endNote);
261 MNX_OPTIONAL_PROPERTY(std::string, startNote);
262 MNX_REQUIRED_PROPERTY(std::string, target);
263};
264
270{
271public:
273 Tie(const std::shared_ptr<json>& root, json_pointer pointer)
275 {
276 }
277
281 Tie(Base& parent, std::string_view key)
283 {}
284
287 MNX_OPTIONAL_PROPERTY(std::string, target);
289};
290
296{
297public:
298 using ArrayElementObject::ArrayElementObject;
299
303};
304
309class KitNote : public NoteBase
310{
311public:
313 struct Required
314 {
315 std::string kitComponentId;
316 };
317
319 KitNote(const std::shared_ptr<json>& root, json_pointer pointer)
321 {
322 }
323
328 KitNote(Base& parent, std::string_view key, const std::string& kitComponentId)
329 : NoteBase(parent, key)
330 {
331 set_kitComponent(kitComponentId);
332 }
333
335 operator Required() const { return { kitComponent() }; }
336
338 static Required make(const std::string& kitComponentId) { return { kitComponentId }; }
339
340 MNX_REQUIRED_PROPERTY(std::string, kitComponent);
341
342 inline static constexpr std::string_view JsonSchemaTypeName = "kit-note";
343};
344
349class Note : public NoteBase
350{
351public:
353 struct Required
354 {
356 };
357
359 Note(const std::shared_ptr<json>& root, json_pointer pointer)
361 {
362 }
363
368 Note(Base& parent, std::string_view key, const Pitch::Required& pitch)
369 : NoteBase(parent, key)
370 {
371 create_pitch(pitch.step, pitch.octave, pitch.alter);
372 }
373
375 operator Required() const { return { pitch() }; }
376
378 static Required make(const Pitch::Required& pitch) { return { pitch }; }
379
381 AccidentalDisplay, accidentalDisplay,
382 (bool, show));
383 MNX_REQUIRED_CHILD(Pitch, pitch, (NoteStep, step), (int, octave), (int, alter));
385
386 inline static constexpr std::string_view JsonSchemaTypeName = "note";
387};
388
394{
395public:
397 struct Required
398 {
399 std::string syllableText;
400 };
401
403 EventLyricLine(const std::shared_ptr<json>& root, json_pointer pointer)
405 {
406 }
407
412 EventLyricLine(Base& parent, std::string_view key, const std::string& syllableText)
414 {
415 set_text(syllableText);
416 }
417
419 operator Required() const { return { text() }; }
420
422 static Required make(const std::string& syllableText) { return { syllableText }; }
423
424 MNX_REQUIRED_PROPERTY(std::string, text);
426};
427
432class EventLyrics : public Object
433{
434public:
435 using Object::Object;
436
438};
439
445{
446public:
452
454 Event(const std::shared_ptr<json>& root, json_pointer pointer)
456 {
457 }
458
464 Event(Base& parent, std::string_view key, NoteValueBase base, unsigned dots = 0)
466 {
467 create_duration(base, dots);
468 }
469
471 operator Required() const { return { duration() }; }
472
474 static Required make(NoteValueBase base, unsigned dots = 0) { return { { base, dots } }; }
475
477 (NoteValueBase, base), (unsigned, dots));
488
492 [[nodiscard]] std::optional<Note> findNote(const std::string& noteId) const;
493
495 [[nodiscard]] bool isGrace() const;
496
498 [[nodiscard]] bool isTremolo() const;
499
502 [[nodiscard]] Sequence getSequence() const;
503
506 [[nodiscard]] size_t getSequenceIndex() const;
507
509 [[nodiscard]] FractionValue calcStartTime() const;
510
511 inline static constexpr std::string_view ContentTypeValue = "event";
512 inline static constexpr std::string_view JsonSchemaTypeName = "event";
513};
514
520{
521public:
523 struct Required
524 {
526 };
527
529 Space(const std::shared_ptr<json>& root, json_pointer pointer)
531 {
532 }
533
538 Space(Base& parent, std::string_view key, const FractionValue& duration)
540 {
541 create_duration(duration);
542 }
543
545 operator Required() const { return { duration() }; }
546
548 static Required make(const FractionValue& duration) { return { duration }; }
549
551 Fraction, duration,
552 (const FractionValue&, value));
553
554 inline static constexpr std::string_view ContentTypeValue = "space";
555};
556
562{
563public:
565 Grace(const std::shared_ptr<json>& root, json_pointer pointer)
567 {
568 }
569
573 Grace(Base& parent, std::string_view key)
575 {
576 create_content();
577 }
578
579 MNX_OPTIONAL_PROPERTY(std::string, color);
583
584 inline static constexpr std::string_view ContentTypeValue = "grace";
585};
586
592{
593public:
600
602 MultiNoteTremolo(const std::shared_ptr<json>& root, json_pointer pointer)
604 {
605 }
606
612 MultiNoteTremolo(Base& parent, std::string_view key, int numberOfMarks, const NoteValueQuantity::Required& noteValueQuant)
614 {
615 create_content();
616 set_marks(numberOfMarks);
617 create_outer(noteValueQuant.count, noteValueQuant.noteValue);
618 }
619
621 operator Required() const { return { marks(), outer() }; }
622
624 static Required make(int numberOfMarks, const NoteValueQuantity::Required& noteValueQuant)
625 { return { numberOfMarks, noteValueQuant }; }
626
629 NoteValue, individualDuration,
630 (NoteValueBase, base), (unsigned, dots));
633 (unsigned, count), (const NoteValue::Required&, noteValue));
634
635 inline static constexpr std::string_view ContentTypeValue = "tremolo";
636};
637
643{
644public:
651
653 Tuplet(const std::shared_ptr<json>& root, json_pointer pointer)
655 {
656 }
657
663 Tuplet(Base& parent, std::string_view key, const NoteValueQuantity::Required& innerNoteValueQuant, const NoteValueQuantity::Required& outerNoteValueQuant)
665 {
666 create_inner(innerNoteValueQuant.count, innerNoteValueQuant.noteValue);
667 create_outer(outerNoteValueQuant.count, outerNoteValueQuant.noteValue);
668 create_content();
669 }
670
672 operator Required() const { return { inner(), outer() }; }
673
675 static Required make(const NoteValueQuantity::Required& innerNoteValueQuant, const NoteValueQuantity::Required& outerNoteValueQuant)
676 { return { innerNoteValueQuant, outerNoteValueQuant }; }
677
681 (unsigned, count), (const NoteValue::Required&, noteValue));
683 (unsigned, count), (const NoteValue::Required&, noteValue));
685 MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showNumber, TupletDisplaySetting::Inner);
686 MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(TupletDisplaySetting, showValue, TupletDisplaySetting::NoNumber);
688
690 [[nodiscard]] FractionValue ratio() const
691 { return outer() / inner(); }
692
693 inline static constexpr std::string_view ContentTypeValue = "tuplet";
694};
695
701{
702public:
703 using Object::Object;
704
708 FullMeasureRest(Base& parent, std::string_view key)
709 : Object(parent, key)
710 {}
711
713 MNX_OPTIONAL_PROPERTY(int, staffPosition);
715 (NoteValueBase, base), (unsigned, dots));
716};
717inline Event SequenceContent::appendEvent(NoteValueBase base, unsigned dots)
718{ return appendWithType<Event>(base, dots); }
719
720inline Grace SequenceContent::appendGrace()
721{ return appendWithType<Grace>(); }
722
723inline MultiNoteTremolo SequenceContent::appendMultiNoteTremolo(int numberOfMarks, const NoteValueQuantity::Required& noteValueQuant)
724{ return appendWithType<MultiNoteTremolo>(numberOfMarks, noteValueQuant); }
725
726inline Space SequenceContent::appendSpace(const FractionValue& duration)
727{ return appendWithType<Space>(duration); }
728
729inline Tuplet SequenceContent::appendTuplet(const NoteValueQuantity::Required& innerNoteValueQuant,
730 const NoteValueQuantity::Required& outerNoteValueQuant)
731{ return appendWithType<Tuplet>(innerNoteValueQuant, outerNoteValueQuant); }
732
733} // namespace sequence
734
740{
741public:
743 Sequence(const std::shared_ptr<json>& root, json_pointer pointer)
745 {
746 }
747
751 Sequence(Base& parent, std::string_view key)
753 {
754 create_content();
755 }
756
761 MNX_OPTIONAL_PROPERTY(std::string, voice);
762};
763
764} // namespace mnx
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
Class for content arrays.
Definition ContentArray.h:49
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:742
Represents an MNX dictionary, where each key is a user-defined string.
Definition BaseTypes.h:816
Defines a fermata.
Definition CommonClasses.h:40
Represents a fraction of a whole note, for measuring musical time.
Definition CommonClasses.h:401
Represents a quantity of symbolic note values=.
Definition CommonClasses.h:735
Represents a symbolic note value (not necessarily a duration)
Definition CommonClasses.h:685
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:429
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:432
A sequence of events and other items in this measure for a voice in a part.
Definition Sequence.h:740
MNX_REQUIRED_CHILD(sequence::SequenceContent, content)
the content of the sequence
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:751
MNX_OPTIONAL_PROPERTY(std::string, voice)
the unique (per measure) voice label for this sequence.
Sequence(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Sequence objects.
Definition Sequence.h:743
MNX_OPTIONAL_CHILD(sequence::FullMeasureRest, fullMeasure)
Represents an explicit directive to show or hide an accidental.
Definition Sequence.h:107
static Required make(bool show)
Create a Required instance for AccidentalDisplay.
Definition Sequence.h:135
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:125
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:116
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:69
AccidentalEnclosure(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing AccidentalEnclosure objects.
Definition Sequence.h:78
AccidentalEnclosure(Base &parent, std::string_view key, AccidentalEnclosureSymbol symbol)
Creates a new Pitch class as a child of a JSON element.
Definition Sequence.h:87
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:97
Contains information about a lyric syllable from one lyric line on a note.
Definition Sequence.h:394
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:403
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:412
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:422
Contains information about the lyric syllables on the event.
Definition Sequence.h:433
MNX_OPTIONAL_CHILD(Dictionary< EventLyricLine >, lines)
the syllables per lyric line
Container for any markings on an event.
Definition EventMarkings.h:242
Represents a musical event within a sequence.
Definition Sequence.h:445
Event(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Event objects.
Definition Sequence.h:454
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Sequence.h:512
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:474
std::optional< Note > findNote(const std::string &noteId) const
Finds a note in the event by its ID.
Definition Implementations.cpp:687
MNX_OPTIONAL_CHILD(Rest, rest)
indicates this event is a rest.
MNX_OPTIONAL_CHILD(Fermata, fermata)
Information about a fermata on the event, if any.
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:699
Sequence getSequence() const
Returns the Sequence instance for this event.
Definition Implementations.cpp:719
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:511
FractionValue calcStartTime() const
Calculates and returns the start time of this event within the measure.
Definition Implementations.cpp:737
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:728
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:464
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:709
Represents a page in a score.
Definition Sequence.h:701
FullMeasureRest(Base &parent, std::string_view key)
Creates a new Page class as a child of a JSON element.
Definition Sequence.h:708
MNX_OPTIONAL_CHILD(Fermata, fermata)
Information about a fermata on the full measure rest, if any.
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:562
MNX_REQUIRED_CHILD(SequenceContent, content)
array of events
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:584
Grace(Base &parent, std::string_view key)
Creates a new Grace class as a child of a JSON element.
Definition Sequence.h:573
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:565
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:310
static Required make(const std::string &kitComponentId)
Create a Required instance for KitNote.
Definition Sequence.h:338
KitNote(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Note objects.
Definition Sequence.h:319
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:342
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:328
Represents a multi-note tremolo sequence within a sequence.
Definition Sequence.h:592
MultiNoteTremolo(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tuplet objects.
Definition Sequence.h:602
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:612
MNX_REQUIRED_CHILD(SequenceContent, 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:635
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:624
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:296
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:350
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:378
Note(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Note objects.
Definition Sequence.h:359
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Sequence.h:386
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:368
Represents the pitch of a note.
Definition Sequence.h:172
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:206
Pitch(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Pitch objects.
Definition Sequence.h:183
Required calcTransposed() const
Calculates the transposed version of this pitch, taking into account the part transposition for the p...
Definition Implementations.cpp:777
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:194
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:766
Represents a rest within a musical event within a sequence.
Definition Sequence.h:148
MNX_OPTIONAL_PROPERTY(int, staffPosition)
The staff position of non-floating rests.
Definition Sequence.h:45
Definition Sequence.h:52
Contains information about a tie on a note.
Definition Sequence.h:227
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:245
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:236
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:255
Occupies metric space without showing anything.
Definition Sequence.h:520
static Required make(const FractionValue &duration)
Create a Required instance for Space.
Definition Sequence.h:548
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:554
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:529
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:538
Contains information about a tie on a note.
Definition Sequence.h:270
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:273
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:281
Represents the options for how a note is written when transposed.
Definition Sequence.h:160
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:643
static Required make(const NoteValueQuantity::Required &innerNoteValueQuant, const NoteValueQuantity::Required &outerNoteValueQuant)
Create a Required instance for Tuplet.
Definition Sequence.h:675
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:690
Tuplet(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tuplet objects.
Definition Sequence.h:653
MNX_REQUIRED_CHILD(NoteValueQuantity, inner,(unsigned, count),(const NoteValue::Required &, noteValue))
Inner quantity: 3 quarters in the time of 2 quarters.
MNX_REQUIRED_CHILD(SequenceContent, content)
array of events, tuplets, and grace notes
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:663
static constexpr std::string_view ContentTypeValue
type value that identifies the type within the content array
Definition Sequence.h:693
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.)
object model for MNX format
LineType
Specifies the visual style of a line in (specifically) slurs.
Definition Enumerations.h:233
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:245
@ 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:425
NoteStep
The diatonic note step values.
Definition Enumerations.h:292
SlurTieSide
Specifies the direction of a slur or tie.
Definition Enumerations.h:377
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:453
GraceType
Options for how to perform grace notes.
Definition Enumerations.h:191
@ StealPrevious
steal time from the previous non-grace.
StemDirection
The values available in a labelref.
Definition Enumerations.h:415
NoteValueBase
The note values allowed in MNX.
Definition Enumerations.h:307
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:74
initializer class for NoteValueQuantity
Definition CommonClasses.h:739
unsigned count
The quantity of note values.
Definition CommonClasses.h:740
NoteValue::Required noteValue
the note value base to initialize
Definition CommonClasses.h:741
initializer class for NoteValue
Definition CommonClasses.h:689
initializer class for AccidentalDisplay
Definition Sequence.h:111
bool show
whether to show or hide the accidental
Definition Sequence.h:112
initializer class for AccidentalEnclosure
Definition Sequence.h:73
AccidentalEnclosureSymbol symbol
the symbol to use for the enclosure
Definition Sequence.h:74
initializer class for EventLyricLine
Definition Sequence.h:398
std::string syllableText
the syllable text
Definition Sequence.h:399
initializer class for Event
Definition Sequence.h:449
NoteValue::Required duration
Symbolic duration of the event.
Definition Sequence.h:450
initializer class for KitNote
Definition Sequence.h:314
std::string kitComponentId
the ID within the kit for this part
Definition Sequence.h:315
initializer class for MultiNoteTremolo
Definition Sequence.h:596
NoteValueQuantity::Required noteValueQuant
the note value quantity
Definition Sequence.h:598
int numberOfMarks
the number of marks (beams)
Definition Sequence.h:597
initializer class for Note
Definition Sequence.h:354
Pitch::Required pitch
the pitch of the note
Definition Sequence.h:355
initializer class for Pitch
Definition Sequence.h:176
NoteStep step
the letter spelling of the note.
Definition Sequence.h:177
int alter
the chromatic alteration of the note (positive for sharp, negative for flat).
Definition Sequence.h:179
int octave
the octave number of the note (where C4 is middle C).
Definition Sequence.h:178
initializer class for Slur
Definition Sequence.h:231
std::string target
the target note id of the slur
Definition Sequence.h:232
initializer class for Space
Definition Sequence.h:524
FractionValue duration
duration of the space
Definition Sequence.h:525
initializer class for Tuplet
Definition Sequence.h:647
NoteValueQuantity::Required innerNoteValueQuant
inner amount
Definition Sequence.h:648
NoteValueQuantity::Required outerNoteValueQuant
outer amount
Definition Sequence.h:649