File tree Expand file tree Collapse file tree 2 files changed +36
-14
lines changed Expand file tree Collapse file tree 2 files changed +36
-14
lines changed Original file line number Diff line number Diff line change @@ -580,6 +580,8 @@ void input_handling() {
580
580
mute_soft = true;
581
581
#endif
582
582
583
+ int cv_amen_last_value = 0 ;
584
+
583
585
while (1 ) {
584
586
#ifdef INCLUDE_MIDI
585
587
tud_task ();
@@ -769,19 +771,39 @@ void input_handling() {
769
771
val -= 512 ;
770
772
}
771
773
}
772
- cv_beat_current_override = linlin (val , -512 , 512 ,
773
- cv_start *
774
- banks [sel_bank_cur ]
775
- -> sample [sel_sample_cur ]
776
- .snd [FILEZERO ]
777
- -> slice_num /
778
- 1000 ,
779
- cv_stop *
780
- banks [sel_bank_cur ]
781
- -> sample [sel_sample_cur ]
782
- .snd [FILEZERO ]
783
- -> slice_num /
784
- 1000 );
774
+ if (val >= 0 ) {
775
+ if (cv_amen_last_value - val > 3 || val - cv_amen_last_value > 3 ) {
776
+ printf ("CV_AMEN val: %d\n" , val );
777
+ cv_amen_last_value = val ;
778
+ cv_beat_current_override = linlin (val , 0 , 512 ,
779
+ cv_start *
780
+ banks [sel_bank_cur ]
781
+ -> sample [sel_sample_cur ]
782
+ .snd [FILEZERO ]
783
+ -> slice_num /
784
+ 1000 ,
785
+ cv_stop *
786
+ banks [sel_bank_cur ]
787
+ -> sample [sel_sample_cur ]
788
+ .snd [FILEZERO ]
789
+ -> slice_num /
790
+ 1000 );
791
+ }
792
+ } else {
793
+ cv_beat_current_override = linlin (val , -512 , 0 ,
794
+ cv_start *
795
+ banks [sel_bank_cur ]
796
+ -> sample [sel_sample_cur ]
797
+ .snd [FILEZERO ]
798
+ -> slice_num /
799
+ 1000 ,
800
+ cv_stop *
801
+ banks [sel_bank_cur ]
802
+ -> sample [sel_sample_cur ]
803
+ .snd [FILEZERO ]
804
+ -> slice_num /
805
+ 1000 );
806
+ }
785
807
786
808
} else if (i == CV_BREAK ) {
787
809
// printf("[ectocore] cv_break %d\n", val);
Original file line number Diff line number Diff line change @@ -512,7 +512,7 @@ bool repeating_timer_callback(struct repeating_timer *t) {
512
512
if (cv_beat_current_override > 0 ) {
513
513
beat_current = cv_beat_current_override ;
514
514
cv_beat_current_override = -1 ;
515
- printf ("[main] cv_beat_current_override: %d\n" , beat_current );
515
+ // printf("[main] cv_beat_current_override: %d\n", beat_current);
516
516
}
517
517
#endif
518
518
// printf("beat_current: %d\n", beat_current);
You can’t perform that action at this time.
0 commit comments