Deluge Firmware
1.3.0
Build date: 2026.07.29
Toggle main menu visibility
Loading...
Searching...
No Matches
state_data.h
1
/*
2
* Copyright © 2016-2023 Synthstrom Audible Limited
3
*
4
* This file is part of The Synthstrom Audible Deluge Firmware.
5
*
6
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU General Public License as published by the Free Software Foundation,
8
* either version 3 of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along with this program.
15
* If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
#include "definitions_cxx.hpp"
20
#include "gui/ui/keyboard/chords.h"
21
#include "gui/ui/keyboard/layout/column_control_state.h"
22
#include "storage/flash_storage.h"
23
24
namespace
deluge::gui::ui::keyboard {
25
26
constexpr
int32_t kDefaultIsometricRowInterval = 5;
27
struct
KeyboardStateIsomorphic
{
28
int32_t scrollOffset = (60 - (kDisplayHeight >> 2) * kDefaultIsometricRowInterval);
29
int32_t rowInterval = kDefaultIsometricRowInterval;
30
};
31
32
struct
KeyboardStateDrums
{
33
int32_t scroll_offset = 0;
34
int32_t zoom_level = 8;
35
};
36
37
constexpr
int32_t kDefaultInKeyRowInterval = 3;
38
struct
KeyboardStateInKey
{
39
// Init scales have 7 elements, multipled by three octaves gives us C1 as first pad
40
int32_t scrollOffset = (7 * 3);
41
int32_t rowInterval = kDefaultInKeyRowInterval;
42
};
43
44
struct
KeyboardStatePiano
{
45
// default octave = 1 (0 = -2oct), use a vertical scroll to change it
46
int32_t scrollOffset = 3;
47
// default note=0 (C)
48
int32_t noteOffset = 0;
49
};
50
51
struct
KeyboardStateChordLibrary
{
52
int32_t rowInterval = kOctaveSize;
53
int32_t scrollOffset = 0;
54
int32_t noteOffset = (rowInterval * 4);
55
int32_t rowColorMultiplier = 5;
56
ChordList
chordList{};
57
};
58
59
struct
KeyboardStateChord
{
60
int32_t noteOffset = (kOctaveSize * 4);
61
int32_t modOffset = 0;
62
int32_t scaleOffset = 0;
63
bool
autoVoiceLeading =
false
;
64
};
65
67
struct
KeyboardState
{
68
KeyboardLayoutType currentLayout = FlashStorage::defaultKeyboardLayout;
69
70
KeyboardStateIsomorphic
isomorphic;
71
KeyboardStateDrums
drums;
72
KeyboardStateInKey
inKey;
73
KeyboardStatePiano
piano;
74
KeyboardStateChord
chord;
75
KeyboardStateChordLibrary
chordLibrary;
76
77
layout::ColumnControlState
columnControl;
78
};
79
80
};
// namespace deluge::gui::ui::keyboard
deluge::gui::ui::keyboard::ChordList
A collection of chords.
Definition
chords.h:139
deluge::gui::ui::keyboard::KeyboardStateChordLibrary
Definition
state_data.h:51
deluge::gui::ui::keyboard::KeyboardStateChord
Definition
state_data.h:59
deluge::gui::ui::keyboard::KeyboardStateDrums
Definition
state_data.h:32
deluge::gui::ui::keyboard::KeyboardStateInKey
Definition
state_data.h:38
deluge::gui::ui::keyboard::KeyboardStateIsomorphic
Definition
state_data.h:27
deluge::gui::ui::keyboard::KeyboardStatePiano
Definition
state_data.h:44
deluge::gui::ui::keyboard::KeyboardState
Definition
state_data.h:67
deluge::gui::ui::keyboard::layout::ColumnControlState
Definition
column_control_state.h:46