From b2f2fd990f9059db784a7849726c6fc5006c70f9 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Mon, 27 Dec 2004 14:44:11 +0000 Subject: a lot of new objects ... svn path=/trunk/externals/tb/; revision=2431 --- chaos/src/chaos_dsp.hpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'chaos/src/chaos_dsp.hpp') 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::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 void chaos_dsp::m_signal_l(int n, t_sample *const *insigs, t_sample *const *outsigs) @@ -225,7 +235,6 @@ void chaos_dsp::m_signal_l(int n, t_sample *const *insigs, } -/* linear interpolation adapted from Numerical Recipes In C */ template void chaos_dsp::m_signal_c(int n, t_sample *const *insigs, t_sample *const *outsigs) @@ -250,7 +259,7 @@ void chaos_dsp::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] - -- cgit v1.2.1