Skip to content

Commit 2d4e4fe

Browse files
committed
fix: add pitch bend
1 parent 0e62152 commit 2d4e4fe

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lib/ectocore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ void __not_in_flash_func(input_handling)() {
11311131
if (mode_held_duration > MODE_HOLD_DURATION_THRESHOLD) {
11321132
// mode selection
11331133
// 0 - 100
1134-
mode_digital_bass = val * 100 / 1024;
1135-
printf("[ectocore] mode_digital_bass %d\n", mode_digital_bass);
1134+
mode_chaos_trembler = val * 100 / 1024;
1135+
printf("[ectocore] mode_chaos_trembler %d\n", mode_chaos_trembler);
11361136
ws2812_set_wheel(ws2812, val * 4, 255, 0, 0);
11371137
} else if (gpio_get(GPIO_BTN_BANK) == 0 &&
11381138
fil_current_change == false) {
@@ -1324,7 +1324,10 @@ void __not_in_flash_func(input_handling)() {
13241324
printf("[ectocore] mode_digital_smear %d\n", mode_digital_smear);
13251325
ws2812_set_wheel(ws2812, val * 4, 255, 0, 0);
13261326
} else if (gpio_btn_taptempo_val == 0) {
1327-
// TODO: TAP TEMPO + BREAK ATTEN changes ?
1327+
// TODO: TAP TEMPO + BREAK ATTEN pitch change from PITCH_VAL_MID to
1328+
// lower pitch
1329+
// Map 0..1024 to PITCH_VAL_MID..0 (normal pitch at 0).
1330+
sf->pitch_val_index = PITCH_VAL_MID - (val * PITCH_VAL_MID / 1024);
13281331
} else {
13291332
// printf("[ectocore] knob_break_atten %d\n", val);
13301333
// change the grimoire rune
@@ -1349,8 +1352,7 @@ void __not_in_flash_func(input_handling)() {
13491352
ws2812_set_wheel(ws2812, val * 4, 255, 0, 0);
13501353
} else if (gpio_btn_taptempo_val == 0) {
13511354
// TODO: TAP TEMPO + AMEN ATTEN changes ?
1352-
mode_chaos_trembler = val * 100 / 1024;
1353-
printf("[ectocore] mode_chaos_trembler %d\n", mode_chaos_trembler);
1355+
mode_digital_bass = val * 100 / 1024;
13541356
ws2812_set_wheel(ws2812, val * 4, 0, 0, 255);
13551357
} else if (!cv_plugged[CV_AMEN] ||
13561358
(cv_plugged[CV_AMEN] && cv_reset_override == CV_AMEN)) {

0 commit comments

Comments
 (0)