Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_editor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_CHORD_EDITOR_H__
11#define __GUI_BACKEND_CHORD_EDITOR_H__
12
14#include "dsp/scale.h"
16#include "utils/yaml.h"
17
18typedef struct ChordDescriptor ChordDescriptor;
19typedef struct ChordPreset ChordPreset;
20
27#define CHORD_EDITOR_SCHEMA_VERSION 1
28
29#define CHORD_EDITOR (CLIP_EDITOR->chord_editor)
30
31#define CHORD_EDITOR_NUM_CHORDS 12
32
36typedef struct ChordEditor
37{
45 int num_chords;
46
47 EditorSettings editor_settings;
49
54void
56
60void
62
64chord_editor_clone (ChordEditor * src);
65
66void
67chord_editor_apply_single_chord (
68 ChordEditor * self,
69 const ChordDescriptor * chord,
70 const int idx,
71 bool undoable);
72
73void
74chord_editor_apply_chords (
75 ChordEditor * self,
76 const ChordDescriptor ** chords,
77 bool undoable);
78
79void
80chord_editor_apply_preset (ChordEditor * self, ChordPreset * pset, bool undoable);
81
82void
83chord_editor_apply_preset_from_scale (
84 ChordEditor * self,
85 MusicalScaleType scale,
86 MusicalNote root_note,
87 bool undoable);
88
89void
90chord_editor_transpose_chords (ChordEditor * self, bool up, bool undoable);
91
97NONNULL ChordDescriptor *
99 const ChordEditor * self,
100 midi_byte_t note_number);
101
102NONNULL int
103chord_editor_get_chord_index (
104 const ChordEditor * self,
105 const ChordDescriptor * chord);
106
108chord_editor_new (void);
109
110void
111chord_editor_free (ChordEditor * self);
112
117#endif
Descriptors for chords.
Common editor settings.
MusicalScaleType
Scale type (name) eg Aeolian.
Definition scale.h:33
void chord_editor_init_loaded(ChordEditor *self)
Inits the ChordEditor after a Project has been loaded.
void chord_editor_init(ChordEditor *self)
Initializes the ChordEditor.
NONNULL ChordDescriptor * chord_editor_get_chord_from_note_number(const ChordEditor *self, midi_byte_t note_number)
Returns the ChordDescriptor for the given note number, otherwise NULL if the given note number is not...
uint8_t midi_byte_t
MIDI byte.
Definition types.h:36
Musical scales.
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
Backend for the chord editor.
ChordDescriptor * chords[128]
The chords to show on the left.
A preset of chord descriptors.
Common editor settings.
YAML utils.