/* headShadow_dsp adds a perform-routine to the DSP-tree. The first argument is the pointer to the class-data space and a pointer to an array of signals() */ static void headShadow_dsp(t_headShadow *x, t_signal **sp) { x->x_sr = sp[0]->s_sr; headShadow_ft1(x, x->x_hz); dsp_add(headShadow_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, x->x_ctl, sp[0]->s_n); }
static void headShadow_dsp(t_headShadow *x, t_signal **sp) { /*If both left and right in- and out-signals exist, this means: First is the leftmost in-signal followed by the right in-signals; after the right out-signals, finally there comes the leftmost out-signal.*/ x->x_sr = sp[0]->s_sr; headShadow_ft1(x, x->x_hz); dsp_add(headShadow_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, x->x_ctl, sp[0]->s_n); }
static void *headShadow_new(t_floatarg theta) { // constructor of the class that will return a struct x of type t_headShadow t_headShadow *x = (t_headShadow *)pd_new(headShadow_class); // create an inlet for the float argument (in our case the theta for the azimuth angle) // t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1, t_symbol *s2); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1")); // create two outlets for the signal (l and r) outlet_new(&x->x_obj, &s_signal); outlet_new(&x->x_obj, &s_signal); x->x_sr = 44100; x->x_ctl = &x->x_cspace; // set the value of of type t_headShadowctl (our audio inlet) x->x_cspace.c_x = 0; headShadow_ft1(x, theta); // call the method for getting the coefficients x->x_f = 0; return (x); }
static void *headShadow_new(t_floatarg theta) { /* Constructor */ t_headShadow *x = (t_headShadow *)pd_new(headShadow_class); /* Create an inlet for the float argument (in our case the theta for the azimuth angle)*/ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1")); /* Create two outlets for the signal (l and r) */ outlet_new(&x->x_obj, &s_signal); outlet_new(&x->x_obj, &s_signal); x->x_sr = 44100; x->x_ctl = &x->x_cspace; x->x_cspace.c_x = 0; headShadow_ft1(x, theta); x->x_f = 0; x->inm1 = 0; x->lastL = 0; x->lastR = 0; return (x); }