summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/intern/dbtopow~.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/dbtopow~.c')
-rw-r--r--apps/plugins/pdbox/PDa/intern/dbtopow~.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/dbtopow~.c b/apps/plugins/pdbox/PDa/intern/dbtopow~.c
index 92ba76d550..ad4a826f9e 100644
--- a/apps/plugins/pdbox/PDa/intern/dbtopow~.c
+++ b/apps/plugins/pdbox/PDa/intern/dbtopow~.c
@@ -50,55 +50,4 @@ void dbtopow_tilde_setup(void)
50 CLASS_MAINSIGNALIN(dbtopow_tilde_class, t_dbtopow_tilde, x_f); 50 CLASS_MAINSIGNALIN(dbtopow_tilde_class, t_dbtopow_tilde, x_f);
51 class_addmethod(dbtopow_tilde_class, (t_method)dbtopow_tilde_dsp, gensym("dsp"), 0); 51 class_addmethod(dbtopow_tilde_class, (t_method)dbtopow_tilde_dsp, gensym("dsp"), 0);
52} 52}
53#include <m_pd.h>
54#include <m_fixed.h>
55
56#define LOGTEN 2.302585092994
57
58typedef struct dbtopow_tilde
59{
60 t_object x_obj;
61 float x_f;
62} t_dbtopow_tilde;
63
64t_class *dbtopow_tilde_class;
65
66static void *dbtopow_tilde_new(void)
67{
68 t_dbtopow_tilde *x = (t_dbtopow_tilde *)pd_new(dbtopow_tilde_class);
69 outlet_new(&x->x_obj, gensym("signal"));
70 x->x_f = 0;
71 return (x);
72}
73 53
74static t_int *dbtopow_tilde_perform(t_int *w)
75{
76 float *in = *(t_float **)(w+1), *out = *(t_float **)(w+2);
77 t_int n = *(t_int *)(w+3);
78 for (; n--; in++, out++)
79 {
80 float f = *in;
81 if (f <= 0) *out = 0;
82 else
83 {
84 if (f > 870)
85 f = 870;
86 *out = exp((LOGTEN * 0.1) * (f-100.));
87 }
88 }
89 return (w + 4);
90}
91
92static void dbtopow_tilde_dsp(t_dbtopow_tilde *x, t_signal **sp)
93{
94 post("warning: %s not usable yet",__FUNCTION__);
95 dsp_add(dbtopow_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
96}
97
98void dbtopow_tilde_setup(void)
99{
100 dbtopow_tilde_class = class_new(gensym("dbtopow~"), (t_newmethod)dbtopow_tilde_new, 0,
101 sizeof(t_dbtopow_tilde), 0, 0);
102 CLASS_MAINSIGNALIN(dbtopow_tilde_class, t_dbtopow_tilde, x_f);
103 class_addmethod(dbtopow_tilde_class, (t_method)dbtopow_tilde_dsp, gensym("dsp"), 0);
104}