MUSX Document Model
|
Wraps an EntryInfo instance and a note index. More...
#include <Entries.h>
Public Member Functions | |
NoteInfoPtr () | |
Default constructor. | |
NoteInfoPtr (const EntryInfoPtr &entryInfo, size_t noteIndex) | |
Constructor. | |
operator bool () const | |
Provides a boolean conversion based on whether the EntryInfoPtr is valid and the note index is valid. | |
bool | isSameNote (const NoteInfoPtr &src) const |
Returns whether the input and the current instance refer to the same note. | |
NoteInfoPtr | findEqualPitch (const EntryInfoPtr &entry) const |
Finds a note with the same pitch in the supplied entry. | |
MusxInstance< Note > | operator-> () const |
Allows -> access to the underlying Note instance. | |
EntryInfoPtr | getEntryInfo () const |
Gets the entry info for this note. | |
Note::NoteProperties | calcNoteProperties (const std::optional< bool > &enharmonicRespell=std::nullopt) const |
Calculates the note name, octave number, actual alteration, and staff position. This function does not take into account percussion notes and their staff position override. To discover if a note is a percussion note, call calcPercussionNoteInfo. If it returns non-null, use that for staff position instead of this function. | |
Note::NoteProperties | calcNotePropertiesConcert () const |
Calculates the note name, octave number, actual alteration, and staff position for the concert pitch of the note. This function does not take into account percussion notes and their staff position override. To discover if a note is a percussion note, call calcPercussionNoteInfo. If it returns non-null, use that for staff position instead of this function. | |
Note::NoteProperties | calcNotePropertiesInView () const |
Calculates the note name, octave number, actual alteration, and staff position for the pitch of the note in view. This may be particularly useful with non-floating rests, but it can be used with any note. As with other versions of the function, it does not handle the staff position override of percussion notes. | |
MusxInstance< others::PercussionNoteInfo > | calcPercussionNoteInfo () const |
Calculates the percussion note info for this note, if any. | |
NoteInfoPtr | calcTieTo () const |
Calculates the note that this note could tie to. Check the return value's Note::tieEnd to see if there is actually a tie end. (Note that Finale shows a tie whether there Note::tieEnd is true or not.) | |
NoteInfoPtr | calcTieFrom (bool requireTie=true) const |
Calculates the note that this note could tie from. | |
StaffCmper | calcStaff () const |
Calculates the staff number, taking into account cross staffing. | |
std::unique_ptr< music_theory::Transposer > | createTransposer () const |
Creates a transposer for this Note instance. | |
NoteInfoPtr | getNext () const |
Gets the next note in a chord on the same entry. | |
NoteInfoPtr | getPrevious () const |
Gets the next note in a chord on the same entry. | |
bool | calcIsEnharmonicRespell () const |
Returns if this note is enharmonically respelled in the current part view. | |
std::pair< int, int > | calcDefaultEnharmonic () const |
Calculates the default enharmonic equivalent of this note. This is the value that Finale uses when details::NoteAlterations::enharmonic is true. | |
bool | operator< (const NoteInfoPtr &other) const |
Explicit operator< for std::map. | |
Wraps an EntryInfo instance and a note index.
|
inline |
Constructor.
entryInfo | The entry info containing the note. |
noteIndex | The index of this note within Entry::notes. |
|
inline |
Calculates the default enharmonic equivalent of this note. This is the value that Finale uses when details::NoteAlterations::enharmonic is true.
Normally you do not have to call this function directly. It is called inside calcNoteProperties. But the function is available if you need it.
Note::NoteProperties musx::dom::NoteInfoPtr::calcNoteProperties | ( | const std::optional< bool > & | enharmonicRespell = std::nullopt | ) | const |
Calculates the note name, octave number, actual alteration, and staff position. This function does not take into account percussion notes and their staff position override. To discover if a note is a percussion note, call calcPercussionNoteInfo. If it returns non-null, use that for staff position instead of this function.
enharmonicRespell | If supplied, return the default enharmonic respelling based on this value. If omitted, this value is calculated automatically based on the score or part settings. Normally you will omit it. |
Note::NoteProperties musx::dom::NoteInfoPtr::calcNotePropertiesConcert | ( | ) | const |
Calculates the note name, octave number, actual alteration, and staff position for the concert pitch of the note. This function does not take into account percussion notes and their staff position override. To discover if a note is a percussion note, call calcPercussionNoteInfo. If it returns non-null, use that for staff position instead of this function.
Note::NoteProperties musx::dom::NoteInfoPtr::calcNotePropertiesInView | ( | ) | const |
Calculates the note name, octave number, actual alteration, and staff position for the pitch of the note in view. This may be particularly useful with non-floating rests, but it can be used with any note. As with other versions of the function, it does not handle the staff position override of percussion notes.
MusxInstance< others::PercussionNoteInfo > musx::dom::NoteInfoPtr::calcPercussionNoteInfo | ( | ) | const |
Calculates the percussion note info for this note, if any.
nullptr
. NoteInfoPtr musx::dom::NoteInfoPtr::calcTieFrom | ( | bool | requireTie = true | ) | const |
Calculates the note that this note could tie from.
requireTie | If requireTie is true, the returned value must have its Note::tieStart flag set to true. You can set requireTie to false to find the potential note this note might be tied from. |
NoteInfoPtr musx::dom::NoteInfoPtr::calcTieTo | ( | ) | const |
Calculates the note that this note could tie to. Check the return value's Note::tieEnd to see if there is actually a tie end. (Note that Finale shows a tie whether there Note::tieEnd is true or not.)
std::unique_ptr< music_theory::Transposer > musx::dom::NoteInfoPtr::createTransposer | ( | ) | const |
NoteInfoPtr musx::dom::NoteInfoPtr::findEqualPitch | ( | const EntryInfoPtr & | entry | ) | const |
Finds a note with the same pitch in the supplied entry.
entry | the entry to search |
|
inline |
Gets the next note in a chord on the same entry.
|
inline |
Gets the next note in a chord on the same entry.