Skip to content

Commit

Permalink
set prep mod time in modify()
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Wang committed Jan 29, 2021
1 parent 4229abe commit a068971
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bk_JUCE/bitKlavier/Source/Moddable.h
Expand Up @@ -104,6 +104,7 @@ class Moddable : public ModdableBase
bool modify(Moddable& m, bool reverse)
{
mod = reverse ? base : m.base;
time = m.time;
return modTo(tag<ValueType>{}, m, !reverse);
}

Expand All @@ -113,10 +114,10 @@ class Moddable : public ModdableBase
template<class T = ValueType>
bool modTo(tag<T>, Moddable& m, bool shouldInc)
{
timeElapsed = 0;
if (time > 0)
{
active = true;
timeElapsed = 0;
return false;
}
value = mod;
Expand All @@ -132,11 +133,11 @@ class Moddable : public ModdableBase
if (m.n < m.maxN || m.maxN == 0) m.n++;
}

timeElapsed = 0;
if (time > 0 && (mod - value) != 0)
{
calcDV(tag<ValueType>{});
active = true; //active = m.active;
timeElapsed = 0;
return false;
}
value = mod;
Expand Down

0 comments on commit a068971

Please sign in to comment.