5 #define LOGTEN 2.302585092994
7 typedef struct dbtorms_tilde
13 t_class
*dbtorms_tilde_class
;
15 static void *dbtorms_tilde_new(void)
17 t_dbtorms_tilde
*x
= (t_dbtorms_tilde
*)pd_new(dbtorms_tilde_class
);
18 outlet_new(&x
->x_obj
, gensym("signal"));
23 static t_int
*dbtorms_tilde_perform(t_int
*w
)
25 float *in
= *(t_float
**)(w
+1), *out
= *(t_float
**)(w
+2);
26 t_int n
= *(t_int
*)(w
+3);
27 for (; n
--; in
++, out
++)
35 *out
= exp((LOGTEN
* 0.05) * (f
-100.));
41 static void dbtorms_tilde_dsp(t_dbtorms_tilde
*x
, t_signal
**sp
)
43 post("warning: %s not usable yet",__FUNCTION__
);
44 dsp_add(dbtorms_tilde_perform
, 3, sp
[0]->s_vec
, sp
[1]->s_vec
, sp
[0]->s_n
);
47 void dbtorms_tilde_setup(void)
49 dbtorms_tilde_class
= class_new(gensym("dbtorms~"), (t_newmethod
)dbtorms_tilde_new
, 0,
50 sizeof(t_dbtorms_tilde
), 0, 0);
51 CLASS_MAINSIGNALIN(dbtorms_tilde_class
, t_dbtorms_tilde
, x_f
);
52 class_addmethod(dbtorms_tilde_class
, (t_method
)dbtorms_tilde_dsp
, gensym("dsp"), 0);
58 #define LOGTEN 2.302585092994
60 typedef struct dbtorms_tilde
66 t_class
*dbtorms_tilde_class
;
68 static void *dbtorms_tilde_new(void)
70 t_dbtorms_tilde
*x
= (t_dbtorms_tilde
*)pd_new(dbtorms_tilde_class
);
71 outlet_new(&x
->x_obj
, gensym("signal"));
76 static t_int
*dbtorms_tilde_perform(t_int
*w
)
78 float *in
= *(t_float
**)(w
+1), *out
= *(t_float
**)(w
+2);
79 t_int n
= *(t_int
*)(w
+3);
80 for (; n
--; in
++, out
++)
88 *out
= exp((LOGTEN
* 0.05) * (f
-100.));
94 static void dbtorms_tilde_dsp(t_dbtorms_tilde
*x
, t_signal
**sp
)
96 post("warning: %s not usable yet",__FUNCTION__
);
97 dsp_add(dbtorms_tilde_perform
, 3, sp
[0]->s_vec
, sp
[1]->s_vec
, sp
[0]->s_n
);
100 void dbtorms_tilde_setup(void)
102 dbtorms_tilde_class
= class_new(gensym("dbtorms~"), (t_newmethod
)dbtorms_tilde_new
, 0,
103 sizeof(t_dbtorms_tilde
), 0, 0);
104 CLASS_MAINSIGNALIN(dbtorms_tilde_class
, t_dbtorms_tilde
, x_f
);
105 class_addmethod(dbtorms_tilde_class
, (t_method
)dbtorms_tilde_dsp
, gensym("dsp"), 0);