projects
/
pd-aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
56cb96a
)
src/aubiopitch~.c: parse method, return NULL if new_aubio_pitch failed
author
Paul Brossier
<piem@piem.org>
Wed, 28 Sep 2016 00:17:35 +0000
(
02:17
+0200)
committer
Paul Brossier
<piem@piem.org>
Wed, 28 Sep 2016 00:17:35 +0000
(
02:17
+0200)
src/aubiopitch~.c
patch
|
blob
|
history
diff --git
a/src/aubiopitch~.c
b/src/aubiopitch~.c
index
1f188ca
..
4a9e4e8
100644
(file)
--- a/
src/aubiopitch~.c
+++ b/
src/aubiopitch~.c
@@
-24,6
+24,7
@@
typedef struct _aubiopitch_tilde
t_int pos; /*frames%dspblocksize*/
t_int bufsize;
t_int hopsize;
t_int pos; /*frames%dspblocksize*/
t_int bufsize;
t_int hopsize;
+ char_t *method;
aubio_pitch_t *o;
fvec_t *vec;
fvec_t *pitchvec;
aubio_pitch_t *o;
fvec_t *vec;
fvec_t *pitchvec;
@@
-75,9
+76,17
@@
static void *aubiopitch_tilde_new (t_symbol * s)
x->bufsize = 2048;
x->hopsize = x->bufsize / 2;
x->bufsize = 2048;
x->hopsize = x->bufsize / 2;
- x->o = new_aubio_pitch(s->s_name, x->bufsize,
- x->hopsize, (uint_t)sys_getsr() );
- aubio_pitch_set_tolerance (x->o, 0.7);
+ if (!*s->s_name) {
+ x->method = "default";
+ } else {
+ x->method = s->s_name;
+ }
+
+ x->o = new_aubio_pitch(x->method, x->bufsize, x->hopsize,
+ (uint_t)sys_getsr());
+
+ if (x->o == NULL) return NULL;
+
x->vec = (fvec_t *)new_fvec(x->hopsize);
x->pitchvec = (fvec_t *)new_fvec(1);
x->vec = (fvec_t *)new_fvec(x->hopsize);
x->pitchvec = (fvec_t *)new_fvec(1);