|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Musical scale descriptor. More...
#include <src/dsp/musical_scale.h>


Public Types | |
| enum class | ScaleType : std::uint8_t { Chromatic , Major , Minor , Ionian , Dorian , Phrygian , Lydian , Mixolydian , Aeolian , Locrian , MelodicMinor , HarmonicMinor , WholeTone , MajorPentatonic , MinorPentatonic , OctatonicHalfWhole , OctatonicWholeHalf , Acoustic , HarmonicMajor , PhrygianDominant , MajorLocrian , Algerian , Augmented , DoubleHarmonic , Chinese , Diminished , DominantDiminished , Egyptian , EightToneSpanish , Enigmatic , Geez , Hindu , Hirajoshi , HungarianGypsy , Insen , NeapolitanMajor , NeapolitanMinor , Oriental , RomanianMinor , Altered , Maqam , Yo , BebopLocrian , BebopDominant , BebopMajor , SuperLocrian , EnigmaticMinor , Composite , Bhairav , HungarianMinor , Persian , Iwato , Kumoi , Pelog , Prometheus , PrometheusNeapolitan , PrometheusLiszt , Balinese , Ragatodi , Japanese1 , Japanese2 , Blues , Flamenco , Gypsy , HalfDiminished , In , Istrian , LydianAugmented , Tritone , UkranianDorian } |
| Scale type (name) eg Aeolian. More... | |
Public Member Functions | |
| MusicalScale (QObject *parent=nullptr) | |
| MusicalScale (ScaleType type, MusicalNote root, QObject *parent=nullptr) | |
| auto | scaleType () const |
| void | setScaleType (ScaleType type) |
| Q_SIGNAL void | scaleTypeChanged (ScaleType type) |
| auto | rootKey () const |
| void | setRootKey (MusicalNote root_key) |
| Q_SIGNAL void | rootKeyChanged (MusicalNote root_key) |
| Q_INVOKABLE QString | toString () const |
| Q_INVOKABLE bool | containsNote (MusicalNote note) const |
| Returns if the given key is in the given MusicalScale. | |
| utils::Utf8String | to_string () const |
| Prints the MusicalScale to a string. | |
| bool | contains_chord (const ChordDescriptor &chord) const |
| Returns if all of the chord's notes are in the scale. | |
| bool | is_accent_in_scale (MusicalNote chord_root, ChordType type, ChordAccent chord_accent) const |
| Returns if the accent is in the scale. | |
| bool | is_same_scale (const MusicalScale &other) const |
Static Public Member Functions | |
| static const bool * | get_notes_for_type (ScaleType type, bool ascending) |
| Returns the notes in the given scale. | |
| static std::array< ChordType, 12 > | get_triad_types_for_type (ScaleType type, bool ascending) |
| Returns the triads in the given scale. | |
| static utils::Utf8String | type_to_string (ScaleType type) |
Properties | |
| ScaleType | scaleType |
| zrythm::dsp::MusicalNote | rootKey |
Friends | |
| void | init_from (MusicalScale &obj, const MusicalScale &other, utils::ObjectCloneType clone_type) |
Musical scale descriptor.
Definition at line 21 of file musical_scale.h.
|
strong |
Scale type (name) eg Aeolian.
| Enumerator | |
|---|---|
| Chromatic | All keys. |
| Minor | Natural minor. |
| Ionian | Major (same as SCALE_MAJOR). |
| Aeolian | Natural minor (same as Minor). |
| Acoustic | Lydian dominant. |
Definition at line 33 of file musical_scale.h.
|
inline |
Definition at line 129 of file musical_scale.h.
|
inline |
Definition at line 130 of file musical_scale.h.
| Q_INVOKABLE bool zrythm::dsp::MusicalScale::containsNote | ( | MusicalNote | note | ) | const |
Returns if the given key is in the given MusicalScale.
| note | A note inside a single octave (0-11). |
|
static |
Returns the notes in the given scale.
| ascending | Whether to get the notes when ascending or descending (some scales have different notes when rising/falling). |
|
static |
Returns the triads in the given scale.
There will be as many chords are enabled notes in the scale, and the rest of the array will be filled with CHORD_TYPE_NONE.
| ascending | Whether to get the triads when ascending or descending (some scales have different triads when rising/falling). |
|
inline |
Definition at line 218 of file musical_scale.h.
|
inline |
Definition at line 155 of file musical_scale.h.
|
inline |
Definition at line 143 of file musical_scale.h.
|
inline |
Definition at line 156 of file musical_scale.h.
|
inline |
Definition at line 144 of file musical_scale.h.
|
inline |
Definition at line 167 of file musical_scale.h.
|
friend |
Definition at line 224 of file musical_scale.h.
|
readwrite |
Definition at line 25 of file musical_scale.h.
|
readwrite |
Definition at line 24 of file musical_scale.h.