Skip to content

Commit

Permalink
LinXFade2 - fix pos slope
Browse files Browse the repository at this point in the history
  • Loading branch information
timblechmann committed Jan 16, 2016
1 parent 051b909 commit 37e2458
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/plugins/PanUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,18 +712,18 @@ FLATTEN void LinXFade2_next_k_nova(LinXFade2 *unit, int inNumSamples)
float amp = unit->m_amp;

if (pos != unit->m_pos) {
float oldAmpLeft = amp;
float oldAmpRight = 1.f - amp;
float oldAmpRight = amp;
float oldAmpLeft = 1.f - amp;

pos = sc_clip(pos, -1.f, 1.f);

float nextAmpRight = pos * 0.5f + 0.5f;
float nextAmpLeft = 1.f - nextAmpRight;
float nextAmpLeft = 1.f - nextAmpRight;

float leftSlope = CALCSLOPE(nextAmpLeft, oldAmpLeft);
float rightSlope = CALCSLOPE(nextAmpRight, oldAmpRight);

unit->m_amp = nextAmpLeft;
unit->m_amp = nextAmpRight;
unit->m_pos = pos;

nova::mix_vec_simd(OUT(0), IN(0), nova::slope_argument(oldAmpLeft, leftSlope),
Expand Down

0 comments on commit 37e2458

Please sign in to comment.