|
|
|
@ -222,11 +222,12 @@ void create_audio_engine_chain(uint8_t instance_id) |
|
|
|
|
uint8_t sd_card = 0; |
|
|
|
|
Sd2Card card; |
|
|
|
|
SdVolume volume; |
|
|
|
|
float midi_ticks_factor[10] = {0.0, 0.0625, 0.09375, 0.125, 0.1875, 0.25, 0.375, 0.5, 0.75 , 1.0}; |
|
|
|
|
//float midi_ticks_factor[10] = {0.0, 0.0625, 0.09375, 0.125, 0.1875, 0.25, 0.375, 0.5, 0.75 , 1.0};
|
|
|
|
|
float midi_ticks_factor[10] = {0.0, 0.25, 0.375, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0 , 4.0}; |
|
|
|
|
uint8_t midi_bpm_counter = 0; |
|
|
|
|
uint8_t midi_bpm = 0; |
|
|
|
|
int16_t _midi_bpm = -1; |
|
|
|
|
bool midi_clock_running = false; |
|
|
|
|
//midi_bpmbool midi_clock_running = false;
|
|
|
|
|
elapsedMillis midi_bpm_timer; |
|
|
|
|
elapsedMillis long_button_pressed; |
|
|
|
|
elapsedMillis control_rate; |
|
|
|
@ -1370,8 +1371,8 @@ void handleTuneRequest(void) |
|
|
|
|
|
|
|
|
|
void handleClock(void) |
|
|
|
|
{ |
|
|
|
|
if (midi_clock_running != true) |
|
|
|
|
return; |
|
|
|
|
//if (midi_clock_running != true)
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
if (midi_bpm_counter % 24 == 0) |
|
|
|
|
{ |
|
|
|
@ -1403,10 +1404,12 @@ void handleClock(void) |
|
|
|
|
{ |
|
|
|
|
if (configuration.fx.delay_sync[instance_id] > 0) |
|
|
|
|
{ |
|
|
|
|
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); |
|
|
|
|
uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / float(midi_bpm) + 0.5); |
|
|
|
|
delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10)); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Setting Delay-Sync to ")); |
|
|
|
|
Serial.print(F("Setting Delay-Sync of instance ")); |
|
|
|
|
Serial.print(instance_id); |
|
|
|
|
Serial.print(F(" to ")); |
|
|
|
|
Serial.print(constrain(midi_sync_delay_time, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10), DEC); |
|
|
|
|
Serial.println(F(" ms")); |
|
|
|
|
#endif |
|
|
|
@ -1425,7 +1428,7 @@ void handleClock(void) |
|
|
|
|
|
|
|
|
|
void handleStart(void) |
|
|
|
|
{ |
|
|
|
|
midi_clock_running = true; |
|
|
|
|
//midi_clock_running = true;
|
|
|
|
|
midi_bpm_timer = 0; |
|
|
|
|
midi_bpm_counter = 0; |
|
|
|
|
_midi_bpm = -1; |
|
|
|
@ -1433,12 +1436,12 @@ void handleStart(void) |
|
|
|
|
|
|
|
|
|
void handleContinue(void) |
|
|
|
|
{ |
|
|
|
|
midi_clock_running = true; |
|
|
|
|
//midi_clock_running = true;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleStop(void) |
|
|
|
|
{ |
|
|
|
|
midi_clock_running = false; |
|
|
|
|
//midi_clock_running = false;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handleActiveSensing(void) |
|
|
|
|