From 63e727dbe78d70e2f48bd4feef9293f61016aaeb Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Wed, 2 Aug 2023 16:51:24 +0200 Subject: Minor UI changes and bank chaining support --- src/drawing.c | 57 +++++++++++++++++++++++++++++++++------------------------ src/main.c | 11 +++++++++++ src/sequencer.c | 4 +++- 3 files changed, 47 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/drawing.c b/src/drawing.c index 3ed294e..a203f1c 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -506,9 +506,9 @@ draw_params_cursor_wave(size_t i, u8 clr) { txt_drawf_small("prob", x, y, COL_BG); } break; case 5: { - x += 6 + PARAMS_BOX_OFFSET_X * 0; + x += 4 + PARAMS_BOX_OFFSET_X * 0; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("mode", x, y, COL_BG); + txt_drawf_small("voice", x, y, COL_BG); } break; case 6: { x += 8 + PARAMS_BOX_OFFSET_X * 1; @@ -766,8 +766,10 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t y = PARAMS_START_Y; // Wave Patterns. - draw_wave_pattern(waves[params->shape_a][params->type_a], x, y, COL_ACC_1); - draw_wave_pattern(waves[params->shape_b][params->type_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2); + u8 col_wave_a = col_fg != COL_OFF && (params->wave_mode == 0 || params->wave_mode == 2) ? COL_ACC_1 : COL_OFF; + u8 col_wave_b = col_fg != COL_OFF && (params->wave_mode == 1 || params->wave_mode == 2) ? COL_ACC_2 : COL_OFF; + draw_wave_pattern(waves[params->shape_a][params->type_a], x, y, col_wave_a); + draw_wave_pattern(waves[params->shape_b][params->type_b], x + PARAMS_BOX_OFFSET_X * 2, y, col_wave_b); } // Trig probability. @@ -825,7 +827,7 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg); txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg); y += PARAMS_BOX_OFFSET_Y; - txt_drawf_small("mode", x + 6 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); + txt_drawf_small("voice", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg); } @@ -888,15 +890,16 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep, bool global) { x5 += 20; } break; } - draw_line(x0, y0, x1, y0, COL_ACC_1); - draw_line(x1, y1, x1, y0, COL_ACC_1); - draw_line(x1, y1, x2, y1, COL_ACC_1); - draw_line(x2, y1, x2, y0, COL_ACC_1); - draw_line(x2, y0, x3, y0, COL_ACC_1); - draw_line(x3, y1, x3, y0, COL_ACC_1); - draw_line(x3, y1, x4, y1, COL_ACC_1); - draw_line(x4, y1, x4, y0, COL_ACC_1); - draw_line(x4, y0, x5, y0, COL_ACC_1); + u8 col_shape = col_fg != COL_OFF ? COL_ACC_1 : COL_OFF; + draw_line(x0, y0, x1, y0, col_shape); + draw_line(x1, y1, x1, y0, col_shape); + draw_line(x1, y1, x2, y1, col_shape); + draw_line(x2, y1, x2, y0, col_shape); + draw_line(x2, y0, x3, y0, col_shape); + draw_line(x3, y1, x3, y0, col_shape); + draw_line(x3, y1, x4, y1, col_shape); + draw_line(x4, y1, x4, y0, col_shape); + draw_line(x4, y0, x5, y0, col_shape); } // Envelope. @@ -911,11 +914,12 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep, bool global) { size_t y2 = y1; // Env. + u8 col_env = col_fg != COL_OFF ? COL_ACC_2 : COL_OFF; if (params->env_time == 0) { - draw_line(x0, y0, x2, y0, COL_ACC_2); + draw_line(x0, y0, x2, y0, col_env); } else { - draw_line(x0, y0, x1, y1, COL_ACC_2); - draw_line(x1, y1, x2, y2, COL_ACC_2); + draw_line(x0, y0, x1, y1, col_env); + draw_line(x1, y1, x2, y2, col_env); } } @@ -1033,11 +1037,12 @@ draw_parameters_noise(ChannelNoiseParams* params, bool global) { size_t y2 = y1; // Env. + u8 col_env = col_fg != COL_OFF ? COL_ACC_2 : COL_OFF; if (params->env_time == 0) { - draw_line(x0, y0, x2, y0, COL_ACC_2); + draw_line(x0, y0, x2, y0, col_env); } else { - draw_line(x0, y0, x1, y1, COL_ACC_2); - draw_line(x1, y1, x2, y2, COL_ACC_2); + draw_line(x0, y0, x1, y1, col_env); + draw_line(x1, y1, x2, y2, col_env); } } @@ -1472,11 +1477,11 @@ draw_notif_bar() { } break; case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; case 5: { - txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); + txt_drawf_small("VOICE: ", x0 + 2, y0 + 1, color); switch (params->wave_mode) { - case 0: { txt_drawf_small("A", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("B", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("A + B", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 0: { txt_drawf_small("A", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("B", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("A + B", x0 + 2 + 7 * 4, y0 + 1, color); } break; } } break; case 6: { @@ -1601,6 +1606,10 @@ draw_pattern_chain() { color = COL_OFF; if (chain.current == i && chain.len != 0) { color = COL_ACC_2; + if (chain.active[i]) { + txt_drawc('A' + chain.chain[i], x0 + 4, y0 + 3, color); + } + draw_rect(x0, y0, x1, y1, color); } draw_line(x0 + 5, y1 - 2, x1 - 5, y1 - 2, color); } diff --git a/src/main.c b/src/main.c index 54eb2ef..31a9250 100644 --- a/src/main.c +++ b/src/main.c @@ -18,8 +18,14 @@ WITH REGARD TO THIS SOFTWARE. // + Allow prob control (% based or 1:2, etc.) // + Display notification when editing a parameter with the highest priority // + Add panning support. +// + Change ch3 to only color the waveform that is selected depending on the +// mode. +// + Grey out colors when foreground is also grey. +// + Bigger indicator for currently playing pattern. // - Add custom user themes // - Animations for cursor movement/current step highlight. (A fade out maybe?) +// - Improve "grey" cursor with dithering instead. +// - Remove thin cursor option and make the fat one default, it's just better. // // Quality of life improvements. // + Make the channel parameters initialize to default @@ -32,6 +38,7 @@ WITH REGARD TO THIS SOFTWARE. // // Advanced // + Per trig note probability. +// + Make it so switching banks don't stop playback. // - Add tap tempo for BPM. // - Allow "marking" several trigs to be able to copy/paste them and/or adjust // their parameters. @@ -41,6 +48,10 @@ WITH REGARD TO THIS SOFTWARE. // - Per trig LFO? How would we go about this? There is at least one empty slot // in all channels. LFO amount? LFO speed? Would need a dedicated page for // configuring LFOs +// - Multiple pattern chains per bank that we can toggle between, gotta study +// if they fit in the SRAM. +// - Scale mode for entering notes. +// - Make sure bank switching is queued like patterns. // // Bugfixes // + Sound can get hung up sometimes, but I can't reproduce when this happens. diff --git a/src/sequencer.c b/src/sequencer.c index 7f07845..6da0a9f 100644 --- a/src/sequencer.c +++ b/src/sequencer.c @@ -546,7 +546,9 @@ pause_playing(void) { void select_bank(int i) { - stop_playing(); + // TODO: queue bank if we are currently playing? + chain.current = 15; + chain.current = find_next_pattern(); clipboard.type = CLIP_EMPTY; save_bank(current_bank); metadata.current_pattern = current_pattern; -- cgit v1.2.1