summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/intern/mtof~.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2009-05-24 21:28:16 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2009-05-24 21:28:16 +0000
commit526b5580dabbfed7cfe5439dc3a90ec727f563c2 (patch)
tree22b1af92348785daad16714ee5e2b633017e0e48 /apps/plugins/pdbox/PDa/intern/mtof~.c
parent4f2dfcc01b260d946044ef2b6af5fe36cb772c8d (diff)
downloadrockbox-526b5580dabbfed7cfe5439dc3a90ec727f563c2.tar.gz
rockbox-526b5580dabbfed7cfe5439dc3a90ec727f563c2.zip
Cut the files in half and it might work better (note to self: check your tree is really clean before patching)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21070 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/mtof~.c')
-rw-r--r--apps/plugins/pdbox/PDa/intern/mtof~.c48
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
53typedef struct mtof_tilde
54{
55 t_object x_obj;
56 float x_f;
57} t_mtof_tilde;
58
59t_class *mtof_tilde_class;
60
61static 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
69static 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
86static 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
92void 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}