Revision: 10706 http://pure-data.svn.sourceforge.net/pure-data/?rev=10706&view=rev Author: tmusil Date: 2009-02-01 05:25:21 +0000 (Sun, 01 Feb 2009)
Log Message: ----------- changed for 64 bit array access
Modified Paths: -------------- trunk/externals/iem/iem_tab/src/iem_tab.c trunk/externals/iem/iem_tab/src/iem_tab.h trunk/externals/iem/iem_tab/src/iemlib.h trunk/externals/iem/iem_tab/src/makefile_d_fat trunk/externals/iem/iem_tab/src/makefile_d_ppc trunk/externals/iem/iem_tab/src/makefile_darwin trunk/externals/iem/iem_tab/src/makefile_linux trunk/externals/iem/iem_tab/src/makefile_win trunk/externals/iem/iem_tab/src/tab_abs.c trunk/externals/iem/iem_tab/src/tab_add.c trunk/externals/iem/iem_tab/src/tab_add_scalar.c trunk/externals/iem/iem_tab/src/tab_carth2polar.c trunk/externals/iem/iem_tab/src/tab_complex_inv.c trunk/externals/iem/iem_tab/src/tab_complex_mul.c trunk/externals/iem/iem_tab/src/tab_const.c trunk/externals/iem/iem_tab/src/tab_conv.c trunk/externals/iem/iem_tab/src/tab_copy.c trunk/externals/iem/iem_tab/src/tab_counter.c trunk/externals/iem/iem_tab/src/tab_cross_corr.c trunk/externals/iem/iem_tab/src/tab_div.c trunk/externals/iem/iem_tab/src/tab_eq.c trunk/externals/iem/iem_tab/src/tab_eq_scalar.c trunk/externals/iem/iem_tab/src/tab_fft.c trunk/externals/iem/iem_tab/src/tab_find_exact_peaks.c trunk/externals/iem/iem_tab/src/tab_find_peaks.c trunk/externals/iem/iem_tab/src/tab_ge.c trunk/externals/iem/iem_tab/src/tab_ge_scalar.c trunk/externals/iem/iem_tab/src/tab_gt.c trunk/externals/iem/iem_tab/src/tab_gt_scalar.c trunk/externals/iem/iem_tab/src/tab_ifft.c trunk/externals/iem/iem_tab/src/tab_le.c trunk/externals/iem/iem_tab/src/tab_le_scalar.c trunk/externals/iem/iem_tab/src/tab_lt.c trunk/externals/iem/iem_tab/src/tab_lt_scalar.c trunk/externals/iem/iem_tab/src/tab_max_index.c trunk/externals/iem/iem_tab/src/tab_min_index.c trunk/externals/iem/iem_tab/src/tab_min_max.c trunk/externals/iem/iem_tab/src/tab_mls.c trunk/externals/iem/iem_tab/src/tab_mul.c trunk/externals/iem/iem_tab/src/tab_mul_scalar.c trunk/externals/iem/iem_tab/src/tab_ne.c trunk/externals/iem/iem_tab/src/tab_ne_scalar.c trunk/externals/iem/iem_tab/src/tab_reverse.c trunk/externals/iem/iem_tab/src/tab_rfft.c trunk/externals/iem/iem_tab/src/tab_rifft.c trunk/externals/iem/iem_tab/src/tab_sqrt.c trunk/externals/iem/iem_tab/src/tab_sub.c trunk/externals/iem/iem_tab/src/tab_sum.c trunk/externals/iem/iem_tab/tab_abs-help.pd trunk/externals/iem/iem_tab/tab_add-help.pd trunk/externals/iem/iem_tab/tab_add_scalar-help.pd trunk/externals/iem/iem_tab/tab_carth2polar-help.pd trunk/externals/iem/iem_tab/tab_complex_inv-help.pd trunk/externals/iem/iem_tab/tab_complex_mul-help.pd trunk/externals/iem/iem_tab/tab_const-help.pd trunk/externals/iem/iem_tab/tab_conv-help.pd trunk/externals/iem/iem_tab/tab_copy-help.pd trunk/externals/iem/iem_tab/tab_counter-help.pd trunk/externals/iem/iem_tab/tab_cross_corr-help.pd trunk/externals/iem/iem_tab/tab_div-help.pd trunk/externals/iem/iem_tab/tab_eq-help.pd trunk/externals/iem/iem_tab/tab_eq_scalar-help.pd trunk/externals/iem/iem_tab/tab_fft-help.pd trunk/externals/iem/iem_tab/tab_find_exact_peaks-help.pd trunk/externals/iem/iem_tab/tab_find_peaks-help.pd trunk/externals/iem/iem_tab/tab_ifft-help.pd trunk/externals/iem/iem_tab/tab_rfft-help.pd trunk/externals/iem/iem_tab/tab_rifft-help.pd trunk/externals/iem/iem_tab/tab_sum-help.pd
Modified: trunk/externals/iem/iem_tab/src/iem_tab.c =================================================================== --- trunk/externals/iem/iem_tab/src/iem_tab.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/iem_tab.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,12 +1,12 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h"
-int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, t_float **beg_mem, int *array_size, int max_index) +int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, iemarray_t **beg_mem, int *array_size, int max_index) { int ok=1; t_garray *a; @@ -16,7 +16,7 @@ error("%s: no such array", array_name->s_name); ok = 0; } - else if(!garray_getfloatarray(a, array_size, beg_mem)) + else if(!iemarray_getarray(a, array_size, beg_mem)) { error("%s: bad template for %s", array_name->s_name, obj_name->s_name); ok = 0; @@ -64,6 +64,7 @@ void tab_find_peaks_setup(void); void tab_ge_setup(void); void tab_ge_scalar_setup(void); +void tab_get_size_setup(void); void tab_gt_setup(void); void tab_gt_scalar_setup(void); void tab_ifft_setup(void); @@ -114,6 +115,7 @@ tab_ge_scalar_setup(); tab_gt_setup(); tab_gt_scalar_setup(); + tab_get_size_setup(); tab_ifft_setup(); tab_le_setup(); tab_le_scalar_setup(); @@ -134,7 +136,7 @@ tab_sub_setup(); tab_sum_setup();
- post("iem_tab (R-1.17) library loaded! (c) Thomas Musil 11.2006"); + post("iem_tab (R-1.18) library loaded! (c) Thomas Musil 01.2009"); post(" musil%ciem.at iem KUG Graz Austria", '@'); }
Modified: trunk/externals/iem/iem_tab/src/iem_tab.h =================================================================== --- trunk/externals/iem/iem_tab/src/iem_tab.h 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/iem_tab.h 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#ifndef __IEMTAB_H__ #define __IEMTAB_H__ @@ -13,6 +13,6 @@ } TAB_COMPLEX;
-int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, t_float **beg_mem, int *array_size, int max_index); +int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, iemarray_t **beg_mem, int *array_size, int max_index);
#endif
Modified: trunk/externals/iem/iem_tab/src/iemlib.h =================================================================== --- trunk/externals/iem/iem_tab/src/iemlib.h 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/iemlib.h 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2007 */ +iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#ifndef __IEMLIB_H__ #define __IEMLIB_H__ @@ -99,4 +99,18 @@
#endif
+/* on 64bit systems we cannot use garray_getfloatarray... */ +#if (defined __x86_64__) +# define iemarray_t t_word +# define iemarray_getarray garray_getfloatwords +# define iemarray_getfloat(pointer, index) (pointer[index].w_float) +# define iemarray_setfloat(pointer, index, fvalue) (pointer[index].w_float = fvalue) +#else +# define iemarray_t t_float +# define iemarray_getarray garray_getfloatarray +# define iemarray_getfloat(pointer, index) (pointer[index]) +# define iemarray_setfloat(pointer, index, fvalue) (pointer[index] = fvalue) #endif + + +#endif
Modified: trunk/externals/iem/iem_tab/src/makefile_d_fat =================================================================== --- trunk/externals/iem/iem_tab/src/makefile_d_fat 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/makefile_d_fat 2009-02-01 05:25:21 UTC (rev 10706) @@ -34,6 +34,7 @@ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ + tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \
Modified: trunk/externals/iem/iem_tab/src/makefile_d_ppc =================================================================== --- trunk/externals/iem/iem_tab/src/makefile_d_ppc 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/makefile_d_ppc 2009-02-01 05:25:21 UTC (rev 10706) @@ -34,6 +34,7 @@ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ + tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \
Modified: trunk/externals/iem/iem_tab/src/makefile_darwin =================================================================== --- trunk/externals/iem/iem_tab/src/makefile_darwin 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/makefile_darwin 2009-02-01 05:25:21 UTC (rev 10706) @@ -39,6 +39,7 @@ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ + tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \
Modified: trunk/externals/iem/iem_tab/src/makefile_linux =================================================================== --- trunk/externals/iem/iem_tab/src/makefile_linux 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/makefile_linux 2009-02-01 05:25:21 UTC (rev 10706) @@ -38,6 +38,7 @@ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ + tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \
Modified: trunk/externals/iem/iem_tab/src/makefile_win =================================================================== --- trunk/externals/iem/iem_tab/src/makefile_win 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/makefile_win 2009-02-01 05:25:21 UTC (rev 10706) @@ -41,6 +41,7 @@ tab_ge_scalar.c \ tab_gt.c \ tab_gt_scalar.c \ + tab_get_size.c \ tab_ifft.c \ tab_le.c \ tab_le_scalar.c \
Modified: trunk/externals/iem/iem_tab/src/tab_abs.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_abs.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_abs.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" @@ -11,6 +11,7 @@
/* -------------------------- tab_abs ------------------------------ */ +/* x_beg_mem_dst[i] = abs(x_beg_mem_src1[i]) */
typedef struct _tab_abs { @@ -19,8 +20,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_abs; @@ -41,7 +42,7 @@ { int i, n; int ok_src, ok_dst; - t_float *vec_src, *vec_dst; + iemarray_t *vec_src, *vec_dst;
ok_src = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -59,7 +60,8 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = fabs(vec_src[i]); + iemarray_setfloat(vec_dst, i, fabs(iemarray_getfloat(vec_src, i))); + outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -72,7 +74,7 @@ int beg_src, beg_dst; int i, n; int ok_src, ok_dst; - t_float *vec_src, *vec_dst; + iemarray_t *vec_src, *vec_dst;
if((argc >= 3) && IS_A_FLOAT(argv,0) && @@ -101,7 +103,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = fabs(vec_src[i]); + iemarray_setfloat(vec_dst, i, fabs(iemarray_getfloat(vec_src, i))); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a);
Modified: trunk/externals/iem/iem_tab/src/tab_add.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_add.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_add.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,14 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_add ------------------------------ */ +/* x_beg_mem_dst[i] = x_beg_mem_src1[i] + x_beg_mem_src2[i] */
typedef struct _tab_add { @@ -18,9 +19,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -47,7 +48,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_add"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -70,7 +71,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = vec_src1[i] + vec_src2[i]; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) + iemarray_getfloat(vec_src2, i)); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -83,7 +84,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -118,7 +119,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = vec_src1[i] + vec_src2[i]; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) + iemarray_getfloat(vec_src2, i)); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -140,7 +141,6 @@ { t_tab_add *x = (t_tab_add *)pd_new(tab_add_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_add_scalar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_add_scalar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_add_scalar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,14 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_add_scalar ------------------------------ */ +/* x_beg_mem_dst[i] = x_beg_mem_src1[i] + add */
typedef struct _tab_add_scalar { @@ -16,8 +17,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_add_scalar; @@ -33,7 +34,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -52,7 +53,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = vec_src1[i] + add; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) + add); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -70,7 +71,7 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst, add; + iemarray_t *vec_src1, *vec_dst, add;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -101,7 +102,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = vec_src1[i] + add; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) + add); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a);
Modified: trunk/externals/iem/iem_tab/src/tab_carth2polar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_carth2polar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_carth2polar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -9,6 +9,8 @@ #include <math.h>
/* -------------------------- tab_carth2polar ------------------------------ */ +/* x_beg_mem_dst_mag[i] = sqrt(x_beg_mem_src_re[i]*x_beg_mem_src_re[i] + x_beg_mem_src_im[i]*x_beg_mem_src_im[i]) */ +/* x_beg_mem_dst_arg[i] = atan2(x_beg_mem_src_im[i], x_beg_mem_src_re[i]) */
typedef struct _tab_carth2polar { @@ -21,10 +23,10 @@ int x_offset_dst_mag; int x_offset_src_im; int x_offset_dst_arg; - t_float *x_beg_mem_src_re; - t_float *x_beg_mem_dst_mag; - t_float *x_beg_mem_src_im; - t_float *x_beg_mem_dst_arg; + iemarray_t *x_beg_mem_src_re; + iemarray_t *x_beg_mem_dst_mag; + iemarray_t *x_beg_mem_src_im; + iemarray_t *x_beg_mem_dst_arg; t_symbol *x_sym_src_re; t_symbol *x_sym_dst_mag; t_symbol *x_sym_src_im; @@ -58,8 +60,8 @@ int i, n; int ok_src_re, ok_dst_mag; int ok_src_im, ok_dst_arg; - t_float *vec_src_re, *vec_dst_mag; - t_float *vec_src_im, *vec_dst_arg; + iemarray_t *vec_src_re, *vec_dst_mag; + iemarray_t *vec_src_im, *vec_dst_arg;
ok_src_re = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, 0); ok_dst_mag = iem_tab_check_arrays(gensym("tab_carth2polar"), x->x_sym_dst_mag, &x->x_beg_mem_dst_mag, &x->x_size_dst_mag, 0); @@ -90,12 +92,14 @@ { t_float re, im, mag, arg;
- re = vec_src_re[i]; - im = vec_src_im[i]; + re = iemarray_getfloat(vec_src_re, i); + im = iemarray_getfloat(vec_src_im, i); mag = sqrt(re*re + im*im); arg = atan2(im, re) * rcp_two_pi; vec_dst_mag[i] = mag; vec_dst_arg[i] = arg; + iemarray_setfloat(vec_dst_mag, i, mag); + iemarray_setfloat(vec_dst_arg, i, arg); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_mag, garray_class); @@ -113,8 +117,8 @@ int beg_src_im, beg_dst_arg; int ok_src_re, ok_dst_mag; int ok_src_im, ok_dst_arg; - t_float *vec_src_re, *vec_dst_mag; - t_float *vec_src_im, *vec_dst_arg; + iemarray_t *vec_src_re, *vec_dst_mag; + iemarray_t *vec_src_im, *vec_dst_arg;
if((argc >= 5) && IS_A_FLOAT(argv,0) && @@ -160,12 +164,12 @@ { t_float re, im, mag, arg;
- re = vec_src_re[i]; - im = vec_src_im[i]; + re = iemarray_getfloat(vec_src_re, i); + im = iemarray_getfloat(vec_src_im, i); mag = sqrt(re*re + im*im); arg = atan2(im, re) * rcp_two_pi; - vec_dst_mag[i] = mag; - vec_dst_arg[i] = arg; + iemarray_setfloat(vec_dst_mag, i, mag); + iemarray_setfloat(vec_dst_arg, i, arg); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_mag, garray_class); @@ -190,7 +194,6 @@ { t_tab_carth2polar *x = (t_tab_carth2polar *)pd_new(tab_carth2polar_class); t_symbol *src_re, *dst_mag, *src_im, *dst_arg; - t_float time;
if((argc >= 4) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_complex_inv.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_complex_inv.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_complex_inv.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,15 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_complex_inv ------------------------------ */ +/* x_beg_mem_dst_re[i] = x_beg_mem_src1_re[i] / (x_beg_mem_src1_re[i]*x_beg_mem_src1_re[i] + x_beg_mem_src1_im[i]*x_beg_mem_src1_im[i]) */ +/* x_beg_mem_dst_im[i] = -x_beg_mem_src1_im[i] / (x_beg_mem_src1_re[i]*x_beg_mem_src1_re[i] + x_beg_mem_src1_im[i]*x_beg_mem_src1_im[i]) */
typedef struct _tab_complex_inv { @@ -20,10 +22,10 @@ int x_offset_dst_re; int x_offset_src1_im; int x_offset_dst_im; - t_float *x_beg_mem_src1_re; - t_float *x_beg_mem_dst_re; - t_float *x_beg_mem_src1_im; - t_float *x_beg_mem_dst_im; + iemarray_t *x_beg_mem_src1_re; + iemarray_t *x_beg_mem_dst_re; + iemarray_t *x_beg_mem_src1_im; + iemarray_t *x_beg_mem_dst_im; t_symbol *x_sym_scr1_re; t_symbol *x_sym_dst_re; t_symbol *x_sym_scr1_im; @@ -57,8 +59,8 @@ int i, n; int ok_src1_re, ok_dst_re; int ok_src1_im, ok_dst_im; - t_float *vec_src1_re, *vec_dst_re; - t_float *vec_src1_im, *vec_dst_im; + iemarray_t *vec_src1_re, *vec_dst_re; + iemarray_t *vec_src1_im, *vec_dst_im;
ok_src1_re = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_scr1_re, &x->x_beg_mem_src1_re, &x->x_size_src1_re, 0); ok_dst_re = iem_tab_check_arrays(gensym("tab_complex_inv"), x->x_sym_dst_re, &x->x_beg_mem_dst_re, &x->x_size_dst_re, 0); @@ -88,11 +90,11 @@ { t_float re, im, abs;
- re = vec_src1_re[i]; - im = vec_src1_im[i]; + re = iemarray_getfloat(vec_src1_re, i); + im = iemarray_getfloat(vec_src1_im, i); abs = 1.0f / (re*re + im*im); - vec_dst_re[i] = re*abs; - vec_dst_im[i] = -im*abs; + iemarray_setfloat(vec_dst_re, i, re*abs); + iemarray_setfloat(vec_dst_im, i, -im*abs); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); @@ -110,8 +112,8 @@ int beg_src1_im, beg_dst_im; int ok_src1_re, ok_dst_re; int ok_src1_im, ok_dst_im; - t_float *vec_src1_re, *vec_dst_re; - t_float *vec_src1_im, *vec_dst_im; + iemarray_t *vec_src1_re, *vec_dst_re; + iemarray_t *vec_src1_im, *vec_dst_im;
if((argc >= 5) && IS_A_FLOAT(argv,0) && @@ -156,11 +158,11 @@ { t_float re, im, abs;
- re = vec_src1_re[i]; - im = vec_src1_im[i]; + re = iemarray_getfloat(vec_src1_re, i); + im = iemarray_getfloat(vec_src1_im, i); abs = 1.0f / (re*re + im*im); - vec_dst_re[i] = re*abs; - vec_dst_im[i] = -im*abs; + iemarray_setfloat(vec_dst_re, i, re*abs); + iemarray_setfloat(vec_dst_im, i, -im*abs); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); @@ -185,7 +187,6 @@ { t_tab_complex_inv *x = (t_tab_complex_inv *)pd_new(tab_complex_inv_class); t_symbol *src1_re, *src2_re, *dst_re, *src1_im, *src2_im, *dst_im; - t_float time;
if((argc >= 4) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_complex_mul.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_complex_mul.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_complex_mul.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,15 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_complex_mul ------------------------------ */ +/* x_beg_mem_dst_re[i] = x_beg_mem_src1_re[i]*x_beg_mem_src2_re[i] - x_beg_mem_src1_im[i]*x_beg_mem_src2_im[i] */ +/* x_beg_mem_dst_im[i] = x_beg_mem_src1_re[i]*x_beg_mem_src2_im[i] + x_beg_mem_src1_im[i]*x_beg_mem_src2_re[i] */
typedef struct _tab_complex_mul { @@ -24,12 +26,12 @@ int x_offset_src1_im; int x_offset_src2_im; int x_offset_dst_im; - t_float *x_beg_mem_src1_re; - t_float *x_beg_mem_src2_re; - t_float *x_beg_mem_dst_re; - t_float *x_beg_mem_src1_im; - t_float *x_beg_mem_src2_im; - t_float *x_beg_mem_dst_im; + iemarray_t *x_beg_mem_src1_re; + iemarray_t *x_beg_mem_src2_re; + iemarray_t *x_beg_mem_dst_re; + iemarray_t *x_beg_mem_src1_im; + iemarray_t *x_beg_mem_src2_im; + iemarray_t *x_beg_mem_dst_im; t_symbol *x_sym_scr1_re; t_symbol *x_sym_scr2_re; t_symbol *x_sym_dst_re; @@ -75,8 +77,8 @@ int i, n; int ok_src1_re, ok_src2_re, ok_dst_re; int ok_src1_im, ok_src2_im, ok_dst_im; - t_float *vec_src1_re, *vec_src2_re, *vec_dst_re; - t_float *vec_src1_im, *vec_src2_im, *vec_dst_im; + iemarray_t *vec_src1_re, *vec_src2_re, *vec_dst_re; + iemarray_t *vec_src1_im, *vec_src2_im, *vec_dst_im;
ok_src1_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr1_re, &x->x_beg_mem_src1_re, &x->x_size_src1_re, 0); ok_src2_re = iem_tab_check_arrays(gensym("tab_complex_mul"), x->x_sym_scr2_re, &x->x_beg_mem_src2_re, &x->x_size_src2_re, 0); @@ -114,12 +116,12 @@ { t_float re1, re2, im1, im2;
- re1 = vec_src1_re[i]; - re2 = vec_src2_re[i]; - im1 = vec_src1_im[i]; - im2 = vec_src2_im[i]; - vec_dst_re[i] = re1*re2 - im1*im2; - vec_dst_im[i] = re1*im2 + im1*re2; + re1 = iemarray_getfloat(vec_src1_re, i); + re2 = iemarray_getfloat(vec_src2_re, i); + im1 = iemarray_getfloat(vec_src1_im, i); + im2 = iemarray_getfloat(vec_src2_im, i); + iemarray_setfloat(vec_dst_re, i, re1*re2 - im1*im2); + iemarray_setfloat(vec_dst_im, i, re1*im2 + im1*re2); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); @@ -137,8 +139,8 @@ int beg_src1_im, beg_src2_im, beg_dst_im; int ok_src1_re, ok_src2_re, ok_dst_re; int ok_src1_im, ok_src2_im, ok_dst_im; - t_float *vec_src1_re, *vec_src2_re, *vec_dst_re; - t_float *vec_src1_im, *vec_src2_im, *vec_dst_im; + iemarray_t *vec_src1_re, *vec_src2_re, *vec_dst_re; + iemarray_t *vec_src1_im, *vec_src2_im, *vec_dst_im;
if((argc >= 7) && IS_A_FLOAT(argv,0) && @@ -195,12 +197,12 @@ { t_float re1, re2, im1, im2;
- re1 = vec_src1_re[i]; - re2 = vec_src2_re[i]; - im1 = vec_src1_im[i]; - im2 = vec_src2_im[i]; - vec_dst_re[i] = re1*re2 - im1*im2; - vec_dst_im[i] = re1*im2 + im1*re2; + re1 = iemarray_getfloat(vec_src1_re, i); + re2 = iemarray_getfloat(vec_src2_re, i); + im1 = iemarray_getfloat(vec_src1_im, i); + im2 = iemarray_getfloat(vec_src2_im, i); + iemarray_setfloat(vec_dst_re, i, re1*re2 - im1*im2); + iemarray_setfloat(vec_dst_im, i, re1*im2 + im1*re2); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst_re, garray_class); @@ -225,7 +227,6 @@ { t_tab_complex_mul *x = (t_tab_complex_mul *)pd_new(tab_complex_mul_class); t_symbol *src1_re, *src2_re, *dst_re, *src1_im, *src2_im, *dst_im; - t_float time;
if((argc >= 6) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_const.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_const.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_const.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,21 +1,22 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_const ------------------------------ */ +/* x_beg_mem_dst[i] = c */
typedef struct _tab_const { t_object x_obj; int x_size_dst; int x_offset_dst; - t_float x_const; - t_float *x_beg_mem_dst; + t_float x_const; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_dst; } t_tab_const;
@@ -30,7 +31,7 @@ { int i, n; int ok_dst; - t_float *vec_dst; + iemarray_t *vec_dst;
ok_dst = iem_tab_check_arrays(gensym("tab_const"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0);
@@ -43,7 +44,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -55,7 +56,7 @@ { int i, n; int ok_dst; - t_float *vec_dst; + iemarray_t *vec_dst;
ok_dst = iem_tab_check_arrays(gensym("tab_const"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0);
@@ -68,7 +69,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = c; + iemarray_setfloat(vec_dst, i, c); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -81,7 +82,8 @@ int beg_dst; int i, n; int ok_dst; - t_float *vec_dst, c; + iemarray_t *vec_dst; + t_float c;
if((argc >= 3) && IS_A_FLOAT(argv,0) && @@ -106,7 +108,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = c; + iemarray_setfloat(vec_dst, i, c); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -128,7 +130,6 @@ { t_tab_const *x = (t_tab_const *)pd_new(tab_const_class); t_symbol *dst; - t_float time;
if((argc >= 1) && IS_A_SYMBOL(argv,0))
Modified: trunk/externals/iem/iem_tab/src/tab_conv.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_conv.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_conv.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" @@ -9,7 +9,14 @@ #include "iem_tab.h"
-/* -------------------------- tab_conv ------------------------------ */ +/* ---------------------------- tab_conv ------------------------------- */ +/* for(i=0; i<x_size_src1; i++) */ +/* { */ +/* sum = 0.0f; */ +/* for(j=0; j<x_size_src2; j++) */ +/* sum += x_beg_mem_src1[i+j-x_size_src2/2] * x_beg_mem_src2[j]; */ +/* x_beg_mem_dst[i] = sum; */ +/* } */
typedef struct _tab_conv { @@ -20,9 +27,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -30,6 +37,10 @@
static t_class *tab_conv_class;
+static void tab_conv_tick(t_tab_conv *x) +{ +} + static void tab_conv_src1(t_tab_conv *x, t_symbol *s) { x->x_sym_scr1 = s; @@ -49,7 +60,7 @@ { int i, j, k, l, min_s2, plu_s2, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst; t_float sum=0.0f;
ok_src1 = iem_tab_check_arrays(gensym("tab_conv"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); @@ -80,9 +91,9 @@ { k = j + i; if((k >= 0) && (k < n)) - sum += vec_src1[k] * vec_src2[l]; + sum += iemarray_getfloat(vec_src1, k) * iemarray_getfloat(vec_src2, l); } - vec_dst[i] = sum; + iemarray_setfloat(vec_dst, i, sum); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -98,7 +109,7 @@ int n_src1, n_src2; int i, j, k, l, min_s2, plu_s2; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst; t_float sum=0.0f;
if((argc >= 5) && @@ -148,9 +159,9 @@ { k = j + i; if((k >= 0) && (k < n_src1)) - sum += vec_src1[k] * vec_src2[l]; + sum += iemarray_getfloat(vec_src1, k) * iemarray_getfloat(vec_src2, l); } - vec_dst[i] = sum; + iemarray_setfloat(vec_dst, i, sum); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -174,7 +185,6 @@ { t_tab_conv *x = (t_tab_conv *)pd_new(tab_conv_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_copy.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_copy.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_copy.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,8 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */ +/* x_beg_mem_dst[i] = x_beg_mem_src1[i] */
#include "m_pd.h" #include "iemlib.h" @@ -16,8 +17,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_copy; @@ -38,7 +39,7 @@ { int i, n; int ok_src, ok_dst; - t_float *vec_src, *vec_dst; + iemarray_t *vec_src, *vec_dst;
ok_src = iem_tab_check_arrays(gensym("tab_copy"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_copy"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -56,7 +57,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = vec_src[i]; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src, i)); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a); @@ -69,7 +70,7 @@ int beg_src, beg_dst; int i, n; int ok_src, ok_dst; - t_float *vec_src, *vec_dst; + iemarray_t *vec_src, *vec_dst;
if((argc >= 3) && IS_A_FLOAT(argv,0) && @@ -98,7 +99,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = vec_src[i]; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src, i)); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a);
Modified: trunk/externals/iem/iem_tab/src/tab_counter.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_counter.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_counter.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,20 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_counter ------------------------------ */ +/* for(i=0; i<x_size_src1; i++) */ +/* { */ +/* if(x_beg_mem_src1[i] == 0.0f) */ +/* x_beg_mem_dst[i] = 0.0f; */ +/* else */ +/* x_beg_mem_dst[i] += 1.0f; */ +/* } */
typedef struct _tab_counter { @@ -16,8 +23,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_counter; @@ -33,7 +40,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -53,10 +60,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] == 0.0f) - vec_dst[i] = 0.0f; + if(iemarray_getfloat(vec_src1, i) == 0.0f) + iemarray_setfloat(vec_dst, i, 0.0f); else - vec_dst[i] += 1.0f; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_dst, i)+1.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -75,7 +82,7 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
if((argc >= 3) && IS_A_FLOAT(argv,0) && @@ -105,10 +112,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] == 0.0f) - vec_dst[i] = 0.0f; + if(iemarray_getfloat(vec_src1, i) == 0.0f) + iemarray_setfloat(vec_dst, i, 0.0f); else - vec_dst[i] += 1.0f; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_dst, i)+1.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -128,7 +135,7 @@ int beg_dst; int i, n; int ok_dst; - t_float *vec_dst; + iemarray_t *vec_dst;
ok_dst = iem_tab_check_arrays(gensym("tab_counter"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0);
@@ -141,7 +148,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); garray_redraw(a);
Modified: trunk/externals/iem/iem_tab/src/tab_cross_corr.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_cross_corr.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_cross_corr.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -17,9 +17,9 @@ int x_size_src2; int x_size_dst; int x_n; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_float x_factor; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; @@ -36,7 +36,8 @@ x->x_counter++; if(x->x_counter < x->x_n) { - t_float *vec_src1, *vec_src2, *vec_dst, sum; + iemarray_t *vec_src1, *vec_src2, *vec_dst; + t_float sum; int j, m;
vec_src1 = x->x_beg_mem_src1 + x->x_counter; @@ -46,9 +47,9 @@ sum = 0.0f; for(j=0; j<m; j++) { - sum += vec_src1[j]*vec_src2[j]; + sum += iemarray_getfloat(vec_src1, j)*iemarray_getfloat(vec_src2, j); } - vec_dst[0] = sum*x->x_factor; + iemarray_setfloat(vec_dst, 0, sum*x->x_factor); clock_delay(x->x_clock, x->x_delay); } else @@ -62,12 +63,12 @@ } }
-static void tab_cross_corr_time(t_tab_cross_corr *x, t_floatarg time) +static void tab_cross_corr_time(t_tab_cross_corr *x, t_floatarg dtime) { - if(time < 0.0f) - time = 0.0f; + if(dtime < 0.0f) + dtime = 0.0f;
- x->x_delay = time; + x->x_delay = dtime; }
static void tab_cross_corr_factor(t_tab_cross_corr *x, t_floatarg factor) @@ -94,7 +95,7 @@ { int i, j, m, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst; t_float sum, f;
ok_src1 = iem_tab_check_arrays(gensym("tab_cross_corr"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); @@ -127,9 +128,9 @@ sum = 0.0f; for(j=0; j<m; j++) { - sum += vec_src1[i+j]*vec_src2[j]; + sum += iemarray_getfloat(vec_src1, i+j)*iemarray_getfloat(vec_src2, j); } - vec_dst[i] = sum*f; + iemarray_setfloat(vec_dst, i, sum*f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -145,10 +146,9 @@ sum = 0.0f; for(j=0; j<m; j++) { - sum += vec_src1[j]*vec_src2[j]; + sum += iemarray_getfloat(vec_src1, j)*iemarray_getfloat(vec_src2, j); } - vec_dst[0] = sum*f; - + iemarray_setfloat(vec_dst, 0, sum*f); clock_delay(x->x_clock, x->x_delay); } } @@ -164,20 +164,20 @@ { t_tab_cross_corr *x = (t_tab_cross_corr *)pd_new(tab_cross_corr_class); t_symbol *src1, *src2, *dst; - t_float time, factor; + t_float dtime=0.0f, factor=1.0f;
+ if((argc >= 5) && IS_A_FLOAT(argv,4)) + dtime = (t_float)atom_getfloatarg(4, argc, argv); + if((argc >= 4) && IS_A_FLOAT(argv,3)) + factor = (t_float)atom_getfloatarg(3, argc, argv); if((argc >= 3) && IS_A_SYMBOL(argv,0) && IS_A_SYMBOL(argv,1) && - IS_A_SYMBOL(argv,2) && - IS_A_FLOAT(argv,3) && - IS_A_FLOAT(argv,4)) + IS_A_SYMBOL(argv,2)) { src1 = (t_symbol *)atom_getsymbolarg(0, argc, argv); src2 = (t_symbol *)atom_getsymbolarg(1, argc, argv); dst = (t_symbol *)atom_getsymbolarg(2, argc, argv); - factor = (t_float)atom_getfloatarg(3, argc, argv); - time = (t_float)atom_getfloatarg(4, argc, argv); } else { @@ -186,10 +186,10 @@ return(0); }
- if(time < 0.0f) - time = 0.0f; + if(dtime < 0.0f) + dtime = 0.0f;
- x->x_delay = time; + x->x_delay = dtime; x->x_factor = factor; x->x_sym_scr1 = src1; x->x_sym_scr2 = src2;
Modified: trunk/externals/iem/iem_tab/src/tab_div.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_div.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_div.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,14 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_div ------------------------------ */ +/* x_beg_mem_dst[i] = x_beg_mem_src1[i]/x_offset_src2[i] */
typedef struct _tab_div { @@ -18,9 +19,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -47,7 +48,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_div"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -71,10 +72,10 @@
for(i=0; i<n; i++) { - if(vec_src2[i] == 0.0f) - vec_dst[i] = 0.0f; + if(iemarray_getfloat(vec_src2, i) == 0.0f) + iemarray_setfloat(vec_dst, i, 0.0f); else - vec_dst[i] = vec_src1[i] / vec_src2[i]; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) / iemarray_getfloat(vec_src2, i)); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -88,7 +89,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -124,10 +125,10 @@
for(i=0; i<n; i++) { - if(vec_src2[i] == 0.0f) - vec_dst[i] = 0.0f; + if(iemarray_getfloat(vec_src2, i) == 0.0f) + iemarray_setfloat(vec_dst, i, 0.0f); else - vec_dst[i] = vec_src1[i] / vec_src2[i]; + iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) / iemarray_getfloat(vec_src2, i)); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -150,7 +151,6 @@ { t_tab_div *x = (t_tab_div *)pd_new(tab_div_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_eq.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_eq.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_eq.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_eq ------------------------------ */ +/* if(x_beg_mem_src1[i] == x_beg_mem_src2[i]) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] = 0.0f; */
typedef struct _tab_eq { @@ -18,9 +22,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -47,7 +51,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_eq"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -71,10 +75,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] == vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) == iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -88,7 +92,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -124,10 +128,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] == vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) == iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -150,7 +154,6 @@ { t_tab_eq *x = (t_tab_eq *)pd_new(tab_eq_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_eq_scalar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_eq_scalar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_eq_scalar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_eq_scalar ------------------------------ */ +/* if(x_beg_mem_src1[i] == compare) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] += 0.0f; */
typedef struct _tab_eq_scalar { @@ -16,8 +20,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_eq_scalar; @@ -33,7 +37,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_eq_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_eq_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -53,10 +57,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] == compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) == compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -75,7 +79,8 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst, compare; + iemarray_t *vec_src1, *vec_dst; + t_float compare;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -107,10 +112,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] == compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) == compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
Modified: trunk/externals/iem/iem_tab/src/tab_fft.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_fft.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_fft.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -9,6 +9,7 @@ #include <math.h>
/* -------------------------- tab_fft ------------------------------ */ +/* complex FFT */
typedef struct _tab_fft { @@ -22,10 +23,10 @@ int x_offset_dst_re; int x_offset_dst_im; int x_fftsize; - t_float *x_beg_mem_src_re; - t_float *x_beg_mem_src_im; - t_float *x_beg_mem_dst_re; - t_float *x_beg_mem_dst_im; + iemarray_t *x_beg_mem_src_re; + iemarray_t *x_beg_mem_src_im; + iemarray_t *x_beg_mem_dst_re; + iemarray_t *x_beg_mem_dst_im; TAB_COMPLEX *x_sin_cos; t_symbol *x_sym_src_re; t_symbol *x_sym_src_im; @@ -100,7 +101,7 @@ int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; - t_float *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; + iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im;
ok_src_re = iem_tab_check_arrays(gensym("tab_fft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, fftsize); @@ -118,8 +119,8 @@
for(k=0; k<fftsize; k++) { - vec_dst_re[k] = vec_src_re[k]; - vec_dst_im[k] = vec_src_im[k]; + iemarray_setfloat(vec_dst_re, k, iemarray_getfloat(vec_src_re, k)); + iemarray_setfloat(vec_dst_im, k, iemarray_getfloat(vec_src_im, k)); }
i_inc = fs2; @@ -132,15 +133,16 @@ w_index = 0; for(k=0; k<i_inc; k++) { - old1_re = vec_dst_re[v_index]; - old1_im = vec_dst_im[v_index]; - old2_re = vec_dst_re[v_index+i_inc]; - old2_im = vec_dst_im[v_index+i_inc]; + old1_re = iemarray_getfloat(vec_dst_re, v_index); + old1_im = iemarray_getfloat(vec_dst_im, v_index); + old2_re = iemarray_getfloat(vec_dst_re, v_index+i_inc); + old2_im = iemarray_getfloat(vec_dst_im, v_index+i_inc); + w = sincos[w_index]; - vec_dst_re[v_index+i_inc] = (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag; - vec_dst_im[v_index+i_inc] = (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag; - vec_dst_re[v_index] = old1_re + old2_re; - vec_dst_im[v_index] = old1_im + old2_im; + iemarray_setfloat(vec_dst_re, v_index+i_inc, (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag); + iemarray_setfloat(vec_dst_im, v_index+i_inc, (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag); + iemarray_setfloat(vec_dst_re, v_index, old1_re + old2_re); + iemarray_setfloat(vec_dst_im, v_index, old1_im + old2_im); w_index += w_inc; v_index++; } @@ -162,12 +164,12 @@ j = j + k; if(i < j) { - old1_re = vec_dst_re[j]; - old1_im = vec_dst_im[j]; - vec_dst_re[j] = vec_dst_re[i]; - vec_dst_im[j] = vec_dst_im[i]; - vec_dst_re[i] = old1_re; - vec_dst_im[i] = old1_im; + old1_re = iemarray_getfloat(vec_dst_re, j); + old1_im = iemarray_getfloat(vec_dst_im, j); + iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); + iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); + iemarray_setfloat(vec_dst_re, i, old1_re); + iemarray_setfloat(vec_dst_im, i, old1_im); } }
@@ -204,7 +206,7 @@ int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; - t_float *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; + iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im;
if((argc >= 4) && @@ -242,8 +244,8 @@
for(k=0; k<fftsize; k++) { - vec_dst_re[k] = vec_src_re[k]; - vec_dst_im[k] = vec_src_im[k]; + iemarray_setfloat(vec_dst_re, k, iemarray_getfloat(vec_src_re, k)); + iemarray_setfloat(vec_dst_im, k, iemarray_getfloat(vec_src_im, k)); }
i_inc = fs2; @@ -256,15 +258,16 @@ w_index = 0; for(k=0; k<i_inc; k++) { - old1_re = vec_dst_re[v_index]; - old1_im = vec_dst_im[v_index]; - old2_re = vec_dst_re[v_index+i_inc]; - old2_im = vec_dst_im[v_index+i_inc]; + old1_re = iemarray_getfloat(vec_dst_re, v_index); + old1_im = iemarray_getfloat(vec_dst_im, v_index); + old2_re = iemarray_getfloat(vec_dst_re, v_index+i_inc); + old2_im = iemarray_getfloat(vec_dst_im, v_index+i_inc); + w = sincos[w_index]; - vec_dst_re[v_index+i_inc] = (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag; - vec_dst_im[v_index+i_inc] = (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag; - vec_dst_re[v_index] = old1_re + old2_re; - vec_dst_im[v_index] = old1_im + old2_im; + iemarray_setfloat(vec_dst_re, v_index+i_inc, (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag); + iemarray_setfloat(vec_dst_im, v_index+i_inc, (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag); + iemarray_setfloat(vec_dst_re, v_index, old1_re + old2_re); + iemarray_setfloat(vec_dst_im, v_index, old1_im + old2_im); w_index += w_inc; v_index++; } @@ -286,12 +289,12 @@ j = j + k; if(i < j) { - old1_re = vec_dst_re[j]; - old1_im = vec_dst_im[j]; - vec_dst_re[j] = vec_dst_re[i]; - vec_dst_im[j] = vec_dst_im[i]; - vec_dst_re[i] = old1_re; - vec_dst_im[i] = old1_im; + old1_re = iemarray_getfloat(vec_dst_re, j); + old1_im = iemarray_getfloat(vec_dst_im, j); + iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); + iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); + iemarray_setfloat(vec_dst_re, i, old1_re); + iemarray_setfloat(vec_dst_im, i, old1_im); } }
Modified: trunk/externals/iem/iem_tab/src/tab_find_exact_peaks.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_find_exact_peaks.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_find_exact_peaks.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -17,7 +17,7 @@ t_object x_obj; int x_size_src1; int x_offset_src1; - t_float *x_beg_mem_src1; + iemarray_t *x_beg_mem_src1; int x_work_alloc; int *x_beg_mem_work1; t_float *x_beg_mem_work2; @@ -94,8 +94,9 @@ static void tab_find_exact_peaks_bang(t_tab_find_exact_peaks *x) { int i, n, w, ww; - int ok_src, peak_index=0, sort_index=0; - t_float *vec_src, *vec_work2; + int ok_src, peak_index=0; + t_float *vec_work2; + iemarray_t *vec_src; int *vec_work1; t_float max=-1.0e37; int max_peaks=x->x_n_peaks; @@ -145,10 +146,10 @@
for(i=beg; i<end; i++) { - diff_low = vec_src[i-low_bord] - abs_min_height_diff; - diff_high = vec_src[i+high_bord] - abs_min_height_diff; - if((vec_src[i-low_bord-1] < diff_low) && !vec_work1[i-low_bord] && - (vec_src[i+high_bord+1] < diff_high) && !vec_work1[i+high_bord]) + diff_low = iemarray_getfloat(vec_src, i-low_bord) - abs_min_height_diff; + diff_high = iemarray_getfloat(vec_src, i+high_bord) - abs_min_height_diff; + if((iemarray_getfloat(vec_src, i-low_bord-1) < diff_low) && !vec_work1[i-low_bord] && + (iemarray_getfloat(vec_src, i+high_bord+1) < diff_high) && !vec_work1[i+high_bord]) { for(j=i-low_bord; j<=i+high_bord; j++) vec_work1[j] = 1; @@ -174,7 +175,7 @@ peak_index = (i + j) / 2; if(sort_index <= max_peaks) { - outlet_float(x->x_peak_value_out, vec_src[i]); + outlet_float(x->x_peak_value_out, iemarray_getfloat(vec_src, i)); outlet_float(x->x_peak_index_out, (t_float)peak_index); outlet_float(x->x_sort_index_out, sort_index); sort_index++; @@ -207,15 +208,15 @@
for(i=beg; i<end; i++) { - diff_low = vec_src[i-low_bord] - abs_min_height_diff; - diff_high = vec_src[i+high_bord] - abs_min_height_diff; - if((vec_src[i-low_bord-1] < diff_low) && !vec_work1[i-low_bord] && - (vec_src[i+high_bord+1] < diff_high) && !vec_work1[i+high_bord]) + diff_low = iemarray_getfloat(vec_src, i-low_bord) - abs_min_height_diff; + diff_high = iemarray_getfloat(vec_src, i+high_bord) - abs_min_height_diff; + if((iemarray_getfloat(vec_src, i-low_bord-1) < diff_low) && !vec_work1[i-low_bord] && + (iemarray_getfloat(vec_src, i+high_bord+1) < diff_high) && !vec_work1[i+high_bord]) { for(j=i-low_bord; j<=i+high_bord; j++) { vec_work1[j] = 1; - vec_work2[j] = vec_src[j]; + vec_work2[j] = iemarray_getfloat(vec_src, j); } //post("a[%d]=%g, a[%d]=%g",i-low_bord,vec_src[i-low_bord],i+high_bord,vec_src[i+high_bord]); }
Modified: trunk/externals/iem/iem_tab/src/tab_find_peaks.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_find_peaks.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_find_peaks.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -17,7 +17,7 @@ t_object x_obj; int x_size_src1; int x_offset_src1; - t_float *x_beg_mem_src1; + iemarray_t *x_beg_mem_src1; int x_work_alloc; int *x_beg_mem_work1; t_float *x_beg_mem_work2; @@ -94,8 +94,9 @@ static void tab_find_peaks_bang(t_tab_find_peaks *x) { int i, n, w, ww; - int ok_src, peak_index=0, sort_index=0; - t_float *vec_src, *vec_work2; + int ok_src, peak_index=0; + iemarray_t *vec_src; + t_float *vec_work2; int *vec_work1; t_float max=-1.0e37; int max_peaks=x->x_n_peaks; @@ -145,10 +146,10 @@
for(i=beg; i<end; i++) { - diff_low = vec_src[i-low_bord] - abs_min_height_diff; - diff_high = vec_src[i+high_bord] - abs_min_height_diff; - if((vec_src[i-low_bord-1] < diff_low) && !vec_work1[i-low_bord] && - (vec_src[i+high_bord+1] < diff_high) && !vec_work1[i+high_bord]) + diff_low = iemarray_getfloat(vec_src, i-low_bord) - abs_min_height_diff; + diff_high = iemarray_getfloat(vec_src, i+high_bord) - abs_min_height_diff; + if((iemarray_getfloat(vec_src, i-low_bord-1) < diff_low) && !vec_work1[i-low_bord] && + (iemarray_getfloat(vec_src, i+high_bord+1) < diff_high) && !vec_work1[i+high_bord]) { for(j=i-low_bord; j<=i+high_bord; j++) vec_work1[j] = 1; @@ -174,7 +175,7 @@ peak_index = (i + j) / 2; if(sort_index <= max_peaks) { - outlet_float(x->x_peak_value_out, vec_src[i]); + outlet_float(x->x_peak_value_out, iemarray_getfloat(vec_src, i)); outlet_float(x->x_peak_index_out, (t_float)peak_index); outlet_float(x->x_sort_index_out, sort_index); sort_index++; @@ -207,15 +208,15 @@
for(i=beg; i<end; i++) { - diff_low = vec_src[i-low_bord] - abs_min_height_diff; - diff_high = vec_src[i+high_bord] - abs_min_height_diff; - if((vec_src[i-low_bord-1] < diff_low) && !vec_work1[i-low_bord] && - (vec_src[i+high_bord+1] < diff_high) && !vec_work1[i+high_bord]) + diff_low = iemarray_getfloat(vec_src, i-low_bord) - abs_min_height_diff; + diff_high = iemarray_getfloat(vec_src, i+high_bord) - abs_min_height_diff; + if((iemarray_getfloat(vec_src, i-low_bord-1) < diff_low) && !vec_work1[i-low_bord] && + (iemarray_getfloat(vec_src, i+high_bord+1) < diff_high) && !vec_work1[i+high_bord]) { for(j=i-low_bord; j<=i+high_bord; j++) { vec_work1[j] = 1; - vec_work2[j] = vec_src[j]; + vec_work2[j] = iemarray_getfloat(vec_src, j); } //post("a[%d]=%g, a[%d]=%g",i-low_bord,vec_src[i-low_bord],i+high_bord,vec_src[i+high_bord]); }
Modified: trunk/externals/iem/iem_tab/src/tab_ge.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_ge.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_ge.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -8,6 +8,10 @@ #include "iem_tab.h"
/* -------------------------- tab_ge ------------------------------ */ +/* if(x_beg_mem_src1[i] >= x_beg_mem_src2[i]) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] = 0.0f; */
typedef struct _tab_ge { @@ -18,9 +22,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -47,7 +51,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_ge"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -71,10 +75,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] >= vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) >= iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -88,7 +92,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -124,10 +128,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] >= vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) >= iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -150,7 +154,6 @@ { t_tab_ge *x = (t_tab_ge *)pd_new(tab_ge_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_ge_scalar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_ge_scalar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_ge_scalar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_ge_scalar ------------------------------ */ +/* if(x_beg_mem_src1[i] >= compare) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] += 0.0f; */
typedef struct _tab_ge_scalar { @@ -16,8 +20,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_ge_scalar; @@ -33,7 +37,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_ge_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_ge_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -53,10 +57,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] >= compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) >= compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -75,7 +79,8 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst, compare; + t_float compare; + iemarray_t *vec_src1, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -107,10 +112,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] >= compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) >= compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
Modified: trunk/externals/iem/iem_tab/src/tab_gt.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_gt.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_gt.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_gt ------------------------------ */ +/* if(x_beg_mem_src1[i] > x_beg_mem_src2[i]) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] = 0.0f; */
typedef struct _tab_gt { @@ -18,9 +22,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -47,7 +51,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_gt"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -71,10 +75,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] > vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) > iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -88,7 +92,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -124,10 +128,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] > vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) > iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -150,7 +154,6 @@ { t_tab_gt *x = (t_tab_gt *)pd_new(tab_gt_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_gt_scalar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_gt_scalar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_gt_scalar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_gt_scalar ------------------------------ */ +/* if(x_beg_mem_src1[i] > compare) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] += 0.0f; */
typedef struct _tab_gt_scalar { @@ -16,8 +20,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_gt_scalar; @@ -33,7 +37,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_gt_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_gt_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -53,10 +57,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] > compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) > compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -75,7 +79,8 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst, compare; + t_float compare; + iemarray_t *vec_src1, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -107,10 +112,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] > compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) > compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
Modified: trunk/externals/iem/iem_tab/src/tab_ifft.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_ifft.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_ifft.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -9,6 +9,7 @@ #include <math.h>
/* -------------------------- tab_ifft ------------------------------ */ +/* complex inverse FFT */
typedef struct _tab_ifft { @@ -22,10 +23,10 @@ int x_offset_dst_re; int x_offset_dst_im; int x_fftsize; - t_float *x_beg_mem_src_re; - t_float *x_beg_mem_src_im; - t_float *x_beg_mem_dst_re; - t_float *x_beg_mem_dst_im; + iemarray_t *x_beg_mem_src_re; + iemarray_t *x_beg_mem_src_im; + iemarray_t *x_beg_mem_dst_re; + iemarray_t *x_beg_mem_dst_im; TAB_COMPLEX *x_sin_cos; t_symbol *x_sym_src_re; t_symbol *x_sym_src_im; @@ -100,7 +101,7 @@ int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; - t_float *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; + iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im, g;
ok_src_re = iem_tab_check_arrays(gensym("tab_ifft"), x->x_sym_src_re, &x->x_beg_mem_src_re, &x->x_size_src_re, fftsize); @@ -119,8 +120,8 @@
for(j=0; j<fftsize; j++) { - vec_dst_re[j] = vec_src_re[j]; - vec_dst_im[j] = vec_src_im[j]; + iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_src_re, j)); + iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_src_im, j)); }
i_inc = fs2; @@ -133,15 +134,16 @@ w_index = 0; for(k=0; k<i_inc; k++) { - old1_re = vec_dst_re[v_index]; - old1_im = vec_dst_im[v_index]; - old2_re = vec_dst_re[v_index+i_inc]; - old2_im = vec_dst_im[v_index+i_inc]; + old1_re = iemarray_getfloat(vec_dst_re, v_index); + old1_im = iemarray_getfloat(vec_dst_im, v_index); + old2_re = iemarray_getfloat(vec_dst_re, v_index+i_inc); + old2_im = iemarray_getfloat(vec_dst_im, v_index+i_inc); + w = sincos[w_index]; - vec_dst_re[v_index+i_inc] = (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag; - vec_dst_im[v_index+i_inc] = (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag; - vec_dst_re[v_index] = old1_re + old2_re; - vec_dst_im[v_index] = old1_im + old2_im; + iemarray_setfloat(vec_dst_re, v_index+i_inc, (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag); + iemarray_setfloat(vec_dst_im, v_index+i_inc, (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag); + iemarray_setfloat(vec_dst_re, v_index, old1_re + old2_re); + iemarray_setfloat(vec_dst_im, v_index, old1_im + old2_im); w_index += w_inc; v_index++; } @@ -163,12 +165,12 @@ j = j + k; if(i < j) { - old1_re = vec_dst_re[j]; - old1_im = vec_dst_im[j]; - vec_dst_re[j] = vec_dst_re[i]; - vec_dst_im[j] = vec_dst_im[i]; - vec_dst_re[i] = old1_re; - vec_dst_im[i] = old1_im; + old1_re = iemarray_getfloat(vec_dst_re, j); + old1_im = iemarray_getfloat(vec_dst_im, j); + iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); + iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); + iemarray_setfloat(vec_dst_re, i, old1_re); + iemarray_setfloat(vec_dst_im, i, old1_im); } }
@@ -188,8 +190,8 @@ g = 1.0f / (t_float)fftsize; for(i = 0; i < fftsize; i++) { - vec_dst_re[i] *= g; - vec_dst_im[i] *= g; + iemarray_setfloat(vec_dst_re, i, iemarray_getfloat(vec_dst_re, i)*g); + iemarray_setfloat(vec_dst_im, i, iemarray_getfloat(vec_dst_im, i)*g); }
outlet_bang(x->x_obj.ob_outlet); @@ -211,7 +213,7 @@ int fs2 = fftsize / 2; TAB_COMPLEX w; TAB_COMPLEX *sincos = x->x_sin_cos; - t_float *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; + iemarray_t *vec_src_re, *vec_src_im, *vec_dst_re, *vec_dst_im; t_float old1_re, old1_im, old2_re, old2_im, g;
if((argc >= 4) && @@ -249,8 +251,8 @@
for(j=0; j<fftsize; j++) { - vec_dst_re[j] = vec_src_re[j]; - vec_dst_im[j] = vec_src_im[j]; + iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_src_re, j)); + iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_src_im, j)); }
i_inc = fs2; @@ -263,15 +265,16 @@ w_index = 0; for(k=0; k<i_inc; k++) { - old1_re = vec_dst_re[v_index]; - old1_im = vec_dst_im[v_index]; - old2_re = vec_dst_re[v_index+i_inc]; - old2_im = vec_dst_im[v_index+i_inc]; + old1_re = iemarray_getfloat(vec_dst_re, v_index); + old1_im = iemarray_getfloat(vec_dst_im, v_index); + old2_re = iemarray_getfloat(vec_dst_re, v_index+i_inc); + old2_im = iemarray_getfloat(vec_dst_im, v_index+i_inc); + w = sincos[w_index]; - vec_dst_re[v_index+i_inc] = (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag; - vec_dst_im[v_index+i_inc] = (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag; - vec_dst_re[v_index] = old1_re + old2_re; - vec_dst_im[v_index] = old1_im + old2_im; + iemarray_setfloat(vec_dst_re, v_index+i_inc, (old1_re - old2_re)*w.real - (old1_im - old2_im)*w.imag); + iemarray_setfloat(vec_dst_im, v_index+i_inc, (old1_im - old2_im)*w.real + (old1_re - old2_re)*w.imag); + iemarray_setfloat(vec_dst_re, v_index, old1_re + old2_re); + iemarray_setfloat(vec_dst_im, v_index, old1_im + old2_im); w_index += w_inc; v_index++; } @@ -293,12 +296,12 @@ j = j + k; if(i < j) { - old1_re = vec_dst_re[j]; - old1_im = vec_dst_im[j]; - vec_dst_re[j] = vec_dst_re[i]; - vec_dst_im[j] = vec_dst_im[i]; - vec_dst_re[i] = old1_re; - vec_dst_im[i] = old1_im; + old1_re = iemarray_getfloat(vec_dst_re, j); + old1_im = iemarray_getfloat(vec_dst_im, j); + iemarray_setfloat(vec_dst_re, j, iemarray_getfloat(vec_dst_re, i)); + iemarray_setfloat(vec_dst_im, j, iemarray_getfloat(vec_dst_im, i)); + iemarray_setfloat(vec_dst_re, i, old1_re); + iemarray_setfloat(vec_dst_im, i, old1_im); } }
@@ -318,8 +321,8 @@ g = 1.0f / (t_float)fftsize; for(i = 0; i < fftsize; i++) { - vec_dst_re[i] *= g; - vec_dst_im[i] *= g; + iemarray_setfloat(vec_dst_re, i, iemarray_getfloat(vec_dst_re, i)*g); + iemarray_setfloat(vec_dst_im, i, iemarray_getfloat(vec_dst_im, i)*g); }
outlet_bang(x->x_obj.ob_outlet);
Modified: trunk/externals/iem/iem_tab/src/tab_le.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_le.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_le.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_le ------------------------------ */ +/* if(x_beg_mem_src1[i] <= x_beg_mem_src2[i]) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] = 0.0f; */
typedef struct _tab_le { @@ -18,9 +22,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -47,7 +51,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_le"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -71,10 +75,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] <= vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) <= iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -88,7 +92,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -124,10 +128,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] <= vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) <= iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -150,7 +154,6 @@ { t_tab_le *x = (t_tab_le *)pd_new(tab_le_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_le_scalar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_le_scalar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_le_scalar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_le_scalar ------------------------------ */ +/* if(x_beg_mem_src1[i] <= compare) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] += 0.0f; */
typedef struct _tab_le_scalar { @@ -16,8 +20,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_le_scalar; @@ -33,7 +37,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_le_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_le_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -53,10 +57,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] <= compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) <= compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -75,7 +79,8 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst, compare; + t_float compare; + iemarray_t *vec_src1, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -107,10 +112,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] <= compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) <= compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
Modified: trunk/externals/iem/iem_tab/src/tab_lt.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_lt.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_lt.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" @@ -9,6 +9,10 @@ #include "iem_tab.h"
/* -------------------------- tab_lt ------------------------------ */ +/* if(x_beg_mem_src1[i] < x_beg_mem_src2[i]) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] = 0.0f; */
typedef struct _tab_lt { @@ -19,9 +23,9 @@ int x_offset_src1; int x_offset_src2; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_src2; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_src2; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_scr2; t_symbol *x_sym_dst; @@ -48,7 +52,7 @@ { int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_src2 = iem_tab_check_arrays(gensym("tab_lt"), x->x_sym_scr2, &x->x_beg_mem_src2, &x->x_size_src2, 0); @@ -72,10 +76,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] < vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) < iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -89,7 +93,7 @@ int beg_src1, beg_src2, beg_dst; int i, n; int ok_src1, ok_src2, ok_dst; - t_float *vec_src1, *vec_src2, *vec_dst; + iemarray_t *vec_src1, *vec_src2, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -125,10 +129,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] < vec_src2[i]) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) < iemarray_getfloat(vec_src2, i)) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -151,7 +155,6 @@ { t_tab_lt *x = (t_tab_lt *)pd_new(tab_lt_class); t_symbol *src1, *src2, *dst; - t_float time;
if((argc >= 3) && IS_A_SYMBOL(argv,0) &&
Modified: trunk/externals/iem/iem_tab/src/tab_lt_scalar.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_lt_scalar.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_lt_scalar.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,13 +1,17 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" #include "iem_tab.h"
/* -------------------------- tab_lt_scalar ------------------------------ */ +/* if(x_beg_mem_src1[i] < compare) */ +/* x_beg_mem_dst[i] = 1.0f; */ +/* else */ +/* x_beg_mem_dst[i] += 0.0f; */
typedef struct _tab_lt_scalar { @@ -16,8 +20,8 @@ int x_size_dst; int x_offset_src1; int x_offset_dst; - t_float *x_beg_mem_src1; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_src1; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_scr1; t_symbol *x_sym_dst; } t_tab_lt_scalar; @@ -33,7 +37,7 @@ { int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst; + iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_lt_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); ok_dst = iem_tab_check_arrays(gensym("tab_lt_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0); @@ -53,10 +57,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] < compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) < compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class); @@ -75,7 +79,8 @@ int beg_src1, beg_dst; int i, n; int ok_src1, ok_dst; - t_float *vec_src1, *vec_dst, compare; + t_float compare; + iemarray_t *vec_src1, *vec_dst;
if((argc >= 4) && IS_A_FLOAT(argv,0) && @@ -107,10 +112,10 @@
for(i=0; i<n; i++) { - if(vec_src1[i] < compare) - vec_dst[i] = 1.0f; + if(iemarray_getfloat(vec_src1, i) < compare) + iemarray_setfloat(vec_dst, i, 1.0f); else - vec_dst[i] = 0.0f; + iemarray_setfloat(vec_dst, i, 0.0f); } outlet_bang(x->x_obj.ob_outlet); a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
Modified: trunk/externals/iem/iem_tab/src/tab_max_index.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_max_index.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_max_index.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -14,7 +14,7 @@ t_object x_obj; int x_size_src1; int x_offset_src1; - t_float *x_beg_mem_src1; + iemarray_t *x_beg_mem_src1; t_symbol *x_sym_scr1; void *x_bang_out; void *x_max_out; @@ -32,7 +32,7 @@ { int i, n; int ok_src, max_index=0; - t_float *vec_src; + iemarray_t *vec_src; t_float max=-1.0e37;
ok_src = iem_tab_check_arrays(gensym("tab_max_index"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); @@ -45,9 +45,9 @@ { for(i=0; i<n; i++) { - if(vec_src[i] > max) + if(iemarray_getfloat(vec_src, i) > max) { - max = vec_src[i]; + max = iemarray_getfloat(vec_src, i); max_index = i; } } @@ -63,7 +63,7 @@ int beg_src; int i, n; int ok_src, max_index=0; - t_float *vec_src; + iemarray_t *vec_src; t_float max=-1.0e37;
if((argc >= 2) && @@ -86,9 +86,9 @@ { for(i=0; i<n; i++) { - if(vec_src[i] > max) + if(iemarray_getfloat(vec_src, i) > max) { - max = vec_src[i]; + max = iemarray_getfloat(vec_src, i); max_index = i + beg_src; } }
Modified: trunk/externals/iem/iem_tab/src/tab_min_index.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_min_index.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_min_index.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" @@ -15,7 +15,7 @@ t_object x_obj; int x_size_src1; int x_offset_src1; - t_float *x_beg_mem_src1; + iemarray_t *x_beg_mem_src1; t_symbol *x_sym_scr1; void *x_bang_out; void *x_min_out; @@ -33,7 +33,7 @@ { int i, n; int ok_src, min_index=0; - t_float *vec_src; + iemarray_t *vec_src; t_float min=1.0e37;
ok_src = iem_tab_check_arrays(gensym("tab_min_index"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); @@ -46,9 +46,9 @@ { for(i=0; i<n; i++) { - if(vec_src[i] < min) + if(iemarray_getfloat(vec_src, i) < min) { - min = vec_src[i]; + min = iemarray_getfloat(vec_src, i); min_index = i; } } @@ -64,7 +64,7 @@ int beg_src; int i, n; int ok_src, min_index=0; - t_float *vec_src; + iemarray_t *vec_src; t_float min=1.0e37;
if((argc >= 2) && @@ -87,9 +87,9 @@ { for(i=0; i<n; i++) { - if(vec_src[i] < min) + if(iemarray_getfloat(vec_src, i) < min) { - min = vec_src[i]; + min = iemarray_getfloat(vec_src, i); min_index = i + beg_src; } }
Modified: trunk/externals/iem/iem_tab/src/tab_min_max.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_min_max.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_min_max.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" @@ -16,7 +16,7 @@ t_object x_obj; int x_size_src1; int x_offset_src1; - t_float *x_beg_mem_src1; + iemarray_t *x_beg_mem_src1; t_symbol *x_sym_scr1; void *x_bang_out; void *x_min_out; @@ -34,7 +34,7 @@ { int i, n; int ok_src; - t_float *vec_src; + iemarray_t *vec_src; t_float min=1.0e37, max=-1.0e37;
ok_src = iem_tab_check_arrays(gensym("tab_min_max"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0); @@ -47,10 +47,10 @@ { for(i=0; i<n; i++) { - if(vec_src[i] > max) - max = vec_src[i]; - if(vec_src[i] < min) - min = vec_src[i]; + if(iemarray_getfloat(vec_src, i) > max) + max = iemarray_getfloat(vec_src, i); + if(iemarray_getfloat(vec_src, i) < min) + min = iemarray_getfloat(vec_src, i); } outlet_float(x->x_max_out, max); outlet_float(x->x_min_out, min); @@ -64,7 +64,7 @@ int beg_src; int i, n; int ok_src; - t_float *vec_src; + iemarray_t *vec_src; t_float min=1.0e37, max=-1.0e37;
if((argc >= 2) && @@ -87,10 +87,10 @@ { for(i=0; i<n; i++) { - if(vec_src[i] > max) - max = vec_src[i]; - if(vec_src[i] < min) - min = vec_src[i]; + if(iemarray_getfloat(vec_src, i) > max) + max = iemarray_getfloat(vec_src, i); + if(iemarray_getfloat(vec_src, i) < min) + min = iemarray_getfloat(vec_src, i); } outlet_float(x->x_max_out, max); outlet_float(x->x_min_out, min);
Modified: trunk/externals/iem/iem_tab/src/tab_mls.c =================================================================== --- trunk/externals/iem/iem_tab/src/tab_mls.c 2009-02-01 05:22:01 UTC (rev 10705) +++ trunk/externals/iem/iem_tab/src/tab_mls.c 2009-02-01 05:25:21 UTC (rev 10706) @@ -1,7 +1,7 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */ +iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h" #include "iemlib.h" @@ -15,7 +15,7 @@ t_object x_obj; int x_size_dst; int x_offset_dst; - t_float *x_beg_mem_dst; + iemarray_t *x_beg_mem_dst; t_symbol *x_sym_dst; } t_tab_mls;
@@ -30,7 +30,7 @@ return(j); }
-static void tab_mls_calc(t_float *vec, int mls_order) +static void tab_mls_calc(iemarray_t *vec, int mls_order) { int i, j; int work1=1, work2, exor; @@ -126,12 +126,12 @@ } if(exor & 1) { - vec[i] = 1.0f; + iemarray_setfloat(vec, i, 1.0f); work1 = work2 | source; } else { - vec[i] = -1.0f; + iemarray_setfloat(vec, i, -1.0f); work1 = work2; } } @@ -170,7 +170,8 @@ int beg_dst; int i, n; int ok_dst; - t_float *vec_dst, c; + t_float c; + iemarray_t *vec_dst;
if((argc >= 3) && IS_A_FLOAT(argv,0) && @@ -195,7 +196,7 @@ t_garray *a;
for(i=0; i<n; i++) - vec_dst[i] = c; + iemarray_setfloat(vec_dst, i, c);
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.