From 06eadc45799d3183b81ce324138e98a145410bc4 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 22 Aug 2023 12:54:55 +0200 Subject: Ensure ALL is shown when appropriate and drawing bugfixes --- src/drawing.c | 18 ++++++++++++++---- src/main.c | 8 +++++--- src/sequencer.c | 6 ++++++ 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) { if (input_handler == handle_channel_selection) { // Show note on current channel only. Pattern *pat = &patterns[current_pattern]; - u8 step = (step_counter - 1) % 16; + if (pat->empty || play_status == 0) { + return; + } + u8 step = step_counter % 16; switch (channel_selection_loc) { case 0: { if (pat->ch1.active && pat->ch1.notes[step].active) { @@ -1295,7 +1298,6 @@ draw_piano_notes(void) { } } break; } - } else if (input_handler == handle_trigger_selection || input_handler == handle_param_selection_sq1 || input_handler == handle_param_selection_sq2 || @@ -1303,12 +1305,17 @@ draw_piano_notes(void) { input_handler == handle_param_selection_noise) { // Show currently selected trigger note. TriggerNote *trig = get_current_trig(); - draw_note(trig->note, COL_OFF); + if (trig->active && !patterns[pattern_selection_loc].empty) { + draw_note(trig->note, COL_OFF); + } } else { // Show last/current played notes in all channels. if (play_status == 1) { Pattern *pat = &patterns[current_pattern]; - u8 step = (step_counter - 1) % 16; + if (pat->empty || play_status == 0) { + return; + } + u8 step = step_counter % 16; if (pat->ch3.active && pat->ch3.notes[step].active) { draw_note(pat->ch3.notes[step].note, COL_OFF); } @@ -1433,6 +1440,9 @@ draw_notif_bar() { } else { params = &ch1_params; } + if (input_handler == handle_param_selection_ch1) { + txt_drawf_small("(ALL)", x0 + NOTIF_W - 7 * 3 - 3, y0 + 1, color); + } switch (param_selection_loc) { case 0: { 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. // separation and section organization. // + Pattern can be cleared on pattern view with (SEL + L + R). This is // reversible with the same combination unless the pattern is modified. -// - Improve SRAM saving to make room for longer patterns and/or more banks. -// - Make sure there is an ALL notification when modifying channel params so +// + Make sure there is an ALL notification when modifying channel params so // that it's clear it's affecting all triggers. +// + Fix keyboard note drawing bugs. +// + Fix stop button behaviour. +// - Improve SRAM saving to make room for longer patterns and/or more banks. // - Scale mode for entering notes. -// - Add CLEAR ALL to the settings menu. // - Higher resolution clock to allow for microtiming and more accurate tempo. // - Multiple pattern chains per bank that we can toggle between, gotta study // if they fit in the SRAM. +// - Shortcut to quickly exit/enter chain mode. // - Make sure bank switching is queued like patterns. // - Add settings for "performance mode" in which banks are not saved by // 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) { redraw_channels = true; redraw_trigs = true; redraw_bpm = true; + redraw_params = true; } void @@ -469,10 +470,13 @@ stop_sound(void) { SOUND_SQUARE2_FREQ = SOUND_FREQ_RESET; SOUND_WAVE_FREQ = SOUND_FREQ_RESET; SOUND_NOISE_FREQ = SOUND_FREQ_RESET; + SOUND_SQUARE1_CTRL = 0; SOUND_SQUARE2_CTRL = 0; SOUND_WAVE_CTRL = 0; SOUND_NOISE_CTRL = 0; redraw_play_pause = true; + redraw_pattern_buttons = true; + redraw_piano_note = true; } void @@ -513,6 +517,7 @@ toggle_playing(void) { SOUND_NOISE_CTRL = 0; redraw_play_pause = true; redraw_pattern_buttons = true; + redraw_piano_note = true; if (settings.sync == SYNC_IN_LINK) { return; } @@ -1265,6 +1270,7 @@ handle_trigger_selection(void) { } trig->active ^= 1; redraw_trigs = true; + redraw_piano_note = true; } } else if (key_tap(KEY_L)) { s32 inc = -1; -- cgit v1.2.1