phaseshift~ ok
@@ -20,13 +20,11 @@ typedef struct _phaseshift {
static t_class *phaseshift_class;
-void phaseshift_clear(t_phaseshift *x)
-{
+void phaseshift_clear(t_phaseshift *x){
x->x_x1 = x->x_x2 = x->x_y1 = x->x_y2 = 0.;
}
-static t_int *phaseshift_perform(t_int *w)
-{
+static t_int *phaseshift_perform(t_int *w){
t_phaseshift *x = (t_phaseshift *)(w[1]);
int nblock = (int)(w[2]);
t_float *in1 = (t_float *)(w[3]);
@@ -39,8 +37,7 @@ static t_int *phaseshift_perform(t_int *w)
t_float y2 = x->x_y2;
t_float nyq = x->x_nyq;
t_float lastq = x->x_lastq;
- while (nblock--)
- {
+ while (nblock--){
float omega, alphaQ, b0, a0, a1, yn, xn = *in1++, f = *in2++, q = *in3++;
if (q < 0) q = lastq;
lastq = q;
@@ -66,15 +63,13 @@ static t_int *phaseshift_perform(t_int *w)
return (w + 7);
}
-static void phaseshift_dsp(t_phaseshift *x, t_signal **sp)
-{
+static void phaseshift_dsp(t_phaseshift *x, t_signal **sp){
x->x_nyq = sp[0]->s_sr / 2;
dsp_add(phaseshift_perform, 6, x, sp[0]->s_n, sp[0]->s_vec,
sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec);
}
-static void *phaseshift_new(t_floatarg f1, t_floatarg f2)
-{
+static void *phaseshift_new(t_floatarg f1, t_floatarg f2){
t_phaseshift *x = (t_phaseshift *)pd_new(phaseshift_class);
x->x_inlet_freq = inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
pd_float((t_pd *)x->x_inlet_freq, f1);
@@ -86,12 +81,10 @@ static void *phaseshift_new(t_floatarg f1, t_floatarg f2)
x->x_x2 = 0;
x->x_y2 = 0;
x->x_lastq = 1;
- // pd_error(x, "[cyclone/phaseshift~] is not ready yet");
return (x);
}
-void phaseshift_tilde_setup(void)
-{
+void phaseshift_tilde_setup(void){
phaseshift_class = class_new(gensym("phaseshift~"), (t_newmethod)phaseshift_new, 0,
sizeof(t_phaseshift), CLASS_DEFAULT, A_DEFFLOAT, A_DEFFLOAT, 0);
class_addmethod(phaseshift_class, (t_method)phaseshift_dsp, gensym("dsp"), A_CANT, 0);
