Small fixes for MIDI-clock-synced delay.

pull/46/head
Holger Wirtz 3 years ago
parent 66b872db96
commit 75901c90d6
  1. 10
      MicroDexed.ino

@ -222,12 +222,10 @@ void create_audio_engine_chain(uint8_t instance_id)
uint8_t sd_card = 0; uint8_t sd_card = 0;
Sd2Card card; Sd2Card card;
SdVolume volume; 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.25, 0.375, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0 , 4.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_counter = 0;
uint8_t midi_bpm = 0; uint8_t midi_bpm = 0;
int16_t _midi_bpm = -1; int16_t _midi_bpm = -1;
//midi_bpmbool midi_clock_running = false;
elapsedMillis midi_bpm_timer; elapsedMillis midi_bpm_timer;
elapsedMillis long_button_pressed; elapsedMillis long_button_pressed;
elapsedMillis control_rate; elapsedMillis control_rate;
@ -1371,9 +1369,6 @@ void handleTuneRequest(void)
void handleClock(void) void handleClock(void)
{ {
//if (midi_clock_running != true)
// return;
if (midi_bpm_counter % 24 == 0) if (midi_bpm_counter % 24 == 0)
{ {
midi_bpm = (60000.0f / float(midi_bpm_timer) + 0.5); midi_bpm = (60000.0f / float(midi_bpm_timer) + 0.5);
@ -1428,7 +1423,6 @@ void handleClock(void)
void handleStart(void) void handleStart(void)
{ {
//midi_clock_running = true;
midi_bpm_timer = 0; midi_bpm_timer = 0;
midi_bpm_counter = 0; midi_bpm_counter = 0;
_midi_bpm = -1; _midi_bpm = -1;
@ -1436,12 +1430,12 @@ void handleStart(void)
void handleContinue(void) void handleContinue(void)
{ {
//midi_clock_running = true; ;
} }
void handleStop(void) void handleStop(void)
{ {
//midi_clock_running = false; ;
} }
void handleActiveSensing(void) void handleActiveSensing(void)

Loading…
Cancel
Save