MUSX Document Model
|
Represents a single note element in an entry. More...
#include <Entries.h>
Public Types | |
enum class | NoteName : int { C = 0 , D = 1 , E = 2 , F = 3 , G = 4 , A = 5 , B = 6 } |
The available note names, in array order. | |
![]() | |
enum class | ShareMode { All , Partial , None } |
Describes how this instance is shared between part and score. More... | |
using | SharedNodes = std::set< std::string > |
The container type for shared nodes. | |
Public Member Functions | |
Note (const DocumentWeakPtr &document, NoteNumber noteId) | |
Constructor function. | |
NoteNumber | getNoteId () const |
Gets the note id for this note. This value does not change, even if the notes in a chord are rearranged (which affects the order of Entry::notes.) | |
std::tuple< NoteName, int, int, int > | calcNoteProperties (const std::shared_ptr< KeySignature > &key, ClefIndex clefIndex, const std::shared_ptr< const others::Staff > &staff=nullptr) const |
Calculates the note name, octave number, actual alteration, and staff position. | |
bool | requireAllFields () const override |
Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class. | |
![]() | |
virtual | ~Base () noexcept(false)=default |
Virtual destructor for polymorphic behavior. | |
DocumentPtr | getDocument () const |
Gets a reference to the Document. | |
Cmper | getPartId () const |
Gets the partId for this instance (or 0 for score) | |
std::shared_ptr< others::PartDefinition > | getPartDefinition () const |
Gets the others::PartDefinition corresponding to getPartId. | |
ShareMode | getShareMode () const |
Gets the sharing mode for this instance. | |
const SharedNodes & | getUnlinkedNodes () const |
Gets the unlinked nodes for this instance. (Only populated for ShareMode::Partial ) | |
void | addUnlinkedNode (const std::string &nodeName) |
Adds a shared node for this instance. | |
virtual void | integrityCheck () |
Allows a class to determine if it has been properly contructed by the factory and fix issues that it can, such as creating default instances of contained classes. | |
Static Public Member Functions | |
static const xml::XmlElementArray< Note > & | xmlMappingArray () |
Required for musx::factory::FieldPopulator. | |
Public Attributes | |
int | harmLev {} |
Diatonic displacement relative to middle C or to the tonic in the middle C octave (if the key signature tonic is not C). | |
int | harmAlt {} |
Chromatic alteration relative to the key signature. Never has a magnitude greater than +/-7. | |
bool | isValid {} |
Should always be true but otherwise appears to be used internally by Finale. | |
bool | crossStaff {} |
Signifies that the note has a details::CrossStaff note detail. | |
bool | tieStart {} |
Indicates a tie starts on this note. | |
bool | tieEnd {} |
Indicates a tie ends on this note. | |
bool | showAcci {} |
True if the note has an accidental. (Dynamically changed by Finale unless freezeAcci is set.) | |
bool | freezeAcci {} |
True if the accidental should be forced on or off (based on showAcci .) | |
Additional Inherited Members | |
![]() | |
Base (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode) | |
Constructs the base class and enforces the static constexpr XmlNodeName. | |
Base & | operator= (const Base &) |
assignment constructor: m_unlinkedNodes is intentionally omitted | |
Represents a single note element in an entry.
This class is identified by the XML node name "note".
std::tuple< Note::NoteName, int, int, int > musx::dom::Note::calcNoteProperties | ( | const std::shared_ptr< KeySignature > & | key, |
ClefIndex | clefIndex, | ||
const std::shared_ptr< const others::Staff > & | staff = nullptr |
||
) | const |
Calculates the note name, octave number, actual alteration, and staff position.
Finale does not transpose correctly with microtonal key signatures. This function transposes mostly correctly for them, which means that microtonal key signatures may have different results than in Finale. Of particular note is Chromatic Transposition, which produces nonsense results in Finale but here produces correct results, provided that the alteration value is understood to be a chromatic half-step alteration rather than a step alteration in EDO divisions.
See KeySignature::setTransposition for information about differences in key signature transposition.
key | The key signature in effect. |
clefIndex | The index of the clef in effect. |
staff | If provided, the notes are transposed by any Chromatic Transposition specified for the staff. If calling calcNoteProperties for Concert Pitch (sounding pitch) values, omit this parameter. |
|
inlineoverridevirtual |
Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class.
Some classes make it difficult to discover all the possible xml tags that might be used for all its options. An example is others::TextBlock. By overriding this function, a class can allow its members to be discovered as needed without causing error messages or throwing exceptions.
Reimplemented from musx::dom::Base.