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/noise~.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/noise~.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/intern/noise~.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/noise~.c b/apps/plugins/pdbox/PDa/intern/noise~.c index 2f61b9d395..1b10ae91be 100644 --- a/apps/plugins/pdbox/PDa/intern/noise~.c +++ b/apps/plugins/pdbox/PDa/intern/noise~.c | |||
@@ -52,59 +52,3 @@ void noise_tilde_setup(void) | |||
52 | class_addmethod(noise_class, (t_method)noise_dsp, gensym("dsp"), 0); | 52 | class_addmethod(noise_class, (t_method)noise_dsp, gensym("dsp"), 0); |
53 | } | 53 | } |
54 | 54 | ||
55 | |||
56 | #include <m_pd.h> | ||
57 | #include <m_fixed.h> | ||
58 | |||
59 | |||
60 | static t_class *noise_class; | ||
61 | |||
62 | typedef struct _noise | ||
63 | { | ||
64 | t_object x_obj; | ||
65 | int x_val; | ||
66 | } t_noise; | ||
67 | |||
68 | static void *noise_new(void) | ||
69 | { | ||
70 | t_noise *x = (t_noise *)pd_new(noise_class); | ||
71 | static int init = 307; | ||
72 | x->x_val = (init *= 1319); | ||
73 | outlet_new(&x->x_obj, gensym("signal")); | ||
74 | return (x); | ||
75 | } | ||
76 | |||
77 | static t_int *noise_perform(t_int *w) | ||
78 | { | ||
79 | t_sample *out = (t_sample *)(w[1]); | ||
80 | int *vp = (int *)(w[2]); | ||
81 | int n = (int)(w[3]); | ||
82 | int val = *vp; | ||
83 | while (n--) | ||
84 | { | ||
85 | #ifndef FIXEDPOINT | ||
86 | *out++ = ((t_sample)((val & 0x7fffffff) - 0x40000000)) * | ||
87 | (t_sample)(1.0 / 0x40000000); | ||
88 | #else | ||
89 | *out++=val>>(32-fix1); | ||
90 | #endif | ||
91 | val = val * 435898247 + 382842987; | ||
92 | |||
93 | } | ||
94 | *vp = val; | ||
95 | return (w+4); | ||
96 | } | ||
97 | |||
98 | static void noise_dsp(t_noise *x, t_signal **sp) | ||
99 | { | ||
100 | dsp_add(noise_perform, 3, sp[0]->s_vec, &x->x_val, sp[0]->s_n); | ||
101 | } | ||
102 | |||
103 | void noise_tilde_setup(void) | ||
104 | { | ||
105 | noise_class = class_new(gensym("noise~"), (t_newmethod)noise_new, 0, | ||
106 | sizeof(t_noise), 0, 0); | ||
107 | class_addmethod(noise_class, (t_method)noise_dsp, gensym("dsp"), 0); | ||
108 | } | ||
109 | |||
110 | |||