Brick Groove Machine 0.9.3
Firmware embarqué pour contrôleur/synthé Brick
 
Chargement...
Recherche...
Aucune correspondance
kbd_chords_dict.h
Aller à la documentation de ce fichier.
1
7#ifndef BRICK_UI_KBD_CHORDS_DICT_H
8#define BRICK_UI_KBD_CHORDS_DICT_H
9
10#include <stdint.h>
11#include <stdbool.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/* Gammes (aligné ui_keyboard_app) */
18enum {
26};
27
28/* Masque chord-buttons (8 bits) */
29#define KBD_CH_BASE_MAJOR (1u << 0) /* [0,4,7] */
30#define KBD_CH_BASE_MINOR (1u << 1) /* [0,3,7] */
31#define KBD_CH_BASE_SUS4 (1u << 2) /* [0,5,7] */
32#define KBD_CH_BASE_DIM (1u << 3) /* [0,3,6] */
33
34#define KBD_CH_EXT_7 (1u << 4) /* [+10] */
35#define KBD_CH_EXT_MAJ7 (1u << 5) /* [+11] */
36#define KBD_CH_EXT_6 (1u << 6) /* [+9] */
37#define KBD_CH_EXT_9 (1u << 7) /* [+14] */
38
39#define KBD_CH_MASK_BASES (KBD_CH_BASE_MAJOR | KBD_CH_BASE_MINOR | KBD_CH_BASE_SUS4 | KBD_CH_BASE_DIM)
40#define KBD_CH_MASK_EXTS (KBD_CH_EXT_7 | KBD_CH_EXT_MAJ7 | KBD_CH_EXT_6 | KBD_CH_EXT_9)
41
42bool kbd_chords_dict_build(uint8_t chord_mask, uint8_t *intervals, uint8_t *count);
43int8_t kbd_scale_slot_semitone_offset(uint8_t scale_id, uint8_t slot);
44
45#ifdef TEST
46bool kbd_chords_dict_selftest(void);
47#endif
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif /* BRICK_UI_KBD_CHORDS_DICT_H */
@ KBD_SCALE_ID_MAJOR
Definition kbd_chords_dict.h:19
@ KBD_SCALE_ID_PENT_MINOR
Definition kbd_chords_dict.h:24
@ KBD_SCALE_ID_PENT_MAJOR
Definition kbd_chords_dict.h:23
@ KBD_SCALE_ID_DORIAN
Definition kbd_chords_dict.h:21
@ KBD_SCALE_ID_MIXOLYDIAN
Definition kbd_chords_dict.h:22
@ KBD_SCALE_ID_CHROMATIC
Definition kbd_chords_dict.h:25
@ KBD_SCALE_ID_NAT_MINOR
Definition kbd_chords_dict.h:20
bool kbd_chords_dict_build(uint8_t chord_mask, uint8_t *intervals, uint8_t *count)
Definition kbd_chords_dict.c:36
int8_t kbd_scale_slot_semitone_offset(uint8_t scale_id, uint8_t slot)
Definition kbd_chords_dict.c:60