diff --git a/externals/miXed/cyclone/hammer/Clip.c b/externals/miXed/cyclone/hammer/Clip.c index d0c54ebf57f5731f0bdd1c429a57bc5d1b1c87fa..d3660363d71904e228bf488d1630b7a71dd0b011 100644 --- a/externals/miXed/cyclone/hammer/Clip.c +++ b/externals/miXed/cyclone/hammer/Clip.c @@ -142,7 +142,6 @@ void Clip_setup(void) (t_method)clip_free, sizeof(t_clip), 0, A_GIMME, 0); - class_addcreator((t_newmethod)clip_new, gensym("clip"), A_GIMME, 0); class_addcreator((t_newmethod)clip_new, gensym("cyclone/clip"), A_GIMME, 0); class_addfloat(clip_class, clip_float); class_addlist(clip_class, clip_list); diff --git a/externals/miXed/cyclone/hammer/pv.c b/externals/miXed/cyclone/hammer/pv.c index 85f4ddcc63b9dcc4178467912f21e7b57186f933..81feebf0e852ba0331cee4046594a2be33d70f91 100644 --- a/externals/miXed/cyclone/hammer/pv.c +++ b/externals/miXed/cyclone/hammer/pv.c @@ -395,9 +395,16 @@ static void pv_free(t_pv *x) static void *pv_new(t_symbol *s, int ac, t_atom *av) { t_pv *x = 0; + t_atom sane_default; if (ac && av->a_type == A_SYMBOL) s = av->a_w.w_symbol; - else s = 0; + else + { + post("pv: warning: no symbol argument provided: defaulting to 'dummy'"); + SETSYMBOL(&sane_default, gensym("dummy")); + ac = 1; + av = &sane_default; + } if (s && s != &s_) { t_glist *gl = canvas_getcurrent(); diff --git a/externals/miXed/cyclone/sickle/Clip.c b/externals/miXed/cyclone/sickle/Clip.c index d38ff4412e529076781130c51105a90cbaeb7ade..7b7074801296b42e4f6634b6798522cf3b58e5c8 100644 --- a/externals/miXed/cyclone/sickle/Clip.c +++ b/externals/miXed/cyclone/sickle/Clip.c @@ -55,7 +55,6 @@ void Clip_tilde_setup(void) clip_class = class_new(gensym("Clip~"), (t_newmethod)clip_new, 0, sizeof(t_clip), 0, A_GIMME, 0); - class_addcreator((t_newmethod)clip_new, gensym("clip~"), A_GIMME, 0); class_addcreator((t_newmethod)clip_new, gensym("cyclone/clip~"), A_GIMME, 0); sic_setup(clip_class, clip_dsp, SIC_FLOATTOSIGNAL); } diff --git a/externals/miXed/cyclone/sickle/Line.c b/externals/miXed/cyclone/sickle/Line.c index 2ef31c053204345b6f17c035d41abb9f9fb9d627..78d446bca8e1c3f2bc60af704db8cd699954886f 100644 --- a/externals/miXed/cyclone/sickle/Line.c +++ b/externals/miXed/cyclone/sickle/Line.c @@ -323,7 +323,6 @@ void Line_tilde_setup(void) (t_newmethod)line_new, (t_method)line_free, sizeof(t_line), 0, A_DEFFLOAT, 0); - class_addcreator((t_newmethod)line_new, gensym("line~"), A_DEFFLOAT, 0); class_addcreator((t_newmethod)line_new, gensym("cyclone/line~"), A_DEFFLOAT, 0); sic_setup(line_class, line_dsp, SIC_NOMAINSIGNALIN); class_addfloat(line_class, line_float); diff --git a/externals/miXed/cyclone/sickle/Snapshot.c b/externals/miXed/cyclone/sickle/Snapshot.c index 13ef0ce8c43c138e6c6b57b6630429b02813f9c6..4ffd4c62573f574ac217d6fcdd64b8e462ff7b3c 100644 --- a/externals/miXed/cyclone/sickle/Snapshot.c +++ b/externals/miXed/cyclone/sickle/Snapshot.c @@ -148,7 +148,6 @@ void Snapshot_tilde_setup(void) (t_method)snapshot_free, sizeof(t_snapshot), 0, A_DEFFLOAT, A_DEFFLOAT, 0); - class_addcreator((t_newmethod)snapshot_new, gensym("snapshot~"), A_DEFFLOAT, A_DEFFLOAT, 0); class_addcreator((t_newmethod)snapshot_new, gensym("cyclone/snapshot~"), A_DEFFLOAT, A_DEFFLOAT, 0); sic_setup(snapshot_class, snapshot_dsp, snapshot_float); class_addbang(snapshot_class, snapshot_bang); diff --git a/externals/miXed/cyclone/sickle/matrix.c b/externals/miXed/cyclone/sickle/matrix.c index a1c1ef460a140b6497ac64f8f110efb5ef5a7ada..8dcea78f12f30a327e731003c59da16a4df93d1d 100644 --- a/externals/miXed/cyclone/sickle/matrix.c +++ b/externals/miXed/cyclone/sickle/matrix.c @@ -482,79 +482,89 @@ static void matrix_free(t_matrix *x) static void *matrix_new(t_symbol *s, int ac, t_atom *av) { t_pd *z; + t_atom sane_defaults[3]; if (!fittermax_get() && (z = fragile_class_mutate(matrixps_matrixtilde, (t_newmethod)matrix_new, ac, av))) +{ return (z); +} + if (!ac) // sane defaults if no arguments given + { + post("matrix~: warning: no arguments supplied: picking sane " + "defaults [matrix~ 1 1 0]"); + SETFLOAT(sane_defaults, 1.); + SETFLOAT(sane_defaults, 1.); + SETFLOAT(sane_defaults, 0.); + ac = 3; + av = sane_defaults; + } else if (ac < 2) { - loud_error(0, "bad creation arguments for class '%s'", - matrixps_matrixtilde->s_name); - loud_errand(0, "missing number of %s", (ac ? "outlets" : "inlets")); - return (0); /* CHECKED */ + loud_error(0, "bad creation arguments for class '%s'", + matrixps_matrixtilde->s_name); + loud_errand(0, "missing number of %s", (ac ? "outlets" : "inlets")); + return (0); /* CHECKED */ + } + t_matrix *x = (t_matrix *)pd_new(matrix_class); + int i; + if (av[0].a_type == A_FLOAT) + { + if ((x->x_ninlets = (int)av[0].a_w.w_float) < 1) + x->x_ninlets = 1; + } + else x->x_ninlets = 1; /* CHECKED */ + if (av[1].a_type == A_FLOAT) + { + if ((x->x_noutlets = (int)av[1].a_w.w_float) < 1) + x->x_noutlets = 1; + } + else x->x_noutlets = 1; /* CHECKED */ + x->x_ncells = x->x_ninlets * x->x_noutlets; + x->x_ivecs = getbytes(x->x_ninlets * sizeof(*x->x_ivecs)); + x->x_ovecs = getbytes(x->x_noutlets * sizeof(*x->x_ovecs)); + x->x_nblock = x->x_maxblock = sys_getblksize(); + x->x_osums = getbytes(x->x_noutlets * sizeof(*x->x_osums)); + for (i = 0; i < x->x_noutlets; i++) + x->x_osums[i] = getbytes(x->x_maxblock * sizeof(*x->x_osums[i])); + x->x_cells = getbytes(x->x_ncells * sizeof(*x->x_cells)); + matrix_clear(x); + if (ac >= 3) + { + if (av[2].a_type == A_FLOAT) + x->x_defgain = av[2].a_w.w_float; + else + x->x_defgain = MATRIX_DEFGAIN; + x->x_gains = getbytes(x->x_ncells * sizeof(*x->x_gains)); + for (i = 0; i < x->x_ncells; i++) + x->x_gains[i] = x->x_defgain; + x->x_ramps = getbytes(x->x_ncells * sizeof(*x->x_ramps)); + matrix_ramp(x, MATRIX_DEFRAMP); + x->x_coefs = getbytes(x->x_ncells * sizeof(*x->x_coefs)); + for (i = 0; i < x->x_ncells; i++) + x->x_coefs[i] = 0.; + x->x_ksr = sys_getsr() * .001; + x->x_incrs = getbytes(x->x_ncells * sizeof(*x->x_incrs)); + x->x_bigincrs = getbytes(x->x_ncells * sizeof(*x->x_bigincrs)); + x->x_remains = getbytes(x->x_ncells * sizeof(*x->x_remains)); + for (i = 0; i < x->x_ncells; i++) + x->x_remains[i] = 0; } else { - t_matrix *x = (t_matrix *)pd_new(matrix_class); - int i; - if (av[0].a_type == A_FLOAT) - { - if ((x->x_ninlets = (int)av[0].a_w.w_float) < 1) - x->x_ninlets = 1; - } - else x->x_ninlets = 1; /* CHECKED */ - if (av[1].a_type == A_FLOAT) - { - if ((x->x_noutlets = (int)av[1].a_w.w_float) < 1) - x->x_noutlets = 1; - } - else x->x_noutlets = 1; /* CHECKED */ - x->x_ncells = x->x_ninlets * x->x_noutlets; - x->x_ivecs = getbytes(x->x_ninlets * sizeof(*x->x_ivecs)); - x->x_ovecs = getbytes(x->x_noutlets * sizeof(*x->x_ovecs)); - x->x_nblock = x->x_maxblock = sys_getblksize(); - x->x_osums = getbytes(x->x_noutlets * sizeof(*x->x_osums)); - for (i = 0; i < x->x_noutlets; i++) - x->x_osums[i] = getbytes(x->x_maxblock * sizeof(*x->x_osums[i])); - x->x_cells = getbytes(x->x_ncells * sizeof(*x->x_cells)); - matrix_clear(x); - if (ac >= 3) - { - if (av[2].a_type == A_FLOAT) - x->x_defgain = av[2].a_w.w_float; - else - x->x_defgain = MATRIX_DEFGAIN; - x->x_gains = getbytes(x->x_ncells * sizeof(*x->x_gains)); - for (i = 0; i < x->x_ncells; i++) - x->x_gains[i] = x->x_defgain; - x->x_ramps = getbytes(x->x_ncells * sizeof(*x->x_ramps)); - matrix_ramp(x, MATRIX_DEFRAMP); - x->x_coefs = getbytes(x->x_ncells * sizeof(*x->x_coefs)); - for (i = 0; i < x->x_ncells; i++) - x->x_coefs[i] = 0.; - x->x_ksr = sys_getsr() * .001; - x->x_incrs = getbytes(x->x_ncells * sizeof(*x->x_incrs)); - x->x_bigincrs = getbytes(x->x_ncells * sizeof(*x->x_bigincrs)); - x->x_remains = getbytes(x->x_ncells * sizeof(*x->x_remains)); - for (i = 0; i < x->x_ncells; i++) - x->x_remains[i] = 0; - } - else - { - x->x_gains = 0; - x->x_ramps = 0; - x->x_coefs = 0; - x->x_incrs = 0; - x->x_bigincrs = 0; - x->x_remains = 0; - } - for (i = 1; i < x->x_ninlets; i++) - sic_newinlet((t_sic *)x, 0.); - for (i = 0; i < x->x_noutlets; i++) - outlet_new((t_object *)x, &s_signal); - x->x_dumpout = outlet_new((t_object *)x, &s_list); - return (x); + x->x_gains = 0; + x->x_ramps = 0; + x->x_coefs = 0; + x->x_incrs = 0; + x->x_bigincrs = 0; + x->x_remains = 0; } + for (i = 1; i < x->x_ninlets; i++) + sic_newinlet((t_sic *)x, 0.); + for (i = 0; i < x->x_noutlets; i++) + outlet_new((t_object *)x, &s_signal); + x->x_dumpout = outlet_new((t_object *)x, &s_list); + return (x); } void matrix_tilde_setup(void)