@@ -855,27 +855,7 @@ void input_handling() {
855
855
clock_in_activator = 0 ;
856
856
clock_in_do = false;
857
857
} else if (!clock_input_absent ) {
858
- // pressing clock while clock is active will reset to beat 1
859
- // after determining whether the press is closer to the last
860
- // clock or the next clock (i.e. we are either early or late)
861
- uint32_t next_time =
862
- clock_in_last_time + (clock_in_last_time - clock_in_last_last_time );
863
- uint32_t now_time = time_us_32 ();
864
- // ---|-----------|-----------|-------
865
- // --lastlast----last---NOW--next
866
- // determine if we are in the first half or the second half
867
- if (now_time > clock_in_last_time +
868
- (clock_in_last_time - clock_in_last_last_time ) / 2 ) {
869
- // we are in the second half
870
- // the next clock is going to be the first beat
871
- // reset it to -1, so that when it increments it will be at 0
872
- clock_in_beat_total = -1 ;
873
- } else {
874
- // we are in the first half
875
- // the next clock is going to be the second beat
876
- // reset it to 0, so that when it increments it will be at 1
877
- clock_in_beat_total = 0 ;
878
- }
858
+ // do nothing (this is handled in TAP+MODE now)
879
859
} else {
880
860
val = TapTempo_tap (taptempo );
881
861
if (val > 0 ) {
@@ -1145,13 +1125,43 @@ void input_handling() {
1145
1125
set_audio_variant (audio_variant_num );
1146
1126
}
1147
1127
} else if (gpio_btn_state [BTN_TAPTEMPO ] == 1 ) {
1148
- // A+B
1149
1128
if (val == 1 ) {
1150
- // reset tempo to the tempo of the current sample
1151
- int16_t new_tempo =
1152
- banks [sel_bank_cur ]-> sample [sel_sample_cur ].snd [FILEZERO ]-> bpm ;
1153
- if (new_tempo >= 60 && new_tempo <= 300 ) {
1154
- sf -> bpm_tempo = new_tempo ;
1129
+ // TAP + MODE resets to original bpm if no clock is present
1130
+ // otherwise it resets the pattern to beat 1
1131
+ if (!clock_input_absent ) {
1132
+ printf ("resetting pattern to beat 1\n" );
1133
+ // pressing clock while clock is active will reset to beat 1
1134
+ // after determining whether the press is closer to the last
1135
+ // clock or the next clock (i.e. we are either early or late)
1136
+ uint32_t next_time =
1137
+ clock_in_last_time +
1138
+ (clock_in_last_time - clock_in_last_last_time );
1139
+ uint32_t now_time = time_us_32 ();
1140
+ // ---|-----------|-----------|-------
1141
+ // --lastlast----last---NOW--next
1142
+ // determine if we are in the first half or the second half
1143
+ if (now_time >
1144
+ clock_in_last_time +
1145
+ (clock_in_last_time - clock_in_last_last_time ) / 2 ) {
1146
+ // we are in the second half
1147
+ // the next clock is going to be the first beat
1148
+ // reset it to -1, so that when it increments it will be at 0
1149
+ clock_in_beat_total = -1 ;
1150
+ } else {
1151
+ // we are in the first half
1152
+ // the next clock is going to be the second beat
1153
+ // reset it to 0, so that when it increments it will be at 1
1154
+ clock_in_beat_total = 0 ;
1155
+ }
1156
+ } else {
1157
+ // reset tempo to the tempo of the current sample
1158
+ int16_t new_tempo = banks [sel_bank_cur ]
1159
+ -> sample [sel_sample_cur ]
1160
+ .snd [FILEZERO ]
1161
+ -> bpm ;
1162
+ if (new_tempo >= 60 && new_tempo <= 300 ) {
1163
+ sf -> bpm_tempo = new_tempo ;
1164
+ }
1155
1165
}
1156
1166
}
1157
1167
} else {
0 commit comments