aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-07-22 11:18:41 +0200
committerBad Diode <bd@badd10de.dev>2023-07-22 11:18:41 +0200
commit22225331c93b254aa926d76d2c50b5438f12586d (patch)
tree9745dc48e47855af737afecfce1d6aeb4f5f27f9
parent8236e0a7d4f99d1d354b3c7667327e707f1f2f4c (diff)
downloadstepper-22225331c93b254aa926d76d2c50b5438f12586d.tar.gz
stepper-22225331c93b254aa926d76d2c50b5438f12586d.zip
Add parameter notifications when editing
-rw-r--r--src/drawing.c394
-rw-r--r--src/main.c2
-rw-r--r--src/patterns.c4
-rw-r--r--src/sequencer.c14
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) {
486 txt_drawf_small("shape", x, y, COL_BG); 486 txt_drawf_small("shape", x, y, COL_BG);
487 } break; 487 } break;
488 case 1: { 488 case 1: {
489 x += 4 + PARAMS_BOX_OFFSET_X * 1; 489 x += 6 + PARAMS_BOX_OFFSET_X * 1;
490 y += PARAMS_BOX_H - 7; 490 y += PARAMS_BOX_H - 7;
491 txt_drawf_small("phase", x, y, COL_BG); 491 txt_drawf_small("type", x, y, COL_BG);
492 } break; 492 } break;
493 case 2: { 493 case 2: {
494 x += 4 + PARAMS_BOX_OFFSET_X * 2; 494 x += 4 + PARAMS_BOX_OFFSET_X * 2;
@@ -496,9 +496,9 @@ draw_params_cursor_wave(size_t i, u8 clr) {
496 txt_drawf_small("shape", x, y, COL_BG); 496 txt_drawf_small("shape", x, y, COL_BG);
497 } break; 497 } break;
498 case 3: { 498 case 3: {
499 x += 4 + PARAMS_BOX_OFFSET_X * 3; 499 x += 6 + PARAMS_BOX_OFFSET_X * 3;
500 y += PARAMS_BOX_H - 7; 500 y += PARAMS_BOX_H - 7;
501 txt_drawf_small("phase", x, y, COL_BG); 501 txt_drawf_small("type", x, y, COL_BG);
502 } break; 502 } break;
503 case 4: { 503 case 4: {
504 x += 6 + PARAMS_BOX_OFFSET_X * 4; 504 x += 6 + PARAMS_BOX_OFFSET_X * 4;
@@ -724,8 +724,8 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) {
724 size_t y = PARAMS_START_Y; 724 size_t y = PARAMS_START_Y;
725 725
726 // Wave Patterns. 726 // Wave Patterns.
727 draw_wave_pattern(waves[params->shape_a][params->phase_a], x, y, COL_ACC_1); 727 draw_wave_pattern(waves[params->shape_a][params->type_a], x, y, COL_ACC_1);
728 draw_wave_pattern(waves[params->shape_b][params->phase_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2); 728 draw_wave_pattern(waves[params->shape_b][params->type_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2);
729 } 729 }
730 730
731 // Trig probability. 731 // Trig probability.
@@ -760,9 +760,9 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) {
760 size_t x = PARAMS_START_X; 760 size_t x = PARAMS_START_X;
761 size_t y = PARAMS_START_Y; 761 size_t y = PARAMS_START_Y;
762 txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); 762 txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg);
763 txt_drawf_small("phase", x + 4 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); 763 txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg);
764 txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, col_fg); 764 txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, col_fg);
765 txt_drawf_small("phase", x + 4 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg); 765 txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg);
766 txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg); 766 txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg);
767 y += PARAMS_BOX_OFFSET_Y; 767 y += PARAMS_BOX_OFFSET_Y;
768 txt_drawf_small("mode", x + 6 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); 768 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() {
1182 } 1182 }
1183 txt_drawf_small(msg, x0 + 2, y0 + 1, color); 1183 txt_drawf_small(msg, x0 + 2, y0 + 1, color);
1184 } else { 1184 } else {
1185 Pattern *pat = &patterns[pattern_selection_loc];
1186 if (input_handler == handle_param_selection_sq1
1187 || input_handler == handle_param_selection_ch1) {
1188 ChannelSquareParams *params;
1189 if (input_handler == handle_param_selection_sq1) {
1190 params = &pat->ch1.params[trig_selection_loc];
1191 } else {
1192 params = &ch1_params;
1193 }
1194 switch (param_selection_loc) {
1195 case 0: {
1196 txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color);
1197 switch (params->duty_cycle) {
1198 case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1199 case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1200 case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1201 case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1202 }
1203 } break;
1204 case 1: {
1205 txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color);
1206 switch (params->env_volume) {
1207 case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1208 case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1209 case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1210 case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1211 case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1212 case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1213 case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1214 case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1215 case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1216 case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1217 case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1218 case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1219 case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1220 case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1221 case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1222 case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1223 }
1224 } break;
1225 case 2: {
1226 txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color);
1227 switch (params->env_time) {
1228 case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1229 case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1230 case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1231 case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1232 case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1233 case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1234 case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1235 case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1236 }
1237 } break;
1238 case 3: {
1239 txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color);
1240 switch (params->env_direction) {
1241 case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break;
1242 case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break;
1243 }
1244 } break;
1245 case 4: {
1246 txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color);
1247 switch (params->prob) {
1248 case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1249 case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1250 case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1251 case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1252 case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1253 case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1254 case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1255 case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1256 case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1257 case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1258 case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1259 case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1260 case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1261 case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1262 case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1263 case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1264 }
1265 } break;
1266 case 5: {
1267 txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color);
1268 switch (params->sweep_number) {
1269 case 0: { txt_drawf_small("0", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1270 case 1: { txt_drawf_small("1", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1271 case 2: { txt_drawf_small("2", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1272 case 3: { txt_drawf_small("3", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1273 case 4: { txt_drawf_small("4", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1274 case 5: { txt_drawf_small("5", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1275 case 6: { txt_drawf_small("6", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1276 case 7: { txt_drawf_small("7", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1277 }
1278 } break;
1279 case 6: {
1280 txt_drawf_small("SWEEP TIME: ", x0 + 2, y0 + 1, color);
1281 switch (params->sweep_time) {
1282 case 0: { txt_drawf_small("off", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1283 case 1: { txt_drawf_small("7ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1284 case 2: { txt_drawf_small("15ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1285 case 3: { txt_drawf_small("23ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1286 case 4: { txt_drawf_small("31ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1287 case 5: { txt_drawf_small("39ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1288 case 6: { txt_drawf_small("46ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1289 case 7: { txt_drawf_small("54ms", x0 + 2 + 12 * 4, y0 + 1, color); } break;
1290 }
1291 } break;
1292 case 7: {
1293 txt_drawf_small("SWEEP DIRECTION: ", x0 + 2, y0 + 1, color);
1294 switch (params->sweep_direction) {
1295 case 0: { txt_drawf_small("up", x0 + 2 + 17 * 4, y0 + 1, color); } break;
1296 case 1: { txt_drawf_small("down", x0 + 2 + 17 * 4, y0 + 1, color); } break;
1297 }
1298 } break;
1299 }
1300 return;
1301 }
1302
1303 if (input_handler == handle_param_selection_sq2
1304 || input_handler == handle_param_selection_ch2) {
1305 ChannelSquareParams *params;
1306 if (input_handler == handle_param_selection_sq2) {
1307 params = &pat->ch2.params[trig_selection_loc];
1308 } else {
1309 params = &ch2_params;
1310 }
1311 switch (param_selection_loc) {
1312 case 0: {
1313 txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color);
1314 switch (params->duty_cycle) {
1315 case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1316 case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1317 case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1318 case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break;
1319 }
1320 } break;
1321 case 1: {
1322 txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color);
1323 switch (params->env_volume) {
1324 case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1325 case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1326 case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1327 case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1328 case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1329 case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1330 case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1331 case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1332 case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1333 case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1334 case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1335 case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1336 case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1337 case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1338 case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1339 case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1340 }
1341 } break;
1342 case 2: {
1343 txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color);
1344 switch (params->env_time) {
1345 case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1346 case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1347 case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1348 case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1349 case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1350 case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1351 case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1352 case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1353 }
1354 } break;
1355 case 3: {
1356 txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color);
1357 switch (params->env_direction) {
1358 case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break;
1359 case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break;
1360 }
1361 } break;
1362 case 4: {
1363 txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color);
1364 switch (params->prob) {
1365 case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1366 case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1367 case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1368 case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1369 case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1370 case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1371 case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1372 case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1373 case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1374 case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1375 case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1376 case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1377 case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1378 case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1379 case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1380 case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1381 }
1382 } break;
1383 }
1384 return;
1385 }
1386
1387 if (input_handler == handle_param_selection_wave
1388 || input_handler == handle_param_selection_ch3) {
1389 ChannelWaveParams *params;
1390 if (input_handler == handle_param_selection_wave) {
1391 params = &pat->ch3.params[trig_selection_loc];
1392 } else {
1393 params = &ch3_params;
1394 }
1395 switch (param_selection_loc) {
1396 case 0: {
1397 txt_drawf_small("SHAPE A: ", x0 + 2, y0 + 1, color);
1398 switch (params->shape_a) {
1399 case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break;
1400 case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break;
1401 case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break;
1402 }
1403 } break;
1404 case 1: {
1405 txt_drawf_small("TYPE A: ", x0 + 2, y0 + 1, color);
1406 switch (params->type_a) {
1407 case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1408 case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1409 case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1410 case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1411 case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1412 case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1413 case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1414 case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1415 }
1416 } break;
1417 case 2: {
1418 txt_drawf_small("SHAPE B: ", x0 + 2, y0 + 1, color);
1419 switch (params->shape_b) {
1420 case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break;
1421 case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break;
1422 case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break;
1423 }
1424 } break;
1425 case 3: {
1426 txt_drawf_small("TYPE B: ", x0 + 2, y0 + 1, color);
1427 switch (params->type_b) {
1428 case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1429 case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1430 case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1431 case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1432 case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1433 case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1434 case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1435 case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1436 }
1437 } break;
1438 case 4: {
1439 txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color);
1440 switch (params->prob) {
1441 case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1442 case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1443 case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1444 case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1445 case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1446 case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1447 case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1448 case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1449 case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1450 case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1451 case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1452 case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1453 case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1454 case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1455 case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1456 case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1457 }
1458 } break;
1459 case 5: {
1460 txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color);
1461 switch (params->wave_mode) {
1462 case 0: { txt_drawf_small("A", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1463 case 1: { txt_drawf_small("B", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1464 case 2: { txt_drawf_small("A + B", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1465 }
1466 } break;
1467 case 6: {
1468 txt_drawf_small("VOLUME: ", x0 + 2, y0 + 1, color);
1469 switch (params->wave_volume) {
1470 case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1471 case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1472 case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1473 case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1474 case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); } break;
1475 }
1476 } break;
1477 }
1478 return;
1479 }
1480
1481 if (input_handler == handle_param_selection_noise
1482 || input_handler == handle_param_selection_ch4) {
1483 ChannelNoiseParams *params;
1484 if (input_handler == handle_param_selection_noise) {
1485 params = &pat->ch4.params[trig_selection_loc];
1486 } else {
1487 params = &ch4_params;
1488 }
1489 switch (param_selection_loc) {
1490 case 0: {
1491 txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color);
1492 switch (params->bit_mode) {
1493 case 0: { txt_drawf_small("a", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1494 case 1: { txt_drawf_small("b", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1495 }
1496 } break;
1497 case 1: {
1498 txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color);
1499 switch (params->env_volume) {
1500 case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1501 case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1502 case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1503 case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1504 case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1505 case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1506 case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1507 case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1508 case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1509 case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1510 case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1511 case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1512 case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1513 case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1514 case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1515 case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break;
1516 }
1517 } break;
1518 case 2: {
1519 txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color);
1520 switch (params->env_time) {
1521 case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1522 case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1523 case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1524 case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1525 case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1526 case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1527 case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1528 case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break;
1529 }
1530 } break;
1531 case 3: {
1532 txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color);
1533 switch (params->env_direction) {
1534 case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break;
1535 case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break;
1536 }
1537 } break;
1538 case 4: {
1539 txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color);
1540 switch (params->prob) {
1541 case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1542 case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1543 case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1544 case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1545 case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1546 case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1547 case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1548 case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1549 case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1550 case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1551 case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1552 case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1553 case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1554 case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1555 case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1556 case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break;
1557 }
1558 } break;
1559 }
1560 return;
1561 }
1562
1185 if (settings.help == HELP_ON) { 1563 if (settings.help == HELP_ON) {
1186 if (input_handler == handle_trigger_selection || 1564 if (input_handler == handle_trigger_selection ||
1187 input_handler == handle_channel_selection) { 1565 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.
16// + Change cursor drawing for new parameter pages 16// + Change cursor drawing for new parameter pages
17// + Change cursor behaviour for new parameter pages 17// + Change cursor behaviour for new parameter pages
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// - Add custom user themes 21// - Add custom user themes
22// - Animations for cursor movement/current step highlight. (A fade out maybe?) 22// - 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 {
23 u8 wave_volume; 23 u8 wave_volume;
24 u8 wave_mode; 24 u8 wave_mode;
25 u8 shape_a; 25 u8 shape_a;
26 u8 phase_a; 26 u8 type_a;
27 u8 shape_b; 27 u8 shape_b;
28 u8 phase_b; 28 u8 type_b;
29 u8 prob; 29 u8 prob;
30 s8 pan; 30 s8 pan;
31} ChannelWaveParams; 31} 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) {
176 switch (params->wave_mode) { 176 switch (params->wave_mode) {
177 case 0: { 177 case 0: {
178 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(1); 178 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(1);
179 memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->phase_a], 16); 179 memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->type_a], 16);
180 SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(0) 180 SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(0)
181 | SOUND_WAVE_BANK_SELECT(0); 181 | SOUND_WAVE_BANK_SELECT(0);
182 } break; 182 } break;
183 case 1: { 183 case 1: {
184 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(0); 184 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(0);
185 memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->phase_b], 16); 185 memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->type_b], 16);
186 SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(0) 186 SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(0)
187 | SOUND_WAVE_BANK_SELECT(1); 187 | SOUND_WAVE_BANK_SELECT(1);
188 } break; 188 } break;
189 case 2: { 189 case 2: {
190 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(0); 190 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(0);
191 memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->phase_b], 16); 191 memcpy32(SOUND_WAVE_RAM, waves[params->shape_b][params->type_b], 16);
192 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(1); 192 SOUND_WAVE_MODE = SOUND_WAVE_BANK_SELECT(1);
193 memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->phase_a], 16); 193 memcpy32(SOUND_WAVE_RAM, waves[params->shape_a][params->type_a], 16);
194 SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(1) 194 SOUND_WAVE_MODE = SOUND_WAVE_BANK_MODE(1)
195 | SOUND_WAVE_BANK_SELECT(0); 195 | SOUND_WAVE_BANK_SELECT(0);
196 } break; 196 } break;
@@ -934,9 +934,9 @@ set_param_selection_wave(ChannelWaveParams *params, InputHandler return_handler)
934 } 934 }
935 switch (param_selection_loc) { 935 switch (param_selection_loc) {
936 case 0: { params->shape_a = CLAMP(params->shape_a + inc, 0, WAVE_MAX - 1); } break; 936 case 0: { params->shape_a = CLAMP(params->shape_a + inc, 0, WAVE_MAX - 1); } break;
937 case 1: { params->phase_a = CLAMP(params->phase_a + inc, 0, WAVE_VARS - 1); } break; 937 case 1: { params->type_a = CLAMP(params->type_a + inc, 0, WAVE_VARS - 1); } break;
938 case 2: { params->shape_b = CLAMP(params->shape_a + inc, 0, WAVE_MAX - 1); } break; 938 case 2: { params->shape_b = CLAMP(params->shape_b + inc, 0, WAVE_MAX - 1); } break;
939 case 3: { params->phase_b = CLAMP(params->phase_b + inc, 0, WAVE_VARS - 1); } break; 939 case 3: { params->type_b = CLAMP(params->type_b + inc, 0, WAVE_VARS - 1); } break;
940 case 4: { params->prob = CLAMP(params->prob + inc, 0, PROB_NUM - 1); } break; 940 case 4: { params->prob = CLAMP(params->prob + inc, 0, PROB_NUM - 1); } break;
941 case 5: { params->wave_mode = CLAMP(params->wave_mode + inc, 0, 2); } break; 941 case 5: { params->wave_mode = CLAMP(params->wave_mode + inc, 0, 2); } break;
942 case 6: { params->wave_volume = CLAMP(params->wave_volume + inc, 0, 4); } break; 942 case 6: { params->wave_volume = CLAMP(params->wave_volume + inc, 0, 4); } break;