External sync tempo extraction from clock pulses added.

pull/7/head
midilab 7 years ago
parent a3dcc0b109
commit 22bd4880ac
  1. 6
      src/uClock.cpp
  2. 1
      src/uClock.h

@ -163,6 +163,11 @@ uint16_t uClockClass::getTempo()
return tempo; return tempo;
} }
uint8_t uClockClass::getMode()
{
return mode;
}
void uClockClass::setMode(uint8_t tempo_mode) void uClockClass::setMode(uint8_t tempo_mode)
{ {
mode = tempo_mode; mode = tempo_mode;
@ -222,6 +227,7 @@ void uClockClass::handleClock()
} else { } else {
interval = (((uint32_t)interval * (uint32_t)pll_x) + (uint32_t)(256 - pll_x) * (uint32_t)diff) >> 8; interval = (((uint32_t)interval * (uint32_t)pll_x) + (uint32_t)(256 - pll_x) * (uint32_t)diff) >> 8;
} }
tempo = (uint16_t)(156250 / (interval + 16));
break; break;
} }

@ -109,6 +109,7 @@ class uClockClass {
// External timming control // External timming control
void setMode(uint8_t tempo_mode); void setMode(uint8_t tempo_mode);
uint8_t getMode();
void clockMe(); void clockMe();
void shuffle(); void shuffle();

Loading…
Cancel
Save