Update of /cvsroot/pure-data/externals/mrpeach/sqosc~ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17983
Modified Files: sqosc~.c Log Message: cleaned up some unused variables
Index: sqosc~.c =================================================================== RCS file: /cvsroot/pure-data/externals/mrpeach/sqosc~/sqosc~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sqosc~.c 10 Apr 2007 03:08:29 -0000 1.3 --- sqosc~.c 3 Jun 2007 16:09:40 -0000 1.4 *************** *** 199,203 **** t_float sample; int n = (int)(w[4]); ! float *addr, f1, f2, frac; int index; double dphase = x->x_phase + UNITBIT32; --- 199,203 ---- t_float sample; int n = (int)(w[4]); ! float f1, f2, frac; int index; double dphase = x->x_phase + UNITBIT32; *************** *** 205,209 **** union tabfudge tf; float conv = x->x_conv; ! double lastin, findex, slewindex; static double twothirds = 2.0/3.0; static double onethird = 1.0/3.0; --- 205,209 ---- union tabfudge tf; float conv = x->x_conv; ! double lastin, slewindex; static double twothirds = 2.0/3.0; static double onethird = 1.0/3.0; *************** *** 217,221 **** slewindex = x->x_slew*lastin; dphase += lastin * conv; /* new phase is old phase + (frequency * table period) */ - /*addr = tab + (tf.tf_i[HIOFFSET] & (SQOSCTABSIZE-1)); */ /* point to the current sample in the table */ index = tf.tf_i[HIOFFSET] & (SQOSCTABSIZE-1); tf.tf_i[HIOFFSET] = normhipart; /* zero the non-fractional part of the phase */ --- 217,220 ---- *************** *** 224,228 **** { tf.tf_d = dphase; - /*f1 = addr[0]; */ /* first sample */ if (index <= slewindex) { /* rising phase */ --- 223,226 ---- *************** *** 234,240 **** x->x_pulse_ended = 0; } ! /*findex = (index/(x->x_slew*lastin))*HALFSQOSCTABSIZE;*/ ! /*addr = tab + HALFSQOSCTABSIZE + (int)findex; */ ! f1 = 1.0-2.0*(slewindex-index)/slewindex;/* a ramp from -1 to +1 */ /* addr[0];*/ f1 = f1 - pow(f1, 3.0)*onethird;/* smooth the ramp */ } --- 232,236 ---- x->x_pulse_ended = 0; } ! f1 = 1.0-2.0*(slewindex-index)/slewindex;/* a ramp from -1 to +1 */ f1 = f1 - pow(f1, 3.0)*onethird;/* smooth the ramp */ } *************** *** 242,246 **** else if (index <= slewindex+x->x_dpw) { /* falling phase */ ! f1 = -1.0+2.0*(slewindex-index+x->x_dpw)/slewindex;/* a ramp from +1 to -1 */ /* addr[0];*/ f1 = f1 - pow(f1, 3.0)*onethird;/* smooth the ramp */ x->x_pulse_ended = 1; --- 238,242 ---- else if (index <= slewindex+x->x_dpw) { /* falling phase */ ! f1 = -1.0+2.0*(slewindex-index+x->x_dpw)/slewindex;/* a ramp from +1 to -1 */ f1 = f1 - pow(f1, 3.0)*onethird;/* smooth the ramp */ x->x_pulse_ended = 1; *************** *** 255,262 **** slewindex = x->x_slew*lastin; dphase += lastin * conv; /* next phase */ - /*f2 = addr[1]; */ /* second sample */ if (index+1 <= slewindex) { ! f2 = 1.0-2.0*(slewindex-index-1)/slewindex;/* addr[1]; */ f2 = f2 - pow(f2, 3.0)*onethird; } --- 251,257 ---- slewindex = x->x_slew*lastin; dphase += lastin * conv; /* next phase */ if (index+1 <= slewindex) { ! f2 = 1.0-2.0*(slewindex-index-1)/slewindex; f2 = f2 - pow(f2, 3.0)*onethird; } *************** *** 264,268 **** else if (index+1 <= slewindex+x->x_dpw) { ! f2 = -1.0+2.0*(slewindex-index-1+x->x_dpw)/slewindex;/* addr[1]; */ f2 = f2 - pow(f2, 3.0)*onethird; } --- 259,263 ---- else if (index+1 <= slewindex+x->x_dpw) { ! f2 = -1.0+2.0*(slewindex-index-1+x->x_dpw)/slewindex; f2 = f2 - pow(f2, 3.0)*onethird; } *************** *** 271,275 **** sample = f1 + frac * (f2 - f1); /* output first sample plus fraction of second sample (linear interpolation) */ *out++ = sample; - /* addr = tab + (tf.tf_i[HIOFFSET] & (SQOSCTABSIZE-1)); */ /* point to the next sample */ index = tf.tf_i[HIOFFSET] & (SQOSCTABSIZE-1); tf.tf_i[HIOFFSET] = normhipart; /* zero the non-fractional part */ --- 266,269 ---- *************** *** 277,281 **** frac = tf.tf_d - UNITBIT32; /* get next fractional part */ } - /* f1 = addr[0]; */ if (index <= slewindex) { --- 271,274 ---- *************** *** 287,293 **** x->x_pulse_ended = 0; } ! /* findex = (index/(x->x_slew*lastin))*HALFSQOSCTABSIZE; */ ! /* addr = tab + HALFSQOSCTABSIZE + (int)findex; */ ! f1 = 1.0-2.0*(slewindex-index)/slewindex;/* addr[0]; */ f1 = f1 - pow(f1, 3.0)*onethird; } --- 280,284 ---- x->x_pulse_ended = 0; } ! f1 = 1.0-2.0*(slewindex-index)/slewindex; f1 = f1 - pow(f1, 3.0)*onethird; } *************** *** 295,301 **** else if (index <= slewindex+x->x_dpw) { /* falling phase */ ! /* findex = ((index-HALFSQOSCTABSIZE)/(x->x_slew*lastin))*HALFSQOSCTABSIZE;*/ ! /* addr = tab + (int)findex; */ ! f1 = -1.0+2.0*(slewindex-index+x->x_dpw)/slewindex;/* addr[0]; */ f1 = f1 - pow(f1, 3.0)*onethird; x->x_pulse_ended = 1; --- 286,290 ---- else if (index <= slewindex+x->x_dpw) { /* falling phase */ ! f1 = -1.0+2.0*(slewindex-index+x->x_dpw)/slewindex; f1 = f1 - pow(f1, 3.0)*onethird; x->x_pulse_ended = 1; *************** *** 305,312 **** f1 = -twothirds; } - /* f2 = addr[1]; */ /* second sample */ if (index+1 <= slewindex) { ! f2 = 1.0-2.0*(slewindex-index-1)/slewindex;/* addr[1];*/ f2 = f2 - pow(f2, 3.0)*onethird; } --- 294,300 ---- f1 = -twothirds; } if (index+1 <= slewindex) { ! f2 = 1.0-2.0*(slewindex-index-1)/slewindex; f2 = f2 - pow(f2, 3.0)*onethird; } *************** *** 314,318 **** else if (index+1 <= slewindex+x->x_dpw) { ! f2 = -1.0+2.0*(slewindex-index-1+x->x_dpw)/slewindex;/* addr[1];*/ f2 = f2 - pow(f2, 3.0)*onethird; } --- 302,306 ---- else if (index+1 <= slewindex+x->x_dpw) { ! f2 = -1.0+2.0*(slewindex-index-1+x->x_dpw)/slewindex; f2 = f2 - pow(f2, 3.0)*onethird; }