diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/mtof~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/mtof~.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/mtof~.c b/apps/plugins/pdbox/PDa/intern/mtof~.c index 1db7dc52a7..cf0fd66da6 100644 --- a/apps/plugins/pdbox/PDa/intern/mtof~.c +++ b/apps/plugins/pdbox/PDa/intern/mtof~.c | |||
@@ -47,52 +47,4 @@ void mtof_tilde_setup(void) | |||
47 | CLASS_MAINSIGNALIN(mtof_tilde_class, t_mtof_tilde, x_f); | 47 | CLASS_MAINSIGNALIN(mtof_tilde_class, t_mtof_tilde, x_f); |
48 | class_addmethod(mtof_tilde_class, (t_method)mtof_tilde_dsp, gensym("dsp"), 0); | 48 | class_addmethod(mtof_tilde_class, (t_method)mtof_tilde_dsp, gensym("dsp"), 0); |
49 | } | 49 | } |
50 | #include <m_pd.h> | ||
51 | #include <m_fixed.h> | ||
52 | |||
53 | typedef struct mtof_tilde | ||
54 | { | ||
55 | t_object x_obj; | ||
56 | float x_f; | ||
57 | } t_mtof_tilde; | ||
58 | |||
59 | t_class *mtof_tilde_class; | ||
60 | |||
61 | static void *mtof_tilde_new(void) | ||
62 | { | ||
63 | t_mtof_tilde *x = (t_mtof_tilde *)pd_new(mtof_tilde_class); | ||
64 | outlet_new(&x->x_obj, gensym("signal")); | ||
65 | x->x_f = 0; | ||
66 | return (x); | ||
67 | } | ||
68 | |||
69 | static t_int *mtof_tilde_perform(t_int *w) | ||
70 | { | ||
71 | t_sample *in = *(t_sample **)(w+1), *out = *(t_sample **)(w+2); | ||
72 | t_int n = *(t_int *)(w+3); | ||
73 | for (; n--; in++, out++) | ||
74 | { | ||
75 | t_sample f = *in; | ||
76 | if (f <= ftofix(-1500.)) *out = 0; | ||
77 | else | ||
78 | { | ||
79 | if (f > ftofix(1499.)) f = ftofix(1499.); | ||
80 | *out = ftofix(8.17579891564 * exp(.0577622650 * fixtof(f))); | ||
81 | } | ||
82 | } | ||
83 | return (w + 4); | ||
84 | } | ||
85 | |||
86 | static void mtof_tilde_dsp(t_mtof_tilde *x, t_signal **sp) | ||
87 | { | ||
88 | post("warning: %s not usable yet",__FUNCTION__); | ||
89 | dsp_add(mtof_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | ||
90 | } | ||
91 | 50 | ||
92 | void mtof_tilde_setup(void) | ||
93 | { | ||
94 | mtof_tilde_class = class_new(gensym("mtof~"), (t_newmethod)mtof_tilde_new, 0, | ||
95 | sizeof(t_mtof_tilde), 0, 0); | ||
96 | CLASS_MAINSIGNALIN(mtof_tilde_class, t_mtof_tilde, x_f); | ||
97 | class_addmethod(mtof_tilde_class, (t_method)mtof_tilde_dsp, gensym("dsp"), 0); | ||
98 | } | ||