diff options
Diffstat (limited to 'cyclone/sickle')
-rw-r--r-- | cyclone/sickle/capture.c | 7 | ||||
-rw-r--r-- | cyclone/sickle/matrix.c | 30 |
2 files changed, 33 insertions, 4 deletions
diff --git a/cyclone/sickle/capture.c b/cyclone/sickle/capture.c index 089c21e..8f8f5a0 100644 --- a/cyclone/sickle/capture.c +++ b/cyclone/sickle/capture.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002-2003 krzYszcz and others. +/* Copyright (c) 2002-2005 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ @@ -54,7 +54,7 @@ static int capture_formatfloat(t_capture *x, float f, char *buf, int col, else cnt += sprintf(bp, "%d", (int)f); if (col + cnt > maxcol) - buf[0] = '\n', col = cnt; + buf[0] = '\n', col = cnt - 1; /* assuming col > 0 */ else col += cnt; return (col); @@ -144,7 +144,7 @@ static void capture_open(t_capture *x) int count = x->x_count; char buf[MAXPDSTRING]; int nindices = (x->x_nindices > 0 ? x->x_nindices : x->x_nblock); - hammereditor_open(x->x_filehandle, "Signal Capture"); /* CHECKED */ + hammereditor_open(x->x_filehandle, "Signal Capture", ""); /* CHECKED */ if (x->x_mode == 'f' || count < x->x_bufsize) { float *bp = x->x_buffer; @@ -169,6 +169,7 @@ static void capture_open(t_capture *x) } } +/* CHECKED without asking and storing the changes */ static void capture_wclose(t_capture *x) { hammereditor_close(x->x_filehandle, 0); diff --git a/cyclone/sickle/matrix.c b/cyclone/sickle/matrix.c index a0772dc..a1c1ef4 100644 --- a/cyclone/sickle/matrix.c +++ b/cyclone/sickle/matrix.c @@ -9,7 +9,7 @@ #include "sickle/sic.h" #ifdef KRZYSZCZ -#define MATRIX_DEBUG +//#define MATRIX_DEBUG #endif #define MATRIX_DEFGAIN 0. /* CHECKED */ @@ -124,6 +124,32 @@ static void matrix_clear(t_matrix *x) x->x_cells[i] = 0; } +static void matrix_set(t_matrix *x, t_floatarg f1, t_floatarg f2) +{ + int i, onoff; + float gain = f1; + static int warned = 0; + if (fittermax_get() && !warned) + { + fittermax_warning(*(t_pd *)x, "'set' not supported in Max"); + warned = 1; + } + onoff = (gain < -MATRIX_GAINEPSILON || gain > MATRIX_GAINEPSILON); + for (i = 0; i < x->x_ncells; i++) + x->x_cells[i] = onoff; + if (x->x_gains) + { + float ramp = (f2 < MATRIX_MINRAMP ? 0. : f2); + for (i = 0; i < x->x_ncells; i++) + { + if (onoff) /* LATER rethink */ + x->x_gains[i] = gain; + x->x_ramps[i] = ramp; + matrix_retarget(x, i); + } + } +} + /* CHECKED c74's refman and help patch are wrong about int pairs -- the actual syntax is "[dis]connect indx ondx1 [ondx2 [ondx3..." */ static void matrix_connect(t_matrix *x, t_symbol *s, int ac, t_atom *av) @@ -543,6 +569,8 @@ void matrix_tilde_setup(void) class_addlist(matrix_class, matrix_list); class_addmethod(matrix_class, (t_method)matrix_clear, gensym("clear"), 0); + class_addmethod(matrix_class, (t_method)matrix_set, + gensym("set"), A_FLOAT, A_DEFFLOAT, 0); class_addmethod(matrix_class, (t_method)matrix_connect, gensym("connect"), A_GIMME, 0); class_addmethod(matrix_class, (t_method)matrix_connect, |