From 22225331c93b254aa926d76d2c50b5438f12586d Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 22 Jul 2023 11:18:41 +0200 Subject: Add parameter notifications when editing --- src/drawing.c | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- src/main.c | 2 +- src/patterns.c | 4 +- src/sequencer.c | 14 +- 4 files changed, 396 insertions(+), 18 deletions(-) diff --git a/src/drawing.c b/src/drawing.c index 8fef74f..c076886 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -486,9 +486,9 @@ draw_params_cursor_wave(size_t i, u8 clr) { txt_drawf_small("shape", x, y, COL_BG); } break; case 1: { - x += 4 + PARAMS_BOX_OFFSET_X * 1; + x += 6 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7; - txt_drawf_small("phase", x, y, COL_BG); + txt_drawf_small("type", x, y, COL_BG); } break; case 2: { x += 4 + PARAMS_BOX_OFFSET_X * 2; @@ -496,9 +496,9 @@ draw_params_cursor_wave(size_t i, u8 clr) { txt_drawf_small("shape", x, y, COL_BG); } break; case 3: { - x += 4 + PARAMS_BOX_OFFSET_X * 3; + x += 6 + PARAMS_BOX_OFFSET_X * 3; y += PARAMS_BOX_H - 7; - txt_drawf_small("phase", x, y, COL_BG); + txt_drawf_small("type", x, y, COL_BG); } break; case 4: { x += 6 + PARAMS_BOX_OFFSET_X * 4; @@ -724,8 +724,8 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t y = PARAMS_START_Y; // Wave Patterns. - draw_wave_pattern(waves[params->shape_a][params->phase_a], x, y, COL_ACC_1); - draw_wave_pattern(waves[params->shape_b][params->phase_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2); + 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); } // Trig probability. @@ -760,9 +760,9 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); - txt_drawf_small("phase", x + 4 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); + txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, col_fg); - txt_drawf_small("phase", x + 4 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg); + 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); @@ -1182,6 +1182,384 @@ draw_notif_bar() { } txt_drawf_small(msg, x0 + 2, y0 + 1, color); } else { + Pattern *pat = &patterns[pattern_selection_loc]; + if (input_handler == handle_param_selection_sq1 + || input_handler == handle_param_selection_ch1) { + ChannelSquareParams *params; + if (input_handler == handle_param_selection_sq1) { + params = &pat->ch1.params[trig_selection_loc]; + } else { + params = &ch1_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); + switch (params->duty_cycle) { + case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; + } + } break; + case 1: { + txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); + switch (params->env_volume) { + case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; + } + } break; + case 2: { + txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); + switch (params->env_time) { + case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; + } + } break; + case 3: { + txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); + switch (params->env_direction) { + case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; + } + } break; + case 4: { + txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); + switch (params->prob) { + case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + } + } break; + case 5: { + txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); + switch (params->sweep_number) { + case 0: { txt_drawf_small("0", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("1", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("2", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("3", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("4", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("5", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("6", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("7", x0 + 2 + 12 * 4, y0 + 1, color); } break; + } + } break; + case 6: { + txt_drawf_small("SWEEP TIME: ", x0 + 2, y0 + 1, color); + switch (params->sweep_time) { + case 0: { txt_drawf_small("off", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("7ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("15ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("23ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("31ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("39ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("46ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("54ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + } + } break; + case 7: { + txt_drawf_small("SWEEP DIRECTION: ", x0 + 2, y0 + 1, color); + switch (params->sweep_direction) { + case 0: { txt_drawf_small("up", x0 + 2 + 17 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("down", x0 + 2 + 17 * 4, y0 + 1, color); } break; + } + } break; + } + return; + } + + if (input_handler == handle_param_selection_sq2 + || input_handler == handle_param_selection_ch2) { + ChannelSquareParams *params; + if (input_handler == handle_param_selection_sq2) { + params = &pat->ch2.params[trig_selection_loc]; + } else { + params = &ch2_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); + switch (params->duty_cycle) { + case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; + } + } break; + case 1: { + txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); + switch (params->env_volume) { + case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; + } + } break; + case 2: { + txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); + switch (params->env_time) { + case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; + } + } break; + case 3: { + txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); + switch (params->env_direction) { + case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; + } + } break; + case 4: { + txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); + switch (params->prob) { + case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + } + } break; + } + return; + } + + if (input_handler == handle_param_selection_wave + || input_handler == handle_param_selection_ch3) { + ChannelWaveParams *params; + if (input_handler == handle_param_selection_wave) { + params = &pat->ch3.params[trig_selection_loc]; + } else { + params = &ch3_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("SHAPE A: ", x0 + 2, y0 + 1, color); + switch (params->shape_a) { + case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; + } + } break; + case 1: { + txt_drawf_small("TYPE A: ", x0 + 2, y0 + 1, color); + switch (params->type_a) { + case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; + } + } break; + case 2: { + txt_drawf_small("SHAPE B: ", x0 + 2, y0 + 1, color); + switch (params->shape_b) { + case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; + } + } break; + case 3: { + txt_drawf_small("TYPE B: ", x0 + 2, y0 + 1, color); + switch (params->type_b) { + case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; + } + } break; + case 4: { + txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); + switch (params->prob) { + case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + } + } break; + case 5: { + txt_drawf_small("MODE: ", 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; + } + } break; + case 6: { + txt_drawf_small("VOLUME: ", x0 + 2, y0 + 1, color); + switch (params->wave_volume) { + case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); } break; + } + } break; + } + return; + } + + if (input_handler == handle_param_selection_noise + || input_handler == handle_param_selection_ch4) { + ChannelNoiseParams *params; + if (input_handler == handle_param_selection_noise) { + params = &pat->ch4.params[trig_selection_loc]; + } else { + params = &ch4_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); + switch (params->bit_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; + } + } break; + case 1: { + txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); + switch (params->env_volume) { + case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; + case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; + } + } break; + case 2: { + txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); + switch (params->env_time) { + case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; + } + } break; + case 3: { + txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); + switch (params->env_direction) { + case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; + } + } break; + case 4: { + txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); + switch (params->prob) { + case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; + } + } break; + } + return; + } + if (settings.help == HELP_ON) { if (input_handler == handle_trigger_selection || input_handler == handle_channel_selection) { diff --git a/src/main.c b/src/main.c index a6c2238..1a05da0 100644 --- a/src/main.c +++ b/src/main.c @@ -16,7 +16,7 @@ WITH REGARD TO THIS SOFTWARE. // + Change cursor drawing for new parameter pages // + Change cursor behaviour for new parameter pages // + Allow prob control (% based or 1:2, etc.) -// - Display notification when editing a parameter with the highest priority +// + Display notification when editing a parameter with the highest priority // - Add panning support. // - Add custom user themes // - Animations for cursor movement/current step highlight. (A fade out maybe?) diff --git a/src/patterns.c b/src/patterns.c index 799ca47..ed0f114 100644 --- a/src/patterns.c +++ b/src/patterns.c @@ -23,9 +23,9 @@ typedef struct ChannelWaveParams { u8 wave_volume; u8 wave_mode; u8 shape_a; - u8 phase_a; + u8 type_a; u8 shape_b; - u8 phase_b; + u8 type_b; u8 prob; s8 pan; } ChannelWaveParams; diff --git a/src/sequencer.c b/src/sequencer.c index e017700..1b9787f 100644 --- a/src/sequencer.c +++ b/src/sequencer.c @@ -176,21 +176,21 @@ play_step(void) { switch (params->wave_mode) { case 0: { SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(1); - memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->phase_a], 16); + memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->type_a], 16); SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(0) | SOUND_WAVE_BANK_SELECT(0); } break; case 1: { SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(0); - memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->phase_b], 16); + memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->type_b], 16); SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(0) | SOUND_WAVE_BANK_SELECT(1); } break; case 2: { SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(0); - memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->phase_b], 16); + memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->type_b], 16); SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(1); - memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->phase_a], 16); + memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->type_a], 16); SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(1) | SOUND_WAVE_BANK_SELECT(0); } break; @@ -934,9 +934,9 @@ set_param_selection_wave(ChannelWaveParams *params, InputHandler return_handler) } switch (param_selection_loc) { case 0: { params->shape_a = CLAMP(params->shape_a + inc, 0, WAVE_MAX - 1); } break; - case 1: { params->phase_a = CLAMP(params->phase_a + inc, 0, WAVE_VARS - 1); } break; - case 2: { params->shape_b = CLAMP(params->shape_a + inc, 0, WAVE_MAX - 1); } break; - case 3: { params->phase_b = CLAMP(params->phase_b + inc, 0, WAVE_VARS - 1); } break; + case 1: { params->type_a = CLAMP(params->type_a + inc, 0, WAVE_VARS - 1); } break; + case 2: { params->shape_b = CLAMP(params->shape_b + inc, 0, WAVE_MAX - 1); } break; + case 3: { params->type_b = CLAMP(params->type_b + inc, 0, WAVE_VARS - 1); } break; case 4: { params->prob = CLAMP(params->prob + inc, 0, PROB_NUM - 1); } break; case 5: { params->wave_mode = CLAMP(params->wave_mode + inc, 0, 2); } break; case 6: { params->wave_volume = CLAMP(params->wave_volume + inc, 0, 4); } break; -- cgit v1.2.1