diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/dbtorms~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/dbtorms~.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/dbtorms~.c b/apps/plugins/pdbox/PDa/intern/dbtorms~.c index 9d45a076eb..703d0883b9 100644 --- a/apps/plugins/pdbox/PDa/intern/dbtorms~.c +++ b/apps/plugins/pdbox/PDa/intern/dbtorms~.c | |||
@@ -51,56 +51,4 @@ void dbtorms_tilde_setup(void) | |||
51 | CLASS_MAINSIGNALIN(dbtorms_tilde_class, t_dbtorms_tilde, x_f); | 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); | 52 | class_addmethod(dbtorms_tilde_class, (t_method)dbtorms_tilde_dsp, gensym("dsp"), 0); |
53 | } | 53 | } |
54 | #include <m_pd.h> | ||
55 | #include <m_fixed.h> | ||
56 | |||
57 | |||
58 | #define LOGTEN 2.302585092994 | ||
59 | |||
60 | typedef struct dbtorms_tilde | ||
61 | { | ||
62 | t_object x_obj; | ||
63 | float x_f; | ||
64 | } t_dbtorms_tilde; | ||
65 | |||
66 | t_class *dbtorms_tilde_class; | ||
67 | |||
68 | static void *dbtorms_tilde_new(void) | ||
69 | { | ||
70 | t_dbtorms_tilde *x = (t_dbtorms_tilde *)pd_new(dbtorms_tilde_class); | ||
71 | outlet_new(&x->x_obj, gensym("signal")); | ||
72 | x->x_f = 0; | ||
73 | return (x); | ||
74 | } | ||
75 | |||
76 | static t_int *dbtorms_tilde_perform(t_int *w) | ||
77 | { | ||
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++) | ||
81 | { | ||
82 | float f = *in; | ||
83 | if (f <= 0) *out = 0; | ||
84 | else | ||
85 | { | ||
86 | if (f > 485) | ||
87 | f = 485; | ||
88 | *out = exp((LOGTEN * 0.05) * (f-100.)); | ||
89 | } | ||
90 | } | ||
91 | return (w + 4); | ||
92 | } | ||
93 | 54 | ||
94 | static void dbtorms_tilde_dsp(t_dbtorms_tilde *x, t_signal **sp) | ||
95 | { | ||
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); | ||
98 | } | ||
99 | |||
100 | void dbtorms_tilde_setup(void) | ||
101 | { | ||
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); | ||
106 | } | ||