diff options
author | Tim Blechmann <timblech@users.sourceforge.net> | 2004-12-27 14:44:11 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:11:58 +0200 |
commit | b2f2fd990f9059db784a7849726c6fc5006c70f9 (patch) | |
tree | c867375b241055491d7665624aa24aa84c00c9b1 /chaos/src/chaos_dsp.hpp | |
parent | eced45909ba691a454fec179360ec1c2663f773a (diff) |
a lot of new objects ...
svn path=/trunk/externals/tb/; revision=2431
Diffstat (limited to 'chaos/src/chaos_dsp.hpp')
-rw-r--r-- | chaos/src/chaos_dsp.hpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/chaos/src/chaos_dsp.hpp b/chaos/src/chaos_dsp.hpp index f03f7c9..1eff6fc 100644 --- a/chaos/src/chaos_dsp.hpp +++ b/chaos/src/chaos_dsp.hpp @@ -75,15 +75,25 @@ SYSTEM##_dsp(int argc, t_atom* argv ) \ \ int size = m_system->get_num_eq(); \ \ - for (int i = 0; i != size; ++i) \ - AddOutSignal(); \ - \ m_values = new t_float[size]; \ m_slopes = new t_float[size]; \ m_nextvalues = new t_float[size]; \ m_nextmidpts = new t_float[size]; \ m_curves = new t_float[size]; \ \ + /* create inlets and zero arrays*/ \ + for (int i = 0; i != size; ++i) \ + { \ + AddOutSignal(); \ + m_values[i] = 0; \ + m_slopes[i] = 0; \ + m_nextvalues[i] = 0; \ + m_nextmidpts[i] = 0; \ + m_curves[i] = 0; \ + } \ + \ + \ + \ m_freq = GetAFloat(argv[0]); \ m_method = (char)GetAFloat(argv[1]); \ m_phase = 0; \ @@ -185,7 +195,7 @@ void chaos_dsp<system>::m_signal_n(int n, t_sample *const *insigs, } -/* linear interpolation adapted from supercollider by James McCartney */ +/* linear and cubic interpolation adapted from supercollider by James McCartney */ template <class system> void chaos_dsp<system>::m_signal_l(int n, t_sample *const *insigs, t_sample *const *outsigs) @@ -225,7 +235,6 @@ void chaos_dsp<system>::m_signal_l(int n, t_sample *const *insigs, } -/* linear interpolation adapted from Numerical Recipes In C */ template <class system> void chaos_dsp<system>::m_signal_c(int n, t_sample *const *insigs, t_sample *const *outsigs) @@ -250,7 +259,7 @@ void chaos_dsp<system>::m_signal_c(int n, t_sample *const *insigs, m_nextvalues[j]= m_system->get_data(j); m_values[j] = m_nextmidpts[j]; - m_nextmidpts[j] = (m_values[j] + value) * 0.5f; + m_nextmidpts[j] = (m_nextvalues[j] + value) * 0.5f; float fseglen = (float)phase; m_curves[j] = 2.f * (m_nextmidpts[j] - m_values[j] - |