Skip to content

Commit

Permalink
fixed up stereoharm (and turns out I was wrong on how memcpy works \f…
Browse files Browse the repository at this point in the history
…acepalm\)
  • Loading branch information
ssj71 committed Aug 8, 2015
1 parent a9ac09c commit 9226e6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/Harmonizer.C
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ Harmonizer::out (float *smpsl, float *smpsr, uint32_t period)
adjust(DS_state,period);//readjust now that we know period size
}
if((DS_state != 0) && (Pinterval !=12)) {
// memcpy(smpsl,templ, sizeof(float)*period);
// memcpy(smpsr,tempr, sizeof(float)*period);
U_Resample->out(smpsl,smpsr,templ,tempr,period,u_up);
}

Expand All @@ -141,7 +139,7 @@ Harmonizer::out (float *smpsl, float *smpsr, uint32_t period)
if((DS_state != 0) && (Pinterval != 12)) {
D_Resample->mono_out(outo,templ,nPERIOD,u_down,period);
} else {
memcpy(smpsl, templ,sizeof(float)*period);
memcpy(templ,smpsl, sizeof(float)*period);
}

applyfilters (templ,period);
Expand Down
10 changes: 5 additions & 5 deletions src/StereoHarm.C
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,22 @@ StereoHarm::out (float *smpsl, float *smpsr, uint32_t period)


if(DS_state != 0) {
memcpy(templ, smpsl,sizeof(float)*period);
memcpy(tempr, smpsr,sizeof(float)*period);
U_Resample->out(templ,tempr,smpsl,smpsr,period,u_up);
// memcpy(templ, smpsl,sizeof(float)*period);
// memcpy(tempr, smpsr,sizeof(float)*period);
U_Resample->out(smpsl,smpsr,templ,tempr,period,u_up);
}


for (i = 0; i < nPERIOD; i++) {


outil[i] = smpsl[i] * (1.0f - lrcross) + smpsr[i] * lrcross;
outil[i] = templ[i] * (1.0f - lrcross) + tempr[i] * lrcross;
if (outil[i] > 1.0)
outil[i] = 1.0f;
if (outil[i] < -1.0)
outil[i] = -1.0f;

outir[i] = smpsr[i] * (1.0f - lrcross) + smpsl[i] * lrcross;
outir[i] = tempr[i] * (1.0f - lrcross) + templ[i] * lrcross;
if (outir[i] > 1.0)
outir[i] = 1.0f;
if (outir[i] < -1.0)
Expand Down

0 comments on commit 9226e6d

Please sign in to comment.