From: Paul Brossier Date: Fri, 30 Sep 2016 12:47:35 +0000 (+0200) Subject: src/aubiopitch~.c: creation fails if first argument is not a symbol, simplify debug... X-Git-Url: https://git.aubio.org/?p=pd-aubio.git;a=commitdiff_plain;h=a13481b85abea158c159730edf9a07df0021c7ed src/aubiopitch~.c: creation fails if first argument is not a symbol, simplify debug output --- diff --git a/src/aubiopitch~.c b/src/aubiopitch~.c index e64d440..773d6a1 100644 --- a/src/aubiopitch~.c +++ b/src/aubiopitch~.c @@ -71,11 +71,9 @@ static void aubiopitch_tilde_tolerance(t_aubiopitch_tilde *x, t_floatarg a) static void aubiopitch_tilde_debug(t_aubiopitch_tilde *x) { - post(aubiopitch_version); - post("aubiopitch~ method:\t%s", x->method); - post("aubiopitch~ bufsize:\t%d", x->bufsize); - post("aubiopitch~ hopsize:\t%d", x->hopsize); - post("aubiopitch~ tolerance:\t%f", aubio_pitch_get_tolerance(x->o)); + smpl_t tolerance = aubio_pitch_get_tolerance(x->o); + post("%s method: %s tolerance: %.3f bufsize: %d hopsize: %d", + aubiopitch_version, x->method, tolerance, x->bufsize, x->hopsize); } static void *aubiopitch_tilde_new (t_symbol * s, int argc, t_atom *argv) @@ -104,7 +102,12 @@ static void *aubiopitch_tilde_new (t_symbol * s, int argc, t_atom *argv) } if (argc == 1) { - x->method = argv[0].a_w.w_symbol->s_name; + if (argv[0].a_type == A_SYMBOL) { + x->method = argv[0].a_w.w_symbol->s_name; + } else { + post("aubiopitch~: first argument should be a symbol"); + return NULL; + } } x->o = new_aubio_pitch(x->method, x->bufsize, x->hopsize,