Update of /cvsroot/pure-data/pd/extra/loop~ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/pd/extra/loop~
Modified Files: loop~.c Log Message: 0.38 test 9 (mostly bug fixes)
Index: loop~.c =================================================================== RCS file: /cvsroot/pure-data/pd/extra/loop~/loop~.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** loop~.c 8 Aug 2002 16:42:32 -0000 1.2 --- loop~.c 6 Nov 2004 16:07:23 -0000 1.3 *************** *** 25,29 ****
static void loopctl_run(t_loopctl *x, float *transposein, ! float *windowin, float *rawout, float *windowout, int n) { float window, invwindow; --- 25,29 ----
static void loopctl_run(t_loopctl *x, float *transposein, ! float *windowin, float *rawout, float *windowout, int n) { float window, invwindow; *************** *** 31,83 **** if (x->l_resync) { ! window = *windowin; ! if (window < 0) ! { ! if (window > -1) ! window = -1; ! invwindow = -1/window; ! } ! else ! { ! if (window < 1) ! window = 1; ! invwindow = 1/window; ! } ! x->l_resync = 0; } else { ! window = x->l_window; ! phase = x->l_phase; ! invwindow = x->l_invwindow; } while (n--) { ! double phaseinc = invwindow * *transposein++; ! double newphase; ! float nwind = *windowin++; ! if (phaseinc >= 1 || phaseinc < 0) ! phaseinc = 0; ! newphase = phase + phaseinc; ! if (newphase >= 1) ! { ! window = nwind; ! if (window < 0) ! { ! if (window > -1) ! window = -1; ! invwindow = -1/window; ! } ! else ! { ! if (window < 1) ! window = 1; ! invwindow = 1/window; ! } ! newphase -= 1.; ! } ! phase = newphase; ! *rawout++ = (float)phase; ! *windowout++ = window; } x->l_invwindow = invwindow; --- 31,83 ---- if (x->l_resync) { ! window = *windowin; ! if (window < 0) ! { ! if (window > -1) ! window = -1; ! invwindow = -1/window; ! } ! else ! { ! if (window < 1) ! window = 1; ! invwindow = 1/window; ! } ! x->l_resync = 0; } else { ! window = x->l_window; ! phase = x->l_phase; ! invwindow = x->l_invwindow; } while (n--) { ! double phaseinc = invwindow * *transposein++; ! double newphase; ! float nwind = *windowin++; ! if (phaseinc >= 1 || phaseinc < 0) ! phaseinc = 0; ! newphase = phase + phaseinc; ! if (newphase >= 1) ! { ! window = nwind; ! if (window < 0) ! { ! if (window > -1) ! window = -1; ! invwindow = -1/window; ! } ! else ! { ! if (window < 1) ! window = 1; ! invwindow = 1/window; ! } ! newphase -= 1.; ! } ! phase = newphase; ! *rawout++ = (float)phase; ! *windowout++ = window; } x->l_invwindow = invwindow; *************** *** 96,100 **** { if (val < 0 || val > 1) ! val = 0; x->l_phase = val; x->l_resync = 1; --- 96,100 ---- { if (val < 0 || val > 1) ! val = 0; x->l_phase = val; x->l_resync = 1; *************** *** 137,142 **** { dsp_add(loop_perform, 6, ! &x->x_loopctl, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, ! sp[0]->s_n); }
--- 137,142 ---- { dsp_add(loop_perform, 6, ! &x->x_loopctl, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, ! sp[0]->s_n); }
*************** *** 154,162 **** { loop_class = class_new(gensym("loop~"), (t_newmethod)loop_new, 0, ! sizeof(t_loop), 0, 0); class_addmethod(loop_class, (t_method)loop_dsp, gensym("dsp"), A_CANT, 0); CLASS_MAINSIGNALIN(loop_class, t_loop, x_f); class_addmethod(loop_class, (t_method)loop_set, gensym("set"), ! A_DEFFLOAT, 0); class_addbang(loop_class, loop_bang); } --- 154,162 ---- { loop_class = class_new(gensym("loop~"), (t_newmethod)loop_new, 0, ! sizeof(t_loop), 0, 0); class_addmethod(loop_class, (t_method)loop_dsp, gensym("dsp"), A_CANT, 0); CLASS_MAINSIGNALIN(loop_class, t_loop, x_f); class_addmethod(loop_class, (t_method)loop_set, gensym("set"), ! A_DEFFLOAT, 0); class_addbang(loop_class, loop_bang); }