aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-08-22 12:54:55 +0200
committerBad Diode <bd@badd10de.dev>2023-08-22 12:54:55 +0200
commit06eadc45799d3183b81ce324138e98a145410bc4 (patch)
tree85124486d43a1475c9f88f9426e8c0117b12ec65
parente5d61a87ec41443a2e32cd8be1ecc62b8c590251 (diff)
downloadstepper-06eadc45799d3183b81ce324138e98a145410bc4.tar.gz
stepper-06eadc45799d3183b81ce324138e98a145410bc4.zip
Ensure ALL is shown when appropriate and drawing bugfixes
-rw-r--r--src/drawing.c18
-rw-r--r--src/main.c8
-rw-r--r--src/sequencer.c6
3 files changed, 25 insertions, 7 deletions
diff --git a/src/drawing.c b/src/drawing.c
index 253a961..3922e09 100644
--- a/src/drawing.c
+++ b/src/drawing.c
@@ -1277,7 +1277,10 @@ draw_piano_notes(void) {
1277 if (input_handler == handle_channel_selection) { 1277 if (input_handler == handle_channel_selection) {
1278 // Show note on current channel only. 1278 // Show note on current channel only.
1279 Pattern *pat = &patterns[current_pattern]; 1279 Pattern *pat = &patterns[current_pattern];
1280 u8 step = (step_counter - 1) % 16; 1280 if (pat->empty || play_status == 0) {
1281 return;
1282 }
1283 u8 step = step_counter % 16;
1281 switch (channel_selection_loc) { 1284 switch (channel_selection_loc) {
1282 case 0: { 1285 case 0: {
1283 if (pat->ch1.active && pat->ch1.notes[step].active) { 1286 if (pat->ch1.active && pat->ch1.notes[step].active) {
@@ -1295,7 +1298,6 @@ draw_piano_notes(void) {
1295 } 1298 }
1296 } break; 1299 } break;
1297 } 1300 }
1298
1299 } else if (input_handler == handle_trigger_selection || 1301 } else if (input_handler == handle_trigger_selection ||
1300 input_handler == handle_param_selection_sq1 || 1302 input_handler == handle_param_selection_sq1 ||
1301 input_handler == handle_param_selection_sq2 || 1303 input_handler == handle_param_selection_sq2 ||
@@ -1303,12 +1305,17 @@ draw_piano_notes(void) {
1303 input_handler == handle_param_selection_noise) { 1305 input_handler == handle_param_selection_noise) {
1304 // Show currently selected trigger note. 1306 // Show currently selected trigger note.
1305 TriggerNote *trig = get_current_trig(); 1307 TriggerNote *trig = get_current_trig();
1306 draw_note(trig->note, COL_OFF); 1308 if (trig->active && !patterns[pattern_selection_loc].empty) {
1309 draw_note(trig->note, COL_OFF);
1310 }
1307 } else { 1311 } else {
1308 // Show last/current played notes in all channels. 1312 // Show last/current played notes in all channels.
1309 if (play_status == 1) { 1313 if (play_status == 1) {
1310 Pattern *pat = &patterns[current_pattern]; 1314 Pattern *pat = &patterns[current_pattern];
1311 u8 step = (step_counter - 1) % 16; 1315 if (pat->empty || play_status == 0) {
1316 return;
1317 }
1318 u8 step = step_counter % 16;
1312 if (pat->ch3.active && pat->ch3.notes[step].active) { 1319 if (pat->ch3.active && pat->ch3.notes[step].active) {
1313 draw_note(pat->ch3.notes[step].note, COL_OFF); 1320 draw_note(pat->ch3.notes[step].note, COL_OFF);
1314 } 1321 }
@@ -1433,6 +1440,9 @@ draw_notif_bar() {
1433 } else { 1440 } else {
1434 params = &ch1_params; 1441 params = &ch1_params;
1435 } 1442 }
1443 if (input_handler == handle_param_selection_ch1) {
1444 txt_drawf_small("(ALL)", x0 + NOTIF_W - 7 * 3 - 3, y0 + 1, color);
1445 }
1436 switch (param_selection_loc) { 1446 switch (param_selection_loc) {
1437 case 0: { 1447 case 0: {
1438 txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); 1448 txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color);
diff --git a/src/main.c b/src/main.c
index cff3afa..e294a0f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -45,14 +45,16 @@ WITH REGARD TO THIS SOFTWARE.
45// separation and section organization. 45// separation and section organization.
46// + Pattern can be cleared on pattern view with (SEL + L + R). This is 46// + Pattern can be cleared on pattern view with (SEL + L + R). This is
47// reversible with the same combination unless the pattern is modified. 47// reversible with the same combination unless the pattern is modified.
48// - Improve SRAM saving to make room for longer patterns and/or more banks. 48// + Make sure there is an ALL notification when modifying channel params so
49// - Make sure there is an ALL notification when modifying channel params so
50// that it's clear it's affecting all triggers. 49// that it's clear it's affecting all triggers.
50// + Fix keyboard note drawing bugs.
51// + Fix stop button behaviour.
52// - Improve SRAM saving to make room for longer patterns and/or more banks.
51// - Scale mode for entering notes. 53// - Scale mode for entering notes.
52// - Add CLEAR ALL to the settings menu.
53// - Higher resolution clock to allow for microtiming and more accurate tempo. 54// - Higher resolution clock to allow for microtiming and more accurate tempo.
54// - Multiple pattern chains per bank that we can toggle between, gotta study 55// - Multiple pattern chains per bank that we can toggle between, gotta study
55// if they fit in the SRAM. 56// if they fit in the SRAM.
57// - Shortcut to quickly exit/enter chain mode.
56// - Make sure bank switching is queued like patterns. 58// - Make sure bank switching is queued like patterns.
57// - Add settings for "performance mode" in which banks are not saved by 59// - Add settings for "performance mode" in which banks are not saved by
58// default while changing patterns. 60// default while changing patterns.
diff --git a/src/sequencer.c b/src/sequencer.c
index 3110c74..04dd848 100644
--- a/src/sequencer.c
+++ b/src/sequencer.c
@@ -33,6 +33,7 @@ clear_pattern(size_t idx) {
33 redraw_channels = true; 33 redraw_channels = true;
34 redraw_trigs = true; 34 redraw_trigs = true;
35 redraw_bpm = true; 35 redraw_bpm = true;
36 redraw_params = true;
36} 37}
37 38
38void 39void
@@ -469,10 +470,13 @@ stop_sound(void) {
469 SOUND_SQUARE2_FREQ = SOUND_FREQ_RESET; 470 SOUND_SQUARE2_FREQ = SOUND_FREQ_RESET;
470 SOUND_WAVE_FREQ = SOUND_FREQ_RESET; 471 SOUND_WAVE_FREQ = SOUND_FREQ_RESET;
471 SOUND_NOISE_FREQ = SOUND_FREQ_RESET; 472 SOUND_NOISE_FREQ = SOUND_FREQ_RESET;
473 SOUND_SQUARE1_CTRL = 0;
472 SOUND_SQUARE2_CTRL = 0; 474 SOUND_SQUARE2_CTRL = 0;
473 SOUND_WAVE_CTRL = 0; 475 SOUND_WAVE_CTRL = 0;
474 SOUND_NOISE_CTRL = 0; 476 SOUND_NOISE_CTRL = 0;
475 redraw_play_pause = true; 477 redraw_play_pause = true;
478 redraw_pattern_buttons = true;
479 redraw_piano_note = true;
476} 480}
477 481
478void 482void
@@ -513,6 +517,7 @@ toggle_playing(void) {
513 SOUND_NOISE_CTRL = 0; 517 SOUND_NOISE_CTRL = 0;
514 redraw_play_pause = true; 518 redraw_play_pause = true;
515 redraw_pattern_buttons = true; 519 redraw_pattern_buttons = true;
520 redraw_piano_note = true;
516 if (settings.sync == SYNC_IN_LINK) { 521 if (settings.sync == SYNC_IN_LINK) {
517 return; 522 return;
518 } 523 }
@@ -1265,6 +1270,7 @@ handle_trigger_selection(void) {
1265 } 1270 }
1266 trig->active ^= 1; 1271 trig->active ^= 1;
1267 redraw_trigs = true; 1272 redraw_trigs = true;
1273 redraw_piano_note = true;
1268 } 1274 }
1269 } else if (key_tap(KEY_L)) { 1275 } else if (key_tap(KEY_L)) {
1270 s32 inc = -1; 1276 s32 inc = -1;