예제 #1
0
파일: cycle.c 프로젝트: EQ4/Pd-for-LibPd
static void cycle_gettable(t_cycle *x)
{
    x->x_table = 0;
    if (x->x_name)
    {
        int tabsize = 0;
        t_float *table = vefl_get(x->x_name, &tabsize, 1, (t_pd *)x);
        /* CHECKED buffer is copied */
        if (table)
        {
            int indx = x->x_offset + CYCLE_TABSIZE;
            t_float *ptr = x->x_usertable + CYCLE_TABSIZE;
            if (indx == tabsize)
            {
                *ptr-- = *table;
                indx--;
            }
            if (indx < tabsize)
            {
                table += indx;
                indx -= x->x_offset;
                while (indx--) *ptr-- = *table--;
                x->x_table = x->x_usertable;
            }
            /* CHECKED else no complaint */
        }
    }
    else x->x_table = x->x_costable;
    if (!x->x_table)
    {
        /* CHECKED (incompatible) cycle~ is disabled -- garbage is output */
        x->x_table = x->x_usertable;
        memset(x->x_table, 0, (CYCLE_TABSIZE + 1) * sizeof(*x->x_table));
    }
}
예제 #2
0
파일: funbuff.c 프로젝트: ma4u/pd-macambira
static void funbuff_interptab(t_funbuff *x, t_symbol *s, t_floatarg f)
{
    int vsz;
    t_float *vec;
    if (vec = vefl_get(s, &vsz, 0, (t_pd *)x))
    {
        if (vsz > 2)
            funbuff_dointerp(x, f, vsz, vec);
        else
            funbuff_dointerp(x, f, 0, 0);
    }
}
예제 #3
0
파일: arsic.c 프로젝트: EQ4/Pd-for-LibPd
void arsic_validate(t_arsic *x, int complain)
{
    arsic_clear(x);
    x->s_vecsize = SHARED_INT_MAX;
    if (x->s_mononame)
    {
	x->s_vectors[0] =
	    vefl_get(x->s_mononame, &x->s_vecsize, 1,
		     (complain ? (t_pd *)x : 0));
    }
    else if (*x->s_stub)
    {
	int ch;
	for (ch = 0; ch < x->s_nchannels ; ch++)
	{
	    int vsz = x->s_vecsize;  /* ignore missing arrays */
	    x->s_vectors[ch] =
		vefl_get(x->s_channames[ch], &vsz, 1,
			 (complain ? (t_pd *)x : 0));
	    if (vsz < x->s_vecsize) x->s_vecsize = vsz;
	}
    }
    if (x->s_vecsize == SHARED_INT_MAX) x->s_vecsize = 0;
}