aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-08-02 16:51:24 +0200
committerBad Diode <bd@badd10de.dev>2023-08-02 16:51:24 +0200
commit63e727dbe78d70e2f48bd4feef9293f61016aaeb (patch)
tree2f83a222505352d72bf4ca90e74d61e89262b723
parent0ec89c43671831ca491eadeca2cbfa52a53338d5 (diff)
downloadstepper-63e727dbe78d70e2f48bd4feef9293f61016aaeb.tar.gz
stepper-63e727dbe78d70e2f48bd4feef9293f61016aaeb.zip
Minor UI changes and bank chaining support
-rw-r--r--src/drawing.c57
-rw-r--r--src/main.c11
-rw-r--r--src/sequencer.c4
3 files changed, 47 insertions, 25 deletions
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) {
506 txt_drawf_small("prob", x, y, COL_BG); 506 txt_drawf_small("prob", x, y, COL_BG);
507 } break; 507 } break;
508 case 5: { 508 case 5: {
509 x += 6 + PARAMS_BOX_OFFSET_X * 0; 509 x += 4 + PARAMS_BOX_OFFSET_X * 0;
510 y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; 510 y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y;
511 txt_drawf_small("mode", x, y, COL_BG); 511 txt_drawf_small("voice", x, y, COL_BG);
512 } break; 512 } break;
513 case 6: { 513 case 6: {
514 x += 8 + PARAMS_BOX_OFFSET_X * 1; 514 x += 8 + PARAMS_BOX_OFFSET_X * 1;
@@ -766,8 +766,10 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) {
766 size_t y = PARAMS_START_Y; 766 size_t y = PARAMS_START_Y;
767 767
768 // Wave Patterns. 768 // Wave Patterns.
769 draw_wave_pattern(waves[params->shape_a][params->type_a], x, y, COL_ACC_1); 769 u8 col_wave_a = col_fg != COL_OFF && (params->wave_mode == 0 || params->wave_mode == 2) ? COL_ACC_1 : COL_OFF;
770 draw_wave_pattern(waves[params->shape_b][params->type_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2); 770 u8 col_wave_b = col_fg != COL_OFF && (params->wave_mode == 1 || params->wave_mode == 2) ? COL_ACC_2 : COL_OFF;
771 draw_wave_pattern(waves[params->shape_a][params->type_a], x, y, col_wave_a);
772 draw_wave_pattern(waves[params->shape_b][params->type_b], x + PARAMS_BOX_OFFSET_X * 2, y, col_wave_b);
771 } 773 }
772 774
773 // Trig probability. 775 // Trig probability.
@@ -825,7 +827,7 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) {
825 txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg); 827 txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg);
826 txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg); 828 txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg);
827 y += PARAMS_BOX_OFFSET_Y; 829 y += PARAMS_BOX_OFFSET_Y;
828 txt_drawf_small("mode", x + 6 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); 830 txt_drawf_small("voice", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg);
829 txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); 831 txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg);
830 txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg); 832 txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg);
831 } 833 }
@@ -888,15 +890,16 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep, bool global) {
888 x5 += 20; 890 x5 += 20;
889 } break; 891 } break;
890 } 892 }
891 draw_line(x0, y0, x1, y0, COL_ACC_1); 893 u8 col_shape = col_fg != COL_OFF ? COL_ACC_1 : COL_OFF;
892 draw_line(x1, y1, x1, y0, COL_ACC_1); 894 draw_line(x0, y0, x1, y0, col_shape);
893 draw_line(x1, y1, x2, y1, COL_ACC_1); 895 draw_line(x1, y1, x1, y0, col_shape);
894 draw_line(x2, y1, x2, y0, COL_ACC_1); 896 draw_line(x1, y1, x2, y1, col_shape);
895 draw_line(x2, y0, x3, y0, COL_ACC_1); 897 draw_line(x2, y1, x2, y0, col_shape);
896 draw_line(x3, y1, x3, y0, COL_ACC_1); 898 draw_line(x2, y0, x3, y0, col_shape);
897 draw_line(x3, y1, x4, y1, COL_ACC_1); 899 draw_line(x3, y1, x3, y0, col_shape);
898 draw_line(x4, y1, x4, y0, COL_ACC_1); 900 draw_line(x3, y1, x4, y1, col_shape);
899 draw_line(x4, y0, x5, y0, COL_ACC_1); 901 draw_line(x4, y1, x4, y0, col_shape);
902 draw_line(x4, y0, x5, y0, col_shape);
900 } 903 }
901 904
902 // Envelope. 905 // Envelope.
@@ -911,11 +914,12 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep, bool global) {
911 size_t y2 = y1; 914 size_t y2 = y1;
912 915
913 // Env. 916 // Env.
917 u8 col_env = col_fg != COL_OFF ? COL_ACC_2 : COL_OFF;
914 if (params->env_time == 0) { 918 if (params->env_time == 0) {
915 draw_line(x0, y0, x2, y0, COL_ACC_2); 919 draw_line(x0, y0, x2, y0, col_env);
916 } else { 920 } else {
917 draw_line(x0, y0, x1, y1, COL_ACC_2); 921 draw_line(x0, y0, x1, y1, col_env);
918 draw_line(x1, y1, x2, y2, COL_ACC_2); 922 draw_line(x1, y1, x2, y2, col_env);
919 } 923 }
920 } 924 }
921 925
@@ -1033,11 +1037,12 @@ draw_parameters_noise(ChannelNoiseParams* params, bool global) {
1033 size_t y2 = y1; 1037 size_t y2 = y1;
1034 1038
1035 // Env. 1039 // Env.
1040 u8 col_env = col_fg != COL_OFF ? COL_ACC_2 : COL_OFF;
1036 if (params->env_time == 0) { 1041 if (params->env_time == 0) {
1037 draw_line(x0, y0, x2, y0, COL_ACC_2); 1042 draw_line(x0, y0, x2, y0, col_env);
1038 } else { 1043 } else {
1039 draw_line(x0, y0, x1, y1, COL_ACC_2); 1044 draw_line(x0, y0, x1, y1, col_env);
1040 draw_line(x1, y1, x2, y2, COL_ACC_2); 1045 draw_line(x1, y1, x2, y2, col_env);
1041 } 1046 }
1042 } 1047 }
1043 1048
@@ -1472,11 +1477,11 @@ draw_notif_bar() {
1472 } break; 1477 } break;
1473 case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; 1478 case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break;
1474 case 5: { 1479 case 5: {
1475 txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); 1480 txt_drawf_small("VOICE: ", x0 + 2, y0 + 1, color);
1476 switch (params->wave_mode) { 1481 switch (params->wave_mode) {
1477 case 0: { txt_drawf_small("A", x0 + 2 + 6 * 4, y0 + 1, color); } break; 1482 case 0: { txt_drawf_small("A", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1478 case 1: { txt_drawf_small("B", x0 + 2 + 6 * 4, y0 + 1, color); } break; 1483 case 1: { txt_drawf_small("B", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1479 case 2: { txt_drawf_small("A + B", x0 + 2 + 6 * 4, y0 + 1, color); } break; 1484 case 2: { txt_drawf_small("A + B", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1480 } 1485 }
1481 } break; 1486 } break;
1482 case 6: { 1487 case 6: {
@@ -1601,6 +1606,10 @@ draw_pattern_chain() {
1601 color = COL_OFF; 1606 color = COL_OFF;
1602 if (chain.current == i && chain.len != 0) { 1607 if (chain.current == i && chain.len != 0) {
1603 color = COL_ACC_2; 1608 color = COL_ACC_2;
1609 if (chain.active[i]) {
1610 txt_drawc('A' + chain.chain[i], x0 + 4, y0 + 3, color);
1611 }
1612 draw_rect(x0, y0, x1, y1, color);
1604 } 1613 }
1605 draw_line(x0 + 5, y1 - 2, x1 - 5, y1 - 2, color); 1614 draw_line(x0 + 5, y1 - 2, x1 - 5, y1 - 2, color);
1606 } 1615 }
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.
18// + Allow prob control (% based or 1:2, etc.) 18// + Allow prob control (% based or 1:2, etc.)
19// + Display notification when editing a parameter with the highest priority 19// + Display notification when editing a parameter with the highest priority
20// + Add panning support. 20// + Add panning support.
21// + Change ch3 to only color the waveform that is selected depending on the
22// mode.
23// + Grey out colors when foreground is also grey.
24// + Bigger indicator for currently playing pattern.
21// - Add custom user themes 25// - Add custom user themes
22// - Animations for cursor movement/current step highlight. (A fade out maybe?) 26// - Animations for cursor movement/current step highlight. (A fade out maybe?)
27// - Improve "grey" cursor with dithering instead.
28// - Remove thin cursor option and make the fat one default, it's just better.
23// 29//
24// Quality of life improvements. 30// Quality of life improvements.
25// + Make the channel parameters initialize to default 31// + Make the channel parameters initialize to default
@@ -32,6 +38,7 @@ WITH REGARD TO THIS SOFTWARE.
32// 38//
33// Advanced 39// Advanced
34// + Per trig note probability. 40// + Per trig note probability.
41// + Make it so switching banks don't stop playback.
35// - Add tap tempo for BPM. 42// - Add tap tempo for BPM.
36// - Allow "marking" several trigs to be able to copy/paste them and/or adjust 43// - Allow "marking" several trigs to be able to copy/paste them and/or adjust
37// their parameters. 44// their parameters.
@@ -41,6 +48,10 @@ WITH REGARD TO THIS SOFTWARE.
41// - Per trig LFO? How would we go about this? There is at least one empty slot 48// - Per trig LFO? How would we go about this? There is at least one empty slot
42// in all channels. LFO amount? LFO speed? Would need a dedicated page for 49// in all channels. LFO amount? LFO speed? Would need a dedicated page for
43// configuring LFOs 50// configuring LFOs
51// - Multiple pattern chains per bank that we can toggle between, gotta study
52// if they fit in the SRAM.
53// - Scale mode for entering notes.
54// - Make sure bank switching is queued like patterns.
44// 55//
45// Bugfixes 56// Bugfixes
46// + Sound can get hung up sometimes, but I can't reproduce when this happens. 57// + 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) {
546 546
547void 547void
548select_bank(int i) { 548select_bank(int i) {
549 stop_playing(); 549 // TODO: queue bank if we are currently playing?
550 chain.current = 15;
551 chain.current = find_next_pattern();
550 clipboard.type = CLIP_EMPTY; 552 clipboard.type = CLIP_EMPTY;
551 save_bank(current_bank); 553 save_bank(current_bank);
552 metadata.current_pattern = current_pattern; 554 metadata.current_pattern = current_pattern;