A ChordDescriptor describes a chord and is not linked to any specific object by itself.
More...
#include <src/dsp/chord_descriptor.h>
|
| NLOHMANN_DEFINE_TYPE_INTRUSIVE(ChordDescriptor, has_bass_, root_note_, bass_note_, type_, accent_, notes_, inversion_) public MusicalNote | root_note_ = MusicalNote::C |
| | Has bass note or not.
|
| MusicalNote | bass_note_ = MusicalNote::C |
| | Bass note 1 octave below.
|
| ChordType | type_ = ChordType::None |
| | Chord type.
|
| ChordAccent | accent_ = ChordAccent::None |
| | Chord accent.
|
| std::array< bool, MAX_NOTES > | notes_ {} |
| | Only used if custom chord.
|
| int | inversion_ = 0 |
| | 0 no inversion, less than 0 highest note(s) drop an octave, greater than 0 lowest note(s) receive an octave.
|
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
Chord objects should include a ChordDescriptor.
Definition at line 82 of file chord_descriptor.h.
◆ ChordDescriptor()
| zrythm::dsp::ChordDescriptor::ChordDescriptor |
( |
MusicalNote | root, |
|
|
bool | has_bass, |
|
|
MusicalNote | bass, |
|
|
ChordType | type, |
|
|
ChordAccent | accent, |
|
|
int | inversion ) |
|
inline |
◆ chord_accent_to_string()
| utils::Utf8String zrythm::dsp::ChordDescriptor::chord_accent_to_string |
( |
ChordAccent | accent | ) |
|
|
static |
Returns the chord accent as a string (eg.
"j7").
◆ chord_type_to_string()
| utils::Utf8String zrythm::dsp::ChordDescriptor::chord_type_to_string |
( |
ChordType | type | ) |
|
|
static |
Returns the chord type as a string (eg.
"aug").
◆ get_max_inversion()
| int zrythm::dsp::ChordDescriptor::get_max_inversion |
( |
| ) |
const |
|
inline |
◆ get_min_inversion()
| int zrythm::dsp::ChordDescriptor::get_min_inversion |
( |
| ) |
const |
|
inline |
◆ is_key_bass()
| bool zrythm::dsp::ChordDescriptor::is_key_bass |
( |
MusicalNote | key | ) |
const |
Returns if key is the bass or root note of chord.
- Parameters
-
| key | A note inside a single octave (0-11). |
◆ is_key_in_chord()
| bool zrythm::dsp::ChordDescriptor::is_key_in_chord |
( |
MusicalNote | key | ) |
const |
Returns if the given key is in the chord represented by the given ChordDescriptor.
- Parameters
-
| key | A note inside a single octave (0-11). |
◆ note_to_string()
Returns the musical note as a string (eg.
"C3").
◆ operator==
◆ accent_
| ChordAccent zrythm::dsp::ChordDescriptor::accent_ = ChordAccent::None |
◆ bass_note_
| MusicalNote zrythm::dsp::ChordDescriptor::bass_note_ = MusicalNote::C |
◆ inversion_
| int zrythm::dsp::ChordDescriptor::inversion_ = 0 |
0 no inversion, less than 0 highest note(s) drop an octave, greater than 0 lowest note(s) receive an octave.
Definition at line 229 of file chord_descriptor.h.
◆ MAX_NOTES
| size_t zrythm::dsp::ChordDescriptor::MAX_NOTES = 48 |
|
staticconstexpr |
◆ notes_
| std::array<bool, MAX_NOTES> zrythm::dsp::ChordDescriptor::notes_ {} |
Only used if custom chord.
4 octaves, 1st octave is where bass note is, but bass note should not be part of this.
Starts at C always, from MIDI pitch 36.
Definition at line 222 of file chord_descriptor.h.
◆ root_note_
◆ type_
| ChordType zrythm::dsp::ChordDescriptor::type_ = ChordType::None |
The documentation for this class was generated from the following file: