diff options
Diffstat (limited to 'nusmuk-utils/tab_downsample_average.c')
-rw-r--r-- | nusmuk-utils/tab_downsample_average.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nusmuk-utils/tab_downsample_average.c b/nusmuk-utils/tab_downsample_average.c index 610b6dd..c948ba2 100644 --- a/nusmuk-utils/tab_downsample_average.c +++ b/nusmuk-utils/tab_downsample_average.c @@ -19,7 +19,7 @@ void *tab_downsample_average_new(t_symbol *s_src,t_symbol *s_dst, t_float factor x->x_arrayname_src = s_src; x->x_arrayname_dst = s_dst; - x->factor = factor; + x->factor = MAX(1, factor); x->b_out = outlet_new(&x->x_obj, &s_bang); @@ -47,7 +47,7 @@ void tab_downsample_average_bang(t_tab_downsample_average *x) else { nb_max = MIN(npoints_src/x->factor, npoints_dst); - + // post("nb_max = %d",nb_max); index_src = 0; for (i=0; i<nb_max;i++) { @@ -75,7 +75,7 @@ void tab_downsample_average_dst(t_tab_downsample_average *x, t_symbol *s_dst) { } void tab_downsample_average_factor(t_tab_downsample_average *x, t_float factor) { - x->factor = factor; + x->factor = MAX(1, factor); } void tab_downsample_average_setup(void) { |