summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/intern/ftom~.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/ftom~.c')
-rw-r--r--apps/plugins/pdbox/PDa/intern/ftom~.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/ftom~.c b/apps/plugins/pdbox/PDa/intern/ftom~.c
index 253fd7bf73..fb40ff6e7c 100644
--- a/apps/plugins/pdbox/PDa/intern/ftom~.c
+++ b/apps/plugins/pdbox/PDa/intern/ftom~.c
@@ -42,47 +42,4 @@ void ftom_tilde_setup(void)
42 CLASS_MAINSIGNALIN(ftom_tilde_class, t_ftom_tilde, x_f); 42 CLASS_MAINSIGNALIN(ftom_tilde_class, t_ftom_tilde, x_f);
43 class_addmethod(ftom_tilde_class, (t_method)ftom_tilde_dsp, gensym("dsp"), 0); 43 class_addmethod(ftom_tilde_class, (t_method)ftom_tilde_dsp, gensym("dsp"), 0);
44} 44}
45#include <m_pd.h>
46#include <m_fixed.h>
47
48typedef struct ftom_tilde
49{
50 t_object x_obj;
51 float x_f;
52} t_ftom_tilde;
53
54t_class *ftom_tilde_class;
55
56static void *ftom_tilde_new(void)
57{
58 t_ftom_tilde *x = (t_ftom_tilde *)pd_new(ftom_tilde_class);
59 outlet_new(&x->x_obj, gensym("signal"));
60 x->x_f = 0;
61 return (x);
62}
63 45
64static t_int *ftom_tilde_perform(t_int *w)
65{
66 t_sample *in = *(t_sample **)(w+1), *out = *(t_float **)(w+2);
67 t_int n = *(t_int *)(w+3);
68 for (; n--; *in++, out++)
69 {
70 t_sample f = *in;
71 *out = ftofix((fixtof(f) > 0 ? 17.3123405046 * log(.12231220585 * fixtof(f)) : -1500));
72 }
73 return (w + 4);
74}
75
76static void ftom_tilde_dsp(t_ftom_tilde *x, t_signal **sp)
77{
78 post("warning: %s not usable yet",__FUNCTION__);
79 dsp_add(ftom_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
80}
81
82void ftom_tilde_setup(void)
83{
84 ftom_tilde_class = class_new(gensym("ftom~"), (t_newmethod)ftom_tilde_new, 0,
85 sizeof(t_ftom_tilde), 0, 0);
86 CLASS_MAINSIGNALIN(ftom_tilde_class, t_ftom_tilde, x_f);
87 class_addmethod(ftom_tilde_class, (t_method)ftom_tilde_dsp, gensym("dsp"), 0);
88}