Added showing of timing-problems when delay is sync to MIDI-clock and correct delay would be higher than supported delay length.

pull/46/head
Holger Wirtz 3 years ago
parent 3cd07a4123
commit 9e7f832e5d
  1. 13
      MicroDexed.ino
  2. 36
      UI.hpp
  3. 2
      config.h

@ -1414,11 +1414,11 @@ void handleClock(void)
{ {
if (configuration.fx.delay_sync[instance_id] > 0) if (configuration.fx.delay_sync[instance_id] > 0)
{ {
uint16_t t = uint16_t(60.0 / float(midi_bpm) * 1000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] + 0.5); uint16_t midi_sync_delay_time = uint16_t(60.0 / float(midi_bpm) * 1000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] + 0.5);
delay_fx[instance_id]->delay(0, constrain(t, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10)); delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10));
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("Setting Delay-Sync to ")); Serial.print(F("Setting Delay-Sync to "));
Serial.print(constrain(t, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10), DEC); Serial.print(constrain(midi_sync_delay_time, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10), DEC);
Serial.println(F(" ms")); Serial.println(F(" ms"));
#endif #endif
} }
@ -2183,13 +2183,6 @@ void check_and_create_directories(void)
// create directories for banks // create directories for banks
for (i = 0; i < MAX_BANKS; i++) for (i = 0; i < MAX_BANKS; i++)
{ {
#ifdef ENABLE_LCD_UI
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(F("Setting up SD"));
lcd.setCursor(0, 1);
lcd.print(F("Please wait..."));
#endif
sprintf(tmp, "/%d", i); sprintf(tmp, "/%d", i);
if (!SD.exists(tmp)) if (!SD.exists(tmp))
{ {

@ -103,6 +103,9 @@ extern char g_voice_name[NUM_DEXED][VOICE_NAME_LEN];
extern char g_bank_name[NUM_DEXED][BANK_NAME_LEN]; extern char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
extern int perform_attack_mod[NUM_DEXED]; extern int perform_attack_mod[NUM_DEXED];
extern int perform_release_mod[NUM_DEXED]; extern int perform_release_mod[NUM_DEXED];
extern float midi_ticks_factor[10];
extern uint8_t midi_bpm;
/*********************************************************************** /***********************************************************************
GLOBAL GLOBAL
************************************************************************/ ************************************************************************/
@ -6037,34 +6040,49 @@ void lcd_display_delay_sync(uint8_t sync)
switch (sync) switch (sync)
{ {
case 1: case 1:
lcd.show(1, 10, 5, "1/16"); lcd.show(1, 10, 6, "1/16");
break; break;
case 2: case 2:
lcd.show(1, 10, 5, "1/16T"); lcd.show(1, 10, 6, "1/16T");
break; break;
case 3: case 3:
lcd.show(1, 10, 5, "1/8"); lcd.show(1, 10, 6, "1/8");
break; break;
case 4: case 4:
lcd.show(1, 10, 5, "1/8T"); lcd.show(1, 10, 6, "1/8T");
break; break;
case 5: case 5:
lcd.show(1, 10, 5, "1/4"); lcd.show(1, 10, 6, "1/4");
break; break;
case 6: case 6:
lcd.show(1, 10, 5, "1/4T"); lcd.show(1, 10, 6, "1/4T");
break; break;
case 7: case 7:
lcd.show(1, 10, 5, "1/2"); lcd.show(1, 10, 6, "1/2");
break; break;
case 8: case 8:
lcd.show(1, 10, 5, "1/2T"); lcd.show(1, 10, 6, "1/2T");
break; break;
case 9: case 9:
lcd.show(1, 10, 5, "1/1"); lcd.show(1, 10, 6, "1/1");
break; break;
} }
uint16_t midi_sync_delay_time = uint16_t(1000.0 * midi_bpm * midi_ticks_factor[sync] / 60.0 + 0.5);
if (midi_sync_delay_time > DELAY_MAX_TIME)
{
#ifdef DEBUG
Serial.println(F("Calculated MIDI-Sync delay: "));
Serial.print(round(1000.0 * midi_bpm * midi_ticks_factor[sync] / 60.0), DEC);
Serial.println(F("ms"));
Serial.println(F("MIDI-Sync delay: midi_sync_delay_time"));
Serial.print(midi_sync_delay_time, DEC);
Serial.println(F("ms"));
#endif
lcd.show(1, 15, 1, "!");
}
} }
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string) void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string)
{ {
#ifdef DEBUG #ifdef DEBUG

@ -101,7 +101,7 @@
// Number of Dexed instances // Number of Dexed instances
#define NUM_DEXED 2 // 1 or 2 - nothing else! #define NUM_DEXED 2 // 1 or 2 - nothing else!
// FX-CHAIN ENABLE/DISABLE // FX-CHAIN ENABLE/DISABLE
//#define USE_FX 1 #define USE_FX 1
// COMPRESSOR/ LIMITER // COMPRESSOR/ LIMITER
#define COMP_THRESHOLD -20.0 #define COMP_THRESHOLD -20.0
#define COMP_ATTACK 0.2 #define COMP_ATTACK 0.2

Loading…
Cancel
Save