Testing delay-sync to midi clock.

pull/44/head
Holger Wirtz 3 years ago
parent cb2b538478
commit 7d1ce9bce6
  1. 11
      MicroDexed.ino
  2. 4
      config.h

@ -224,7 +224,7 @@ uint8_t midi_ticks[10] = {0, 6, 9, 12, 18, 24, 36, 48, 72, 96};
uint8_t midi_bpm_counter = 0; uint8_t midi_bpm_counter = 0;
elapsedMillis midi_bpm; elapsedMillis midi_bpm;
#ifdef USE_FX #ifdef USE_FX
uint8_t midi_timing_counter[NUM_DEXED]; uint8_t midi_timing_counter[NUM_DEXED] = {0, 0};
elapsedMillis midi_timing_timer[NUM_DEXED]; elapsedMillis midi_timing_timer[NUM_DEXED];
#endif #endif
elapsedMillis long_button_pressed; elapsedMillis long_button_pressed;
@ -1407,7 +1407,14 @@ void handleClock(void)
if (midi_timing_counter[instance_id] % midi_ticks[configuration.fx.delay_sync[instance_id]] == 0) if (midi_timing_counter[instance_id] % midi_ticks[configuration.fx.delay_sync[instance_id]] == 0)
{ {
int32_t t = midi_timing_timer[instance_id]; int32_t t = midi_timing_timer[instance_id];
delay_fx[instance_id]->delay(0, constrain(t, DELAY_TIME_MIN, DELAY_TIME_MAX)); delay_fx[instance_id]->delay(0, constrain(t*10, DELAY_TIME_MIN*10, DELAY_TIME_MAX*10));
#ifdef DEBUG
Serial.print(F("Delay-Sync to "));
Serial.print(constrain(t, DELAY_TIME_MIN, DELAY_TIME_MAX), DEC);
Serial.print(F(" ms / "));
Serial.print(midi_timing_counter[instance_id], DEC);
Serial.println(F(" ticks"));
#endif
midi_timing_counter[instance_id] = 0; midi_timing_counter[instance_id] = 0;
midi_timing_timer[instance_id] = 0; midi_timing_timer[instance_id] = 0;
} }

@ -172,7 +172,7 @@
#if defined(TEENSY3_6) #if defined(TEENSY3_6)
#define DELAY_MAX_TIME 500 #define DELAY_MAX_TIME 500
#elif defined(TEENSY4) #elif defined(TEENSY4)
#define DELAY_MAX_TIME 1000 #define DELAY_MAX_TIME 1500
#else #else
#define DELAY_MAX_TIME 250 #define DELAY_MAX_TIME 250
#endif #endif
@ -420,7 +420,7 @@
#define DELAY_SYNC_MIN 0 #define DELAY_SYNC_MIN 0
#define DELAY_SYNC_MAX 9 #define DELAY_SYNC_MAX 9
#define DELAY_SYNC_DEFAULT 0 #define DELAY_SYNC_DEFAULT 7
#define REVERB_ROOMSIZE_MIN 0 #define REVERB_ROOMSIZE_MIN 0
#define REVERB_ROOMSIZE_MAX 100 #define REVERB_ROOMSIZE_MAX 100

Loading…
Cancel
Save