Skip to content

Commit

Permalink
sounds awesome, but buggy now
Browse files Browse the repository at this point in the history
  • Loading branch information
tom7 authored and sophiapoirier committed Oct 25, 2004
1 parent 1d7b706 commit 66cd975
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion slowft/slowft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@ void PLUGINCORE::processw(float * in, float * out, long samples) {

/* XXX do ops... */

int maxkey = 0;
{
float maxval = 0.0;
for(int k = 0; k < NUM_KEYS; k ++) {
float tval = abs(sines[k]) + abs(cosines[k]);
if (tval > maxval) {
maxkey = k;
maxval = tval;
}
}
}

/* now generate output! */

Expand All @@ -199,14 +210,15 @@ void PLUGINCORE::processw(float * in, float * out, long samples) {
/* now add back in sines and cosines */
for(int key = 0; key < NUM_KEYS; key ++) {

if (key == maxkey)
for(int s = 0; s < samples; s ++) {

float seconds = ((float)s / (float)rate);

/* argument to sin, cosine. */
float arg = freq * seconds * SLOWFT_2PI;

out[s] += sin(arg) + cos(arg);
out[s] += (sines[key] * sin(arg)) + (cosines[key] * cos(arg));

}

Expand Down

0 comments on commit 66cd975

Please sign in to comment.