aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-07-22 08:32:04 +0200
committerBad Diode <bd@badd10de.dev>2023-07-22 08:32:04 +0200
commitbac16fa2662f61cfa3b56111649685b4eb397442 (patch)
tree18f3fcc380b8dd662377408ef76d20e8acecbdcd
parent24f49419af67365907c1f072cb159719ff93fdbd (diff)
downloadstepper-bac16fa2662f61cfa3b56111649685b4eb397442.tar.gz
stepper-bac16fa2662f61cfa3b56111649685b4eb397442.zip
Fix default parameters for channel params
-rw-r--r--src/main.c14
-rw-r--r--src/patterns.c77
2 files changed, 47 insertions, 44 deletions
diff --git a/src/main.c b/src/main.c
index 09f0465..ffe60e4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -12,27 +12,27 @@ WITH REGARD TO THIS SOFTWARE.
12// TODO: A list of features I would like to get to implement in the near future. 12// TODO: A list of features I would like to get to implement in the near future.
13// 13//
14// UI tweaks. 14// UI tweaks.
15// - Add custom user themes
16// - Animations for cursor movement/current step highlight. (A fade out maybe?)
17// - Add panning support.
18// + Add new UI for the parameter pages 15// + Add new UI for the parameter pages
19// + Change cursor drawing for new parameter pages 16// + Change cursor drawing for new parameter pages
20// - Change cursor behaviour for new parameter pages 17// + Change cursor behaviour for new parameter pages
21// - Allow prob control (% based or 1:2, etc.)
22// - Display notification when editing a parameter with the highest priority 18// - Display notification when editing a parameter with the highest priority
19// - Add panning support.
20// - Allow prob control (% based or 1:2, etc.)
21// - Add custom user themes
22// - Animations for cursor movement/current step highlight. (A fade out maybe?)
23// 23//
24// Quality of life improvements. 24// Quality of life improvements.
25// + Make the channel parameters initialize to default
25// - When not on play mode, adjusting a note or a parameter triggers the sound. 26// - When not on play mode, adjusting a note or a parameter triggers the sound.
26// This could get annoying, so maybe it should be a configuration option to 27// This could get annoying, so maybe it should be a configuration option to
27// enable it? 28// enable it?
28// - Undo/Redo. 29// - Undo/Redo.
29// - Make the channel parameters initialize to default
30// 30//
31// Advanced 31// Advanced
32// - Per trig note probability.
32// - Add tap tempo for BPM. 33// - Add tap tempo for BPM.
33// - Allow "marking" several trigs to be able to copy/paste them and/or adjust 34// - Allow "marking" several trigs to be able to copy/paste them and/or adjust
34// their parameters. 35// their parameters.
35// - Per trig note probability.
36// - Add an envelope to ch3, would need to work with a timer in order to make 36// - Add an envelope to ch3, would need to work with a timer in order to make
37// it work I think. 37// it work I think.
38// - Sync via MIDI via arduinoboy or something similar. 38// - Sync via MIDI via arduinoboy or something similar.
diff --git a/src/patterns.c b/src/patterns.c
index 6b68463..799ca47 100644
--- a/src/patterns.c
+++ b/src/patterns.c
@@ -16,6 +16,7 @@ typedef struct ChannelSquareParams {
16 u8 sweep_time; 16 u8 sweep_time;
17 u8 sweep_direction; 17 u8 sweep_direction;
18 u8 prob; 18 u8 prob;
19 s8 pan;
19} ChannelSquareParams; 20} ChannelSquareParams;
20 21
21typedef struct ChannelWaveParams { 22typedef struct ChannelWaveParams {
@@ -26,6 +27,7 @@ typedef struct ChannelWaveParams {
26 u8 shape_b; 27 u8 shape_b;
27 u8 phase_b; 28 u8 phase_b;
28 u8 prob; 29 u8 prob;
30 s8 pan;
29} ChannelWaveParams; 31} ChannelWaveParams;
30 32
31typedef struct ChannelNoiseParams { 33typedef struct ChannelNoiseParams {
@@ -34,6 +36,7 @@ typedef struct ChannelNoiseParams {
34 u8 env_direction; 36 u8 env_direction;
35 u8 bit_mode; 37 u8 bit_mode;
36 u8 prob; 38 u8 prob;
39 s8 pan;
37} ChannelNoiseParams; 40} ChannelNoiseParams;
38 41
39typedef struct ChannelSquare { 42typedef struct ChannelSquare {
@@ -63,11 +66,6 @@ typedef struct Pattern {
63 u8 bank; 66 u8 bank;
64} Pattern; 67} Pattern;
65 68
66static ChannelSquareParams ch1_params = {0};
67static ChannelSquareParams ch2_params = {0};
68static ChannelWaveParams ch3_params = {0};
69static ChannelNoiseParams ch4_params = {0};
70
71// 69//
72// Defaults. 70// Defaults.
73// 71//
@@ -172,22 +170,22 @@ const ChannelWave default_ch3 = {
172 {true, NOTE_G_5}, 170 {true, NOTE_G_5},
173 }, 171 },
174 .params = { 172 .params = {
175 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 173 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
176 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 174 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
177 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 175 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
178 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 176 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
179 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 177 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
180 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 178 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
181 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 179 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
182 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 180 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
183 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 181 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
184 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 182 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
185 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 183 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
186 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 184 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
187 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 185 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
188 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 186 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
189 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 187 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
190 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, 188 {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0},
191 }, 189 },
192 .active = true, 190 .active = true,
193}; 191};
@@ -212,22 +210,22 @@ const ChannelNoise default_ch4 = {
212 {false, NOTE_E_6}, 210 {false, NOTE_E_6},
213 }, 211 },
214 .params = { 212 .params = {
215 {0xF, 0x2, 0, 0}, 213 {0xF, 0x2, 0, 0, 0},
216 {0xF, 0x2, 0, 0}, 214 {0xF, 0x2, 0, 0, 0},
217 {0xF, 0x2, 0, 0}, 215 {0xF, 0x2, 0, 0, 0},
218 {0xF, 0x2, 0, 0}, 216 {0xF, 0x2, 0, 0, 0},
219 {0xF, 0x2, 0, 0}, 217 {0xF, 0x2, 0, 0, 0},
220 {0xF, 0x2, 0, 0}, 218 {0xF, 0x2, 0, 0, 0},
221 {0xF, 0x2, 0, 0}, 219 {0xF, 0x2, 0, 0, 0},
222 {0xF, 0x2, 0, 0}, 220 {0xF, 0x2, 0, 0, 0},
223 {0xF, 0x2, 0, 0}, 221 {0xF, 0x2, 0, 0, 0},
224 {0xF, 0x2, 0, 0}, 222 {0xF, 0x2, 0, 0, 0},
225 {0xF, 0x2, 0, 0}, 223 {0xF, 0x2, 0, 0, 0},
226 {0xF, 0x2, 0, 0}, 224 {0xF, 0x2, 0, 0, 0},
227 {0xF, 0x2, 0, 0}, 225 {0xF, 0x2, 0, 0, 0},
228 {0xF, 0x2, 0, 0}, 226 {0xF, 0x2, 0, 0, 0},
229 {0xF, 0x2, 0, 0}, 227 {0xF, 0x2, 0, 0, 0},
230 {0xF, 0x2, 0, 0}, 228 {0xF, 0x2, 0, 0, 0},
231 }, 229 },
232 .active = true, 230 .active = true,
233}; 231};
@@ -244,3 +242,8 @@ static Pattern patterns[8] = {
244 {default_ch1, default_ch2, default_ch3, default_ch4, default_bpm, 0}, 242 {default_ch1, default_ch2, default_ch3, default_ch4, default_bpm, 0},
245 {default_ch1, default_ch2, default_ch3, default_ch4, default_bpm, 0}, 243 {default_ch1, default_ch2, default_ch3, default_ch4, default_bpm, 0},
246}; 244};
245
246static ChannelSquareParams ch1_params = {8, 4, 0, 2, 0, 0, 0, 0, 0};
247static ChannelSquareParams ch2_params = {8, 4, 0, 2, 0, 0, 0, 0, 0};
248static ChannelWaveParams ch3_params = {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0};
249static ChannelNoiseParams ch4_params = {0xF, 0x2, 0, 0, 0, 0};