diff --git a/externals/unauthorized/blinkenlights.c b/externals/unauthorized/blinkenlights.c index 312639b79f5bdb2ee5103e774c70be4ed44bc7b7..0fbed35e388fba34f7f6471eeee8cef8baf6d7e0 100644 --- a/externals/unauthorized/blinkenlights.c +++ b/externals/unauthorized/blinkenlights.c @@ -159,23 +159,27 @@ static void *blinkenlights_new(t_float fwidth, t_float fheight, t_float fxpixsiz t_blinkenlights *x = (t_blinkenlights *)pd_new(blinkenlights_class); if ( fwidth <= 0 ) { - post( "blinkenlights: wrong creation argument : width : %f", fwidth ); - return NULL; + post( "blinkenlights: warning: 1st argument (width) is " + "too small : defaulting to 1" ); + fwidth = 1.; } if ( fheight <= 0 ) { - post( "blinkenlights: wrong creation argument : height : %f", fheight ); - return NULL; + post( "blinkenlights: warning: 2nd argument (height) is too " + "small : defaulting to 1" ); + fheight = 1.; } if ( fxpixsize <= 0 ) { - post( "blinkenlights: wrong creation argument : x pixel size : %f", fxpixsize ); - return NULL; + post( "blinkenlights: warning 3rd argument (x pixel size) is too " + " small : defaulting to 1" ); + fxpixsize = 1.; } if ( fypixsize <= 0 ) { - post( "blinkenlights: wrong creation argument : y pixel size : %f", fypixsize ); - return NULL; + post( "blinkenlights: warning 4th argument (y pixel size) is too " + "small : defaulting to 1" ); + fypixsize = 1.; } x->x_width = (int) fwidth; x->x_height = (int) fheight; diff --git a/externals/unauthorized/formant~.c b/externals/unauthorized/formant~.c index 10fbe005bbe476baf9b4e438333db4039061a0ec..5ef3b5ef6d780ad44f70f67cb5c244ae3f3d80ac 100644 --- a/externals/unauthorized/formant~.c +++ b/externals/unauthorized/formant~.c @@ -229,8 +229,27 @@ static void *formant_new(t_floatarg fsize, t_floatarg ffreq, t_floatarg ffwidth, if ( fsize <= 0 || ffreq <= 0 || ffwidth <= 0 || fswidth <= 0 ) { - error( "formant~ : missing or negative creation arguments" ); - return NULL; + error( "formant~ : warning: missing or negative creation arguments" ); + if (fsize <= 0) + { + post ("first argument defaulting to 1"); + fsize = 1; + } + if (ffreq <= 0) + { + post ("first argument defaulting to 1"); + ffreq = 1; + } + if (ffwidth <= 0) + { + post ("first argument defaulting to 1"); + ffwidth = 1; + } + if (fswidth <= 0) + { + post ("first argument defaulting to 1"); + fswidth = 1; + } } x->x_size = fsize; diff --git a/externals/unauthorized/randomblock~.c b/externals/unauthorized/randomblock~.c index a8940d2c36df6e473cf9ec97e6751eb3f9c3b61c..002876e454e51a177dd10a284b501cd8c564a6bd 100644 --- a/externals/unauthorized/randomblock~.c +++ b/externals/unauthorized/randomblock~.c @@ -62,10 +62,16 @@ static void *randomblock_new(t_float flimit) t_randomblock *x = (t_randomblock *)pd_new(randomblock_class); outlet_new(&x->x_obj, &s_signal); inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("limit")); - if ( flimit <= 0 || flimit > RAND_MAX ) + if ( flimit <= 0 ) { - post( "randomblock~: wrong creation argument" ); - return NULL; + post( "randomblock~: warning : argument too small : defaulting to 1" ); + flimit = 1; + } + else if ( flimit > RAND_MAX ) + { + post( "randomblock~: warning : argument too large : defaulting to %d", + RAND_MAX ); + flimit = (t_float)RAND_MAX; } x->x_limit = (int) flimit; return(x); diff --git a/externals/unauthorized/samplebox~.c b/externals/unauthorized/samplebox~.c index 1c5a59afbea9cf6768aacc97b85624ec2e5c65ac..e0769976b90ea81602b1c160d381fcf339ce7bac 100644 --- a/externals/unauthorized/samplebox~.c +++ b/externals/unauthorized/samplebox~.c @@ -546,8 +546,9 @@ static void *samplebox_new(t_floatarg fsize) if ( fsize <= 0 ) { - error( "samplebox~ : missing or negative creation arguments" ); - return NULL; + error( "samplebox~ : warning : creation argument too small : " + "defaulting to 1" ); + fsize = 1.; } x->x_size = fsize; diff --git a/externals/unauthorized/sonogram~.c b/externals/unauthorized/sonogram~.c index a854bef9edfa868d56fb32c829e293222e312f57..ca7bfb1a3ee027ed958b4112c6387586abe1368e 100644 --- a/externals/unauthorized/sonogram~.c +++ b/externals/unauthorized/sonogram~.c @@ -2200,8 +2200,23 @@ static void *sonogram_new(t_floatarg fsize, t_floatarg fgraphic, t_floatarg fpha if ( fsize <= 0 || ( fgraphic != 0 && fgraphic != 1 ) || ( fphaso != 0 && fphaso != 1 ) ) { - error( "sonogram~ : missing or negative creation arguments" ); - return NULL; + post( "sonogram~ : warning : creation arguments out of range" ); + if ( fsize <= 0 ) + { + post( "argument 1 defaulting to 1" ); + fsize = 1.; + } + if ( fgraphic != 0 && fgraphic != 1 ) + { + post( "argument 2 defaulting to 0" ); + fgraphic = 0.; + } + if ( fphaso != 0 && fphaso != 1 ) + { + post( "argument 3 defaulting to 0" ); + fphaso = 0.; + } + } // activate graphical callbacks