Example #1
0
static void *nrcombf_new(t_symbol *s, int argc, t_atom *argv)
{
	t_float time = 1000;
	t_float fb = 0;
	t_symbol *sarg;
	int norm = 0, i = 0;
    t_nrcombf *x = (t_nrcombf *)pd_new(nrcombf_class);
    for(; i < argc; i++)
    	if (argv[i].a_type == A_FLOAT) {
    		time = atom_getfloatarg(i++, argc, argv);
    		break;
    	} else {
    		sarg = atom_getsymbolarg(i, argc, argv);
    		if (!strcmp(sarg->s_name, "-n")) norm = 1;
    		else if(!strcmp(sarg->s_name, "-l")) {
    			i++;
    			x->x_ttime = atom_getfloatarg(i, argc, argv);
    		}
		}
	for(; i < argc; i++)
    	if (argv[i].a_type == A_FLOAT) {
    		fb = atom_getfloatarg(i++, argc, argv);
    		break;
    	} else {
    		sarg = atom_getsymbolarg(i, argc, argv);
    		if (!strcmp(sarg->s_name, "-n")) norm = 1;
    		else if(!strcmp(sarg->s_name, "-l")) {
    			i++;
    			x->x_ttime = atom_getfloatarg(i, argc, argv);
    		}
		}
	for(; i < argc; i++)
    	if (argv[i].a_type == A_FLOAT) {
    		x->x_ttime = atom_getfloatarg(i, argc, argv);
    	} else {
    		sarg = atom_getsymbolarg(i, argc, argv);
    		if (!strcmp(sarg->s_name, "-n")) norm = 1;
		}
    signalinlet_new(&x->x_obj, time);
    signalinlet_new(&x->x_obj, fb);
	if(!norm)
		signalinlet_new(&x->x_obj, 1.0);
    outlet_new(&x->x_obj, &s_signal);
    x->x_f = 0;
    x->c_n = 0;
    x->c_vec = getbytes(XTRASAMPS * sizeof(t_sample));
    memset((char *)(x->c_vec), 0, 
		sizeof(t_sample)*(XTRASAMPS));
    x->norm = norm;
    return(x);
}
Example #2
0
static void *leeloo_new(t_float f)
{
    size_t i;
    t_leeloo *x = (t_leeloo *)pd_new(leeloo_class);
    if(x)
    {
        x->l_nios = (f < 1) ? 1 : (size_t)f;
        for(i = 1; i < x->l_nios; ++i)
        {
            signalinlet_new((t_object *)x, 0);
            outlet_new((t_object *)x, &s_signal);
        }
        outlet_new((t_object *)x, &s_signal);
        x->l_vsize = 0;
        x->l_vtemp = NULL;
    }
    
    return (x);
}