Skip to content

Commit

Permalink
bugfix for XLine
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Blechmann <[email protected]>
  • Loading branch information
cappelnord authored and timblechmann committed Nov 20, 2010
1 parent ff25475 commit f27e46b
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions common/Source/plugins/LFUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1685,9 +1685,8 @@ void XLine_next(XLine *unit, int inNumSamples)
if (counter==0) {
int nsmps = remain;
remain = 0;
float endlevel = unit->mEndLevel;
LOOP(nsmps,
ZXP(out) = endlevel;
ZXP(out) = level;
);
} else {
int nsmps = sc_min(remain, counter);
Expand All @@ -1698,6 +1697,7 @@ void XLine_next(XLine *unit, int inNumSamples)
level *= grow;
);
if (counter == 0) {
level = unit->mEndLevel;
unit->mDone = true;
int doneAction = (int)ZIN0(3);
DoneAction(doneAction, unit);
Expand Down Expand Up @@ -1736,9 +1736,8 @@ inline_functions void XLine_next_nova(XLine *unit, int inNumSamples)
if (counter==0) {
int nsmps = remain;
remain = 0;
float endlevel = unit->mEndLevel;
LOOP(nsmps,
ZXP(out) = endlevel;
ZXP(out) = level;
);
} else {
int nsmps = sc_min(remain, counter);
Expand All @@ -1749,6 +1748,7 @@ inline_functions void XLine_next_nova(XLine *unit, int inNumSamples)
level *= grow;
);
if (counter == 0) {
level = unit->mEndLevel;
unit->mDone = true;
int doneAction = (int)ZIN0(3);
DoneAction(doneAction, unit);
Expand Down Expand Up @@ -1787,9 +1787,8 @@ inline_functions void XLine_next_nova_64(XLine *unit, int inNumSamples)
if (counter==0) {
int nsmps = remain;
remain = 0;
float endlevel = unit->mEndLevel;
LOOP(nsmps,
ZXP(out) = endlevel;
ZXP(out) = level;
);
} else {
int nsmps = sc_min(remain, counter);
Expand All @@ -1800,6 +1799,7 @@ inline_functions void XLine_next_nova_64(XLine *unit, int inNumSamples)
level *= grow;
);
if (counter == 0) {
level = unit->mEndLevel;
unit->mDone = true;
int doneAction = (int)ZIN0(3);
DoneAction(doneAction, unit);
Expand Down Expand Up @@ -1829,12 +1829,19 @@ void XLine_Ctor(XLine* unit)
double dur = ZIN0(2);

int counter = (int)(dur * unit->mRate->mSampleRate + .5f);

if(counter == 0) {
ZOUT0(0) = end;

} else {
ZOUT0(0) = start;
}

unit->mCounter = sc_max(1, counter);
unit->mGrowth = pow(end / start, 1.0 / counter);
unit->mGrowth = pow(end / start, 1.0 / unit->mCounter);
unit->mLevel = start;
unit->mEndLevel = end;

ZOUT0(0) = unit->mLevel;
unit->mLevel *= unit->mGrowth;
}

Expand Down

0 comments on commit f27e46b

Please sign in to comment.