Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_descriptor.h File Reference

Descriptors for chords. More...

#include <cstdint>
#include "dsp/position.h"
#include "utils/yaml.h"
Include dependency graph for chord_descriptor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ChordDescriptor
 A ChordDescriptor describes a chord and is not linked to any specific object by itself. More...
 

Macros

#define CHORD_DESCRIPTOR_SCHEMA_VERSION   2
 
#define CHORD_DESCRIPTOR_MAX_NOTES   48
 

Enumerations

enum class  MusicalNote {
  NOTE_C = 0 , NOTE_CS , NOTE_D , NOTE_DS ,
  NOTE_E , NOTE_F , NOTE_FS , NOTE_G ,
  NOTE_GS , NOTE_A , NOTE_AS , NOTE_B
}
 
enum class  ChordType {
  CHORD_TYPE_NONE , CHORD_TYPE_MAJ , CHORD_TYPE_MIN , CHORD_TYPE_DIM ,
  CHORD_TYPE_SUS4 , CHORD_TYPE_SUS2 , CHORD_TYPE_AUG , CHORD_TYPE_CUSTOM
}
 Chord type. More...
 
enum class  ChordAccent {
  CHORD_ACC_NONE , ChordAccent::CHORD_ACC_7 , ChordAccent::CHORD_ACC_j7 , ChordAccent::CHORD_ACC_b9 ,
  ChordAccent::CHORD_ACC_9 , ChordAccent::CHORD_ACC_S9 , ChordAccent::CHORD_ACC_11 , ChordAccent::CHORD_ACC_b5_S11 ,
  ChordAccent::CHORD_ACC_S5_b13 , ChordAccent::CHORD_ACC_6_13
}
 Chord accents. More...
 

Functions

ChordDescriptorchord_descriptor_new (MusicalNote root, int has_bass, MusicalNote bass, ChordType type, ChordAccent accent, int inversion)
 Creates a ChordDescriptor.
 
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.
 
bool chord_descriptor_is_key_bass (ChordDescriptor *chord, MusicalNote key)
 Returns if key is the bass or root note of chord.
 
ChordDescriptorchord_descriptor_clone (const ChordDescriptor *src)
 Clones the given ChordDescriptor.
 
void chord_descriptor_copy (ChordDescriptor *dest, const ChordDescriptor *src)
 
const char * chord_descriptor_chord_type_to_string (ChordType type)
 Returns the chord type as a string (eg.
 
const char * chord_descriptor_chord_accent_to_string (ChordAccent accent)
 Returns the chord accent as a string (eg.
 
const char * chord_descriptor_note_to_string (MusicalNote note)
 Returns the musical note as a string (eg.
 
char * chord_descriptor_to_new_string (const ChordDescriptor *chord)
 Returns the chord in human readable string.
 
NONNULL void chord_descriptor_to_string (const ChordDescriptor *chord, char *str)
 Returns the chord in human readable string.
 
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.
 

Detailed Description

Descriptors for chords.

Definition in file chord_descriptor.h.