Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
arpeggiator_rhythms.h
1
#pragma once
2
3
#include "definitions_cxx.hpp"
4
5
#include <array>
6
#include <cstdint>
7
8
typedef
struct
{
9
uint8_t length;
// the number of steps to use, between 1 and 4
10
bool
steps[6];
// the steps, whether they should play a note or a silence
11
}
ArpRhythm
;
12
13
// We define an alias for kMaxMenuValue, because the usage is more
14
// obvious that way.
15
//
16
// The connection cannot be trivially broken right, now, but it would
17
// be nice to do so.
18
//
19
// Currently:
20
// - changing the max menu value means this table is now to wrong size,
21
// which the compiler will happily notice (good)
22
// - adding arp patterns so that table grows larger than kMaxMenuValue
23
// will require changing value scaling done by computeCurrentValueForUnsignedMenuItem
24
// - changing value scaling will re-scaling values from old song file
25
//
26
// There's a test that will break if you don't read this comment and
27
// break the relationship anyhow.
28
const
int32_t kMaxPresetArpRhythm = kMaxMenuValue;
29
// const uint32_t arpRhythmActiveNotesInPattern[kMaxPresetArpRhythm + 1] = {
30
// 1, // <- 1 step
31
// 1, // <- 3 steps
32
// 2, // <-
33
// 2, // <-
34
// 3, // <- 4 steps
35
// 2, // <-
36
// 3, // <-
37
// 2, // <-
38
// 3, // <-
39
// 1, // <- 5 steps
40
// 4, // <-
41
// 2, // <-
42
// 4, // <-
43
// 2, // <-
44
// 4, // <-
45
// 2, // <-
46
// 4, // <-
47
// 2, // <-
48
// 3, // <-
49
// 3, // <-
50
// 3, // <-
51
// 3, // <-
52
// 3, // <-
53
// 3, // <-
54
// 1, // <- 6 steps
55
// 5, // <-
56
// 2, // <-
57
// 5, // <-
58
// 2, // <-
59
// 5, // <-
60
// 2, // <-
61
// 5, // <-
62
// 2, // <-
63
// 5, // <-
64
// 4, // <-
65
// 3, // <-
66
// 4, // <-
67
// 3, // <-
68
// 4, // <-
69
// 3, // <-
70
// 4, // <-
71
// 3, // <-
72
// 4, // <-
73
// 3, // <-
74
// 4, // <-
75
// 3, // <-
76
// 4, // <-
77
// 3, // <-
78
// 3, // <-
79
// 3, // <-
80
// 4, // <-
81
// };
82
const
ArpRhythm
arpRhythmPatterns[kMaxPresetArpRhythm + 1] = {
83
{1, {1, 1, 1, 1, 1, 1}},
// <- 1 step
84
{3, {1, 0, 0, 1, 1, 1}},
// <- 3 steps
85
{3, {1, 1, 0, 1, 1, 1}},
// <-
86
{3, {1, 0, 1, 1, 1, 1}},
// <-
87
{4, {1, 0, 1, 1, 1, 1}},
// <- 4 steps
88
{4, {1, 1, 0, 0, 1, 1}},
// <-
89
{4, {1, 1, 1, 0, 1, 1}},
// <-
90
{4, {1, 0, 0, 1, 1, 1}},
// <-
91
{4, {1, 1, 0, 1, 1, 1}},
// <-
92
{5, {1, 0, 0, 0, 0, 1}},
// <- 5 steps
93
{5, {1, 0, 1, 1, 1, 1}},
// <-
94
{5, {1, 1, 0, 0, 0, 1}},
// <-
95
{5, {1, 1, 1, 1, 0, 1}},
// <-
96
{5, {1, 0, 0, 0, 1, 1}},
// <-
97
{5, {1, 1, 0, 1, 1, 1}},
// <-
98
{5, {1, 0, 1, 0, 0, 1}},
// <-
99
{5, {1, 1, 1, 0, 1, 1}},
// <-
100
{5, {1, 0, 0, 1, 0, 1}},
// <-
101
{5, {1, 0, 0, 1, 1, 1}},
// <-
102
{5, {1, 1, 1, 0, 0, 1}},
// <-
103
{5, {1, 1, 0, 0, 1, 1}},
// <-
104
{5, {1, 0, 1, 1, 0, 1}},
// <-
105
{5, {1, 1, 0, 1, 0, 1}},
// <-
106
{5, {1, 0, 1, 0, 1, 1}},
// <-
107
{6, {1, 0, 0, 0, 0, 0}},
// <- 6 steps
108
{6, {1, 0, 1, 1, 1, 1}},
// <-
109
{6, {1, 1, 0, 0, 0, 0}},
// <-
110
{6, {1, 1, 1, 1, 1, 0}},
// <-
111
{6, {1, 0, 0, 0, 0, 1}},
// <-
112
{6, {1, 1, 0, 1, 1, 1}},
// <-
113
{6, {1, 0, 1, 0, 0, 0}},
// <-
114
{6, {1, 1, 1, 1, 0, 1}},
// <-
115
{6, {1, 0, 0, 0, 1, 0}},
// <-
116
{6, {1, 1, 1, 0, 1, 1}},
// <-
117
{6, {1, 0, 0, 1, 1, 1}},
// <-
118
{6, {1, 1, 1, 0, 0, 0}},
// <-
119
{6, {1, 1, 1, 1, 0, 0}},
// <-
120
{6, {1, 0, 0, 0, 1, 1}},
// <-
121
{6, {1, 1, 0, 0, 1, 1}},
// <-
122
{6, {1, 0, 1, 1, 0, 0}},
// <-
123
{6, {1, 1, 1, 0, 0, 1}},
// <-
124
{6, {1, 0, 0, 1, 1, 0}},
// <-
125
{6, {1, 0, 1, 0, 1, 1}},
// <-
126
{6, {1, 1, 0, 1, 0, 0}},
// <-
127
{6, {1, 1, 1, 0, 1, 0}},
// <-
128
{6, {1, 0, 0, 1, 0, 1}},
// <-
129
{6, {1, 0, 1, 1, 1, 0}},
// <-
130
{6, {1, 1, 0, 0, 0, 1}},
// <-
131
{6, {1, 1, 0, 0, 1, 0}},
// <-
132
{6, {1, 0, 1, 0, 0, 1}},
// <-
133
{6, {1, 1, 0, 1, 0, 1}},
// <-
134
};
135
136
const
std::array<char const*, kMaxPresetArpRhythm + 1> arpRhythmPatternNames = {
137
"None"
,
// <- 0, No rhythm: play all notes
138
139
// 3 steps
140
"0--"
,
// <- 1
141
142
"00-"
,
// <- 2
143
"0-0"
,
// <- 3
144
145
// 4 steps
146
"0-00"
,
// <- 4
147
"00--"
,
// <- 5
148
149
"000-"
,
// <- 6
150
"0--0"
,
// <- 7
151
152
"00-0"
,
// <- 8
153
154
// 5 steps
155
"0----"
,
// <- 9
156
157
"0-000"
,
// <- 10
158
"00---"
,
// <- 11
159
160
"0000-"
,
// <- 12
161
"0---0"
,
// <- 13
162
163
"00-00"
,
// <- 14
164
"0-0--"
,
// <- 15
165
166
"000-0"
,
// <- 16
167
"0--0-"
,
// <- 17
168
169
"0--00"
,
// <- 18
170
"000--"
,
// <- 19
171
172
"00--0"
,
// <- 20
173
"0-00-"
,
// <- 21
174
175
"00-0-"
,
// <- 22
176
"0-0-0"
,
// <- 23
177
178
// 6 steps
179
"0-----"
,
// <- 24
180
181
"0-0000"
,
// <- 25
182
"00----"
,
// <- 26
183
184
"00000-"
,
// <- 27
185
"0----0"
,
// <- 28
186
187
"00-000"
,
// <- 29
188
"0-0---"
,
// <- 30
189
190
"0000-0"
,
// <- 31
191
"0---0-"
,
// <- 32
192
193
"000-00"
,
// <- 33
194
195
"0--000"
,
// <- 34
196
"000---"
,
// <- 35
197
198
"0000--"
,
// <- 36
199
"0---00"
,
// <- 37
200
201
"00--00"
,
// <- 38
202
"0-00--"
,
// <- 39
203
204
"000--0"
,
// <- 40
205
"0--00-"
,
// <- 41
206
207
"0-0-00"
,
// <- 42
208
"00-0--"
,
// <- 43
209
210
"000-0-"
,
// <- 44
211
"0--0-0"
,
// <- 45
212
213
"0-000-"
,
// <- 46
214
"00---0"
,
// <- 47
215
216
"00--0-"
,
// <- 48
217
"0-0--0"
,
// <- 49
218
"00-0-0"
,
// <- 50
219
220
};
ArpRhythm
Definition
arpeggiator_rhythms.h:8