Skip to content

Commit 17139a5

Browse files
committed
include cued sounds
1 parent ad6a493 commit 17139a5

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

lib/button_handler.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ void button_key_on_single(uint8_t key) {
266266
}
267267

268268
bool cued_sound_selector = false;
269+
int8_t cued_sound_last_selected = 1;
269270
void button_key_on_double(uint8_t key1, uint8_t key2) {
270271
printf("on double %d+%d\n", key1, key2);
271272
if (key_on_buttons[KEY_A] && key_on_buttons[KEY_B]) {
@@ -296,6 +297,7 @@ void button_key_on_double(uint8_t key1, uint8_t key2) {
296297
cuedsounds_volume = 150;
297298
}
298299
do_layer_kicks = cuedsounds_do_play;
300+
cued_sound_last_selected = cuedsounds_do_play;
299301
printf("cuedsounds_do_play: %d\n", cuedsounds_do_play);
300302
} else {
301303
// select volume
@@ -657,13 +659,20 @@ void button_handler(ButtonMatrix *bm) {
657659
}
658660
} else if (key_pressed[0] == 16 && key_pressed[1] == 13 &&
659661
key_pressed[2] == 10 && key_pressed[3] == 19) {
662+
#ifdef INCLUDE_CUEDSOUNDS
660663
// switch between layering kicks
661-
do_layer_kicks = !do_layer_kicks;
662-
if (do_layer_kicks) {
664+
if (do_layer_kicks == -1) {
665+
do_layer_kicks = cued_sound_last_selected;
666+
if (cuedsounds_volume == 0) {
667+
cuedsounds_volume = 150;
668+
}
663669
DebounceDigits_setText(debouncer_digits, "LAYER", 200);
664670
} else {
671+
do_layer_kicks = -1;
665672
DebounceDigits_setText(debouncer_digits, "NORM", 200);
666673
}
674+
675+
#endif
667676
} else if (key_pressed[0] == 9 && key_pressed[1] == 10 &&
668677
key_pressed[2] == 14 && key_pressed[3] == 13) {
669678
// toggle random sequence mode

zeptocore_compile_definitions.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
2727
INCLUDE_FILTER=1
2828
INCLUDE_ZEPTOCORE=1
2929
INCLUDE_MIDI=1
30-
# INCLUDE_CUEDSOUNDS=1
30+
INCLUDE_CUEDSOUNDS=1
3131
# INCLUDE_SSD1306=1
3232

3333
# ARCADE DEFINITIONS
@@ -84,7 +84,6 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
8484
USBD_PID=0x1836
8585

8686
# DETROITUNDERGROUND=1
87-
# INCLUDE_CUEDSOUNDS=1
8887
)
8988

9089
# uncomment these lines to include midi

0 commit comments

Comments
 (0)