diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2009-05-24 21:28:16 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2009-05-24 21:28:16 +0000 |
commit | 526b5580dabbfed7cfe5439dc3a90ec727f563c2 (patch) | |
tree | 22b1af92348785daad16714ee5e2b633017e0e48 /apps/plugins/pdbox/PDa/intern/powtodb~.c | |
parent | 4f2dfcc01b260d946044ef2b6af5fe36cb772c8d (diff) | |
download | rockbox-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/powtodb~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/powtodb~.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/powtodb~.c b/apps/plugins/pdbox/PDa/intern/powtodb~.c index 65cf6c0c36..5fead1511c 100644 --- a/apps/plugins/pdbox/PDa/intern/powtodb~.c +++ b/apps/plugins/pdbox/PDa/intern/powtodb~.c | |||
@@ -51,56 +51,3 @@ void powtodb_tilde_setup(void) | |||
51 | class_addmethod(powtodb_tilde_class, (t_method)powtodb_tilde_dsp, gensym("dsp"), 0); | 51 | class_addmethod(powtodb_tilde_class, (t_method)powtodb_tilde_dsp, gensym("dsp"), 0); |
52 | } | 52 | } |
53 | 53 | ||
54 | #include <m_pd.h> | ||
55 | #include <m_fixed.h> | ||
56 | |||
57 | #define LOGTEN 2.302585092994 | ||
58 | |||
59 | |||
60 | typedef struct powtodb_tilde | ||
61 | { | ||
62 | t_object x_obj; | ||
63 | float x_f; | ||
64 | } t_powtodb_tilde; | ||
65 | |||
66 | t_class *powtodb_tilde_class; | ||
67 | |||
68 | static void *powtodb_tilde_new(void) | ||
69 | { | ||
70 | t_powtodb_tilde *x = (t_powtodb_tilde *)pd_new(powtodb_tilde_class); | ||
71 | outlet_new(&x->x_obj, gensym("signal")); | ||
72 | x->x_f = 0; | ||
73 | return (x); | ||
74 | } | ||
75 | |||
76 | static t_int *powtodb_tilde_perform(t_int *w) | ||
77 | { | ||
78 | t_sample *in = *(t_sample **)(w+1), *out = *(t_sample **)(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 | float g = 100 + 10./LOGTEN * log(f); | ||
87 | *out = (g < 0 ? 0 : g); | ||
88 | } | ||
89 | } | ||
90 | return (w + 4); | ||
91 | } | ||
92 | |||
93 | static void powtodb_tilde_dsp(t_powtodb_tilde *x, t_signal **sp) | ||
94 | { | ||
95 | post("warning: %s not usable yet",__FUNCTION__); | ||
96 | dsp_add(powtodb_tilde_perform, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); | ||
97 | } | ||
98 | |||
99 | void powtodb_tilde_setup(void) | ||
100 | { | ||
101 | powtodb_tilde_class = class_new(gensym("powtodb~"), (t_newmethod)powtodb_tilde_new, 0, | ||
102 | sizeof(t_powtodb_tilde), 0, 0); | ||
103 | CLASS_MAINSIGNALIN(powtodb_tilde_class, t_powtodb_tilde, x_f); | ||
104 | class_addmethod(powtodb_tilde_class, (t_method)powtodb_tilde_dsp, gensym("dsp"), 0); | ||
105 | } | ||
106 | |||