|
Cmper | getKeyMode () const |
| Returns the key mode.
|
|
int | getAlteration () const |
| For linear keys, returns the number of sharps or flats from -7..7.
|
|
bool | isLinear () const |
| whether this is a linear key
|
|
bool | isNonLinear () const |
| whether this is a non-linear key
|
|
bool | isBuiltIn () const |
| whether this is a built-in key
|
|
bool | isMajor () const |
| whether this is a built-in major key
|
|
bool | isMinor () const |
| whether this is a built-in minor key
|
|
bool | isSame (const KeySignature &src) |
| returns whether the two key signatures represent the same key signature. Does not take into account transposition.
|
|
void | setTransposition (int interval, int keyAdjustment, bool simplify) |
| Transposes the key by the specified amounts. Set them to zero to remove transposition.
|
|
int | calcTonalCenterIndex () const |
| Calculates the tonal center index for the key, where C=0, D=1, E=2, ...
|
|
int | getOctaveDisplacement () const |
| The octave displacement if this key is a transposed key.
|
|
int | calcAlterationOnNote (unsigned noteIndex) const |
| Calculates the amount of alteration on a note int the key.
|
|
int | calcEDODivisions () const |
| Calculates the number of EDO division for the key. (The standard value is 12.)
|
|
std::optional< std::vector< int > > | calcKeyMap () const |
| Calculates the key's diatonic key map.
|
|
std::unique_ptr< music_theory::Transposer > | createTransposer (int displacement, int alteration) const |
| Creates a transposer for this KeySignature instance.
|
|
void | integrityCheck () override |
| 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.
|
|
| CommonClassBase (const DocumentWeakPtr &document) |
| Constructs a CommonClassBase object.
|
|
| CommonClassBase (const DocumentWeakPtr &document) |
| Constructs a CommonClassBase object.
|
|
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 bool | requireAllFields () const |
| Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class.
|
|
|
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.
|
|
std::shared_ptr< others::PartDefinition > | getPartDefinition () const |
| Gets the others::PartDefinition corresponding to getPartId.
|
|
Cmper | getPartId () const |
| Gets the partId for this instance (or 0 for score)
|
|
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 )
|
|
| 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
|
|
Shared key signature class that is contained in other classes. (See others::Measure)
int musx::dom::KeySignature::calcTonalCenterIndex |
( |
| ) |
const |
Calculates the tonal center index for the key, where C=0, D=1, E=2, ...
This is the modal tonal center, so a minor key with no sharps or flats returns 5 (=A).
Cmper musx::dom::KeySignature::getKeyMode |
( |
| ) |
const |
|
inline |
Returns the key mode.
For linear keys, this is a value from 0..127 where 0 is reserved for built-in major keys and 1 is reserved for built-in minor keys. Values from 2..127 are user-defined linear modes and are a Cmper value for finding the custom key signature information related to the key. User-defined linear keys might, for example, represent diatonic jazz modes or church modes. They can also be used to define microtonal scales with key signatures.
For non-linear keys, this is a value from 0x4000..0x4fff. This is a Cmper that is used to find all the custom key signature information that defines the key. These are sometimes used to define modes like Klezmer Freyish mode, or other modes whose accidentals do not follow the circle of fifths. They can also be used to define microtonal scales without key signatures.
Values from 0x8000 and higher are invalid.
void musx::dom::KeySignature::setTransposition |
( |
int |
interval, |
|
|
int |
keyAdjustment, |
|
|
bool |
simplify |
|
) |
| |
Transposes the key by the specified amounts. Set them to zero to remove transposition.
This is used to adjust the key signature for staves that use Key Signature transposition. Staves that use Chromatic transposition do not transpose the key. They transpose the pitches directly.
Finale works pretty well with key signature transposition in microtone scales. However, it does not simplify key signatures usefully. This function simplifies them correctly, provided that the step values for accidentals are set to cycle through sharps and flats by chromatic half-steps rather than the default of 1. See others::AcciAmountSharps and others::AcciAmountFlats.
- Parameters
-
interval | The interval by which to transpose. |
keyAdjustment | The key adjustment (positive for sharps, negative for flats) |
simplify | If true, enharmonically adjust the key to have 6 or fewer accidentals |