10#ifndef __AUDIO_CHORD_DESCRIPTOR_H__
11#define __AUDIO_CHORD_DESCRIPTOR_H__
24#define CHORD_DESCRIPTOR_SCHEMA_VERSION 2
26#define CHORD_DESCRIPTOR_MAX_NOTES 48
122 int notes[CHORD_DESCRIPTOR_MAX_NOTES];
150 case ChordAccent::CHORD_ACC_NONE:
175 return -chord_descriptor_get_max_inversion (self);
179chord_descriptor_are_notes_equal (
int * notes_a,
int * notes_b)
182 for (
int i = 0; i < 36; i++)
184 if (notes_a[i] != notes_b[i])
195 && chord_descriptor_are_notes_equal (a->
notes, b->
notes)
bool chord_descriptor_is_key_in_chord(ChordDescriptor *chord, MusicalNote key)
Returns if the given key is in the chord represented by the given ChordDescriptor.
ChordAccent
Chord accents.
ChordDescriptor * chord_descriptor_clone(const ChordDescriptor *src)
Clones the given ChordDescriptor.
const char * chord_descriptor_note_to_string(MusicalNote note)
Returns the musical note as a string (eg.
NONNULL void chord_descriptor_to_string(const ChordDescriptor *chord, char *str)
Returns the chord in human readable string.
const char * chord_descriptor_chord_accent_to_string(ChordAccent accent)
Returns the chord accent as a string (eg.
ChordDescriptor * chord_descriptor_new(MusicalNote root, int has_bass, MusicalNote bass, ChordType type, ChordAccent accent, int inversion)
Creates a ChordDescriptor.
char * chord_descriptor_to_new_string(const ChordDescriptor *chord)
Returns the chord in human readable string.
const char * chord_descriptor_chord_type_to_string(ChordType type)
Returns the chord type as a string (eg.
NONNULL void chord_descriptor_update_notes(ChordDescriptor *self)
Updates the notes array based on the current settings.
NONNULL void chord_descriptor_free(ChordDescriptor *self)
Frees the ChordDescriptor.
bool chord_descriptor_is_key_bass(ChordDescriptor *chord, MusicalNote key)
Returns if key is the bass or root note of chord.
@ CHORD_ACC_S9
15 semitones.
@ CHORD_ACC_S5_b13
8 and 16 semitones.
@ CHORD_ACC_b9
13 semitones.
@ CHORD_ACC_b5_S11
6 and 18 semitones.
@ CHORD_ACC_11
17 semitones.
@ CHORD_ACC_9
14 semitones.
@ CHORD_ACC_7
b7 is 10 semitones from chord root, or 9 if the chord is diminished.
@ CHORD_ACC_j7
Maj7 is 11 semitones from the root.
@ CHORD_ACC_6_13
9 and 21 semitones.
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
int notes[CHORD_DESCRIPTOR_MAX_NOTES]
Only used if custom chord.
ChordAccent accent
Chord accent.
MusicalNote bass_note
Bass note 1 octave below.
bool has_bass
Has bass note or not.
int inversion
0 no inversion, less than 0 highest note(s) drop an octave, greater than 0 lowest note(s) receive an ...
MusicalNote root_note
Root note.
ChordType type
Chord type.