audio/scale.h file

Musical scales.

Contents

See https://pianoscales.org/

Classes

struct MusicalScale
To be generated at the beginning, and then copied and reused.

Enums

enum MusicalScaleType { SCALE_CHROMATIC, SCALE_IONIAN, SCALE_AEOLIAN, SCALE_HARMONIC_MINOR, SCALE_ACOUSTIC, SCALE_ALGERIAN, SCALE_ALTERED, SCALE_AUGMENTED, SCALE_BEBOP_DOMINANT, SCALE_BLUES, SCALE_CHINESE, SCALE_DIMINISHED, SCALE_DOMINANT_DIMINISHED, SCALE_DORIAN, SCALE_DOUBLE_HARMONIC, SCALE_EIGHT_TONE_SPANISH, SCALE_ENIGMATIC, SCALE_EGYPTIAN, SCALE_FLAMENCO, SCALE_GEEZ, SCALE_GYPSY, SCALE_HALF_DIMINISHED, SCALE_HARMONIC_MAJOR, SCALE_HINDU, SCALE_HIRAJOSHI, SCALE_HUNGARIAN_GYPSY, SCALE_HUNGARIAN_MINOR, SCALE_IN, SCALE_INSEN, SCALE_ISTRIAN, SCALE_IWATO, SCALE_LOCRIAN, SCALE_LYDIAN_AUGMENTED, SCALE_LYDIAN, SCALE_MAJOR_LOCRIAN, SCALE_MAJOR_PENTATONIC, SCALE_MAQAM, SCALE_MELODIC_MINOR, SCALE_MINOR_PENTATONIC, SCALE_MIXOLYDIAN, SCALE_NEAPOLITAN_MAJOR, SCALE_NEAPOLITAN_MINOR, SCALE_OCTATONIC_HALF_WHOLE, SCALE_OCTATONIC_WHOLE_HALF, SCALE_ORIENTAL, SCALE_PERSIAN, SCALE_PHRYGIAN_DOMINANT, SCALE_PHRYGIAN, SCALE_PROMETHEUS, SCALE_ROMANIAN_MINOR, SCALE_TRITONE, SCALE_UKRANIAN_DORIAN, SCALE_WHOLE_TONE, SCALE_YO }
Scale type (name) eg Aeolian.

Typedefs

using MusicalScaleType = enum MusicalScaleType
Scale type (name) eg Aeolian.
using MusicalScale = struct MusicalScale
To be generated at the beginning, and then copied and reused.

Functions

auto musical_scale_new(MusicalScaleType type, MusicalNote root) -> MusicalScale*
Creates new scale using type and root note.
auto musical_scale_clone(MusicalScale* src) -> MusicalScale*
Clones the scale.
auto musical_scale_to_string(MusicalScale* scale) -> char*
Prints the MusicalScale to a string.
void musical_scale_strcpy(MusicalScale* scale, char* buf)
Same as above but uses a buffer instead of allocating.
static auto musical_scale_is_equal(MusicalScale* a, MusicalScale* b) -> int
Returns 1 if the scales are equal.
auto musical_scale_is_chord_in_scale(MusicalScale* scale, ChordDescriptor* chord) -> int
Returns if all of the chord's notes are in the scale.
auto musical_scale_is_accent_in_scale(MusicalScale* scale, MusicalNote chord_root, ChordType type, ChordAccent chord_accent) -> int
Returns if the accent is in the scale.
auto musical_scale_is_key_in_scale(MusicalScale* scale, MusicalNote key) -> int
Returns if the given key is in the given MusicalScale.
auto musical_scale_as_string(MusicalScale* scale) -> char*
Returns the scale in human readable string.
void musical_scale_free(MusicalScale* scale)
Frees the MusicalScale.