/* routine to check that all delwrites/delreads/vds have same vecsize */ static void sigdelwrite_checkvecsize(t_sigdelwrite *x, int vecsize) { if (x->x_rsortno != ugen_getsortno()) { x->x_vecsize = vecsize; x->x_rsortno = ugen_getsortno(); } /* LATER this should really check sample rate and blocking, once that is supported. Probably we don't actually care about vecsize. For now just suppress this check. */ #if 0 else if (vecsize != x->x_vecsize) pd_error(x, "delread/delwrite/vd vector size mismatch"); #endif }
static void sigdelwrite_dsp(t_sigdelwrite *x, t_signal **sp) { dsp_add(sigdelwrite_perform, 3, sp[0]->s_vec, &x->x_cspace, sp[0]->s_n); x->x_sortno = ugen_getsortno(); sigdelwrite_checkvecsize(x, sp[0]->s_n); sigdelwrite_updatesr(x, sp[0]->s_sr); }
static void sigvd_dsp(t_sigvd *x, t_signal **sp) { t_sigdelwrite *delwriter = (t_sigdelwrite *)pd_findbyclass(x->x_sym, sigdelwrite_class); x->x_sr = sp[0]->s_sr * 0.001; if (delwriter) { sigdelwrite_checkvecsize(delwriter, sp[0]->s_n); x->x_zerodel = (delwriter->x_sortno == ugen_getsortno() ? 0 : delwriter->x_vecsize); dsp_add(sigvd_perform, 5, sp[0]->s_vec, sp[1]->s_vec, &delwriter->x_cspace, x, sp[0]->s_n); } else error("vd~: %s: no such delwrite~",x->x_sym->s_name); }
static void sigdelread_dsp(t_sigdelread *x, t_signal **sp) { t_sigdelwrite *delwriter = (t_sigdelwrite *)pd_findbyclass(x->x_sym, sigdelwrite_class); x->x_sr = sp[0]->s_sr * 0.001; x->x_n = sp[0]->s_n; if (delwriter) { sigdelwrite_checkvecsize(delwriter, sp[0]->s_n); x->x_zerodel = (delwriter->x_sortno == ugen_getsortno() ? 0 : delwriter->x_vecsize); sigdelread_float(x, x->x_deltime); dsp_add(sigdelread_perform, 4, sp[0]->s_vec, &delwriter->x_cspace, &x->x_delsamps, sp[0]->s_n); } else if (*x->x_sym->s_name) error("delread~: %s: no such delwrite~",x->x_sym->s_name); }