@@ -130,6 +130,13 @@ void regenerate_random_sequence_arr() {
130130// mode toggles
131131// mode ==0 ==1
132132uint8_t mode_buttons16 = 0 ;
133+ #ifdef INCLUDE_ZEPTOCORE
134+ #define JUMP_PAGE_LOCK_DEFAULT 0
135+ #define JUMP_PAGE_LOCK_FIRST 1
136+ #define JUMP_PAGE_LOCK_SECOND 2
137+ #define JUMP_PAGE_LOCK_THIRD 3
138+ uint8_t jump_page_lock = JUMP_PAGE_LOCK_DEFAULT ;
139+ #endif
133140bool mode_mute = 0 ;
134141bool mode_play = 0 ;
135142bool mute_because_of_playback_type = false;
@@ -632,46 +639,61 @@ void do_update_phase_from_beat_current() {
632639 jump_precedence = false;
633640}
634641
635- void key_do_jump (uint8_t beat ) {
636- if (beat >= 0 && beat < 16 ) {
642+ void key_do_jump_to_slice (int32_t slice , uint8_t sequencer_beat ) {
637643#ifdef INCLUDE_ZEPTOCORE
638- if (clock_in_do && clock_input_absent_zeptocore &&
639- clock_in_activator >= 3 ) {
640- // reset beats
641- bpm_timer_counter = 0 ;
642- beat_total = 0 ;
643- key_jump_debounce = 0 ;
644- dub_step_break = -1 ;
645- retrig_beat_num = 0 ;
646- beat_current = 0 ;
647- playback_stopped = false;
648- clock_in_ready = false;
649- clock_in_activator = 0 ;
650- clock_in_do = false;
651- }
644+ if (clock_in_do && clock_input_absent_zeptocore && clock_in_activator >= 3 ) {
645+ // reset beats
646+ bpm_timer_counter = 0 ;
647+ beat_total = 0 ;
648+ key_jump_debounce = 0 ;
649+ dub_step_break = -1 ;
650+ retrig_beat_num = 0 ;
651+ beat_current = 0 ;
652+ playback_stopped = false;
653+ clock_in_ready = false;
654+ clock_in_activator = 0 ;
655+ clock_in_do = false;
656+ }
652657#endif
653- // printf("key_do_jump %d\n", beat);
654- // TODO: [0] should be which sequencer it is on
655- if (sequencerhandler [0 ].recording ) {
656- Sequencer_add (sf -> sequencers [0 ][sf -> sequence_sel [0 ]], beat ,
657- bpm_timer_counter );
658+ // TODO: [0] should be which sequencer it is on
659+ if (sequencerhandler [0 ].recording ) {
660+ Sequencer_add (sf -> sequencers [0 ][sf -> sequence_sel [0 ]], sequencer_beat ,
661+ bpm_timer_counter );
662+ }
663+ key_jump_debounce = 1 ;
664+ beat_current = slice ;
665+ retrig_pitch = PITCH_VAL_MID ;
666+ // reset filter
667+ if (global_filter_index != retrig_filter_original &&
668+ retrig_filter_original > 0 ) {
669+ global_filter_index = retrig_filter_original ;
670+ for (uint8_t channel = 0 ; channel < 2 ; channel ++ ) {
671+ ResonantFilter_setFc (resFilter [channel ], global_filter_index );
658672 }
659- key_jump_debounce = 1 ;
660- beat_current = floor (beat_current / 16 ) * 16 + beat ;
661- retrig_pitch = PITCH_VAL_MID ;
662- // reset filter
663- if (global_filter_index != retrig_filter_original &&
664- retrig_filter_original > 0 ) {
665- global_filter_index = retrig_filter_original ;
666- for (uint8_t channel = 0 ; channel < 2 ; channel ++ ) {
667- ResonantFilter_setFc (resFilter [channel ], global_filter_index );
668- }
669- retrig_filter_original = 0 ;
673+ retrig_filter_original = 0 ;
674+ }
675+ jump_precedence = true;
676+ do_update_phase_from_beat_current ();
677+ }
678+
679+ void key_do_jump (uint8_t beat ) {
680+ if (beat < 16 ) {
681+ // printf("key_do_jump %d\n", beat);
682+ key_do_jump_to_slice (floor (beat_current / 16 ) * 16 + beat , beat );
683+ }
684+ }
685+
686+ #ifdef INCLUDE_ZEPTOCORE
687+ void key_do_physical_jump (uint8_t beat ) {
688+ if (beat < 16 ) {
689+ int32_t slice = floor (beat_current / 16 ) * 16 + beat ;
690+ if (jump_page_lock > JUMP_PAGE_LOCK_DEFAULT ) {
691+ slice = (jump_page_lock - 1 ) * 16 + beat ;
670692 }
671- jump_precedence = true;
672- do_update_phase_from_beat_current ();
693+ key_do_jump_to_slice (slice , beat );
673694 }
674695}
696+ #endif
675697
676698void step_sequencer_emit (uint8_t key ) {
677699#ifdef INCLUDE_MIDI
0 commit comments