[PD-cvs] pd/src d_ctl.c,1.1.1.3.2.8,1.1.1.3.2.9
Tim Blechmann
timblech at users.sourceforge.net
Fri Sep 3 09:50:43 CEST 2004
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv822
Modified Files:
Tag: devel_0_37
d_ctl.c
Log Message:
improvement for line~ and vectorizing
Index: d_ctl.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_ctl.c,v
retrieving revision 1.1.1.3.2.8
retrieving revision 1.1.1.3.2.9
diff -C2 -d -r1.1.1.3.2.8 -r1.1.1.3.2.9
*** d_ctl.c 23 Jul 2004 08:46:40 -0000 1.1.1.3.2.8
--- d_ctl.c 3 Sep 2004 07:50:40 -0000 1.1.1.3.2.9
***************
*** 135,140 ****
else
{
! x->x_value = x->x_target;
! while (n--) *out++ = x->x_value;
}
return (w+4);
--- 135,180 ----
else
{
! float g = x->x_value = x->x_target;
! while (n--)
! *out++ = g;
! }
! return (w+4);
! }
!
! /* TB: vectorized version */
! static t_int *line_tilde_perf8(t_int *w)
! {
! t_line *x = (t_line *)(w[1]);
! t_float *out = (t_float *)(w[2]);
! int n = (int)(w[3]);
! float f = x->x_value;
!
! if (PD_BIGORSMALL(f))
! x->x_value = f = 0;
! if (x->x_retarget)
! {
! int nticks = x->x_inletwas * x->x_dspticktomsec;
! if (!nticks) nticks = 1;
! x->x_ticksleft = nticks;
! x->x_biginc = (x->x_target - x->x_value)/(float)nticks;
! x->x_inc = x->x_1overn * x->x_biginc;
! x->x_retarget = 0;
! }
! if (x->x_ticksleft)
! {
! float f = x->x_value;
! while (n--) *out++ = f, f += x->x_inc;
! x->x_value += x->x_biginc;
! x->x_ticksleft--;
! }
! else
! {
! float f = x->x_value = x->x_target;
! for (; n; n -= 8, out += 8)
! {
! out[0] = f; out[1] = f; out[2] = f; out[3] = f;
! out[4] = f; out[5] = f; out[6] = f; out[7] = f;
! }
!
}
return (w+4);
***************
*** 165,169 ****
static void line_tilde_dsp(t_line *x, t_signal **sp)
{
! dsp_add(line_tilde_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
x->x_1overn = 1./sp[0]->s_n;
x->x_dspticktomsec = sp[0]->s_sr / (1000 * sp[0]->s_n);
--- 205,212 ----
static void line_tilde_dsp(t_line *x, t_signal **sp)
{
! if(sp[0]->s_n&7)
! dsp_add(line_tilde_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
! else
! dsp_add(line_tilde_perf8, 3, x, sp[0]->s_vec, sp[0]->s_n);
x->x_1overn = 1./sp[0]->s_n;
x->x_dspticktomsec = sp[0]->s_sr / (1000 * sp[0]->s_n);
More information about the Pd-cvs
mailing list