aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJamie Bullock <jamie@jamiebullock.com>2013-05-31 22:44:03 +0100
committerJamie Bullock <jamie@jamiebullock.com>2013-05-31 22:50:18 +0100
commit7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43 (patch)
tree50afdbdeca49923cff79c3ac634baaf159c88143 /examples
parent962c5fe017b588f59b21585c847ef6b67898cbf7 (diff)
downloadLibXtract-7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43.tar.gz
LibXtract-7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43.tar.bz2
LibXtract-7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43.zip
Add wavelet-based pitch tracker
Diffstat (limited to 'examples')
-rw-r--r--examples/puredata/simple-test.pd11
-rw-r--r--examples/puredata/xtract~.c13
2 files changed, 12 insertions, 12 deletions
diff --git a/examples/puredata/simple-test.pd b/examples/puredata/simple-test.pd
index f9bd79c..dce728c 100644
--- a/examples/puredata/simple-test.pd
+++ b/examples/puredata/simple-test.pd
@@ -1,11 +1,8 @@
#N canvas 642 248 670 289 10;
#X obj 192 63 osc~ 440;
#X floatatom 194 187 10 0 0 0 - - -;
-#X obj 194 150 xtract~ spectral_mean;
#X obj 193 94 *~ 0.3;
-#X text 337 121 Optional second argument gives blocksize;
-#X obj 193 121 xtract~ spectrum 64;
-#X connect 0 0 3 0;
-#X connect 2 0 1 0;
-#X connect 3 0 5 0;
-#X connect 5 0 2 0;
+#X obj 193 137 xtract~ f0;
+#X connect 0 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
diff --git a/examples/puredata/xtract~.c b/examples/puredata/xtract~.c
index 8ec1c15..a7f7325 100644
--- a/examples/puredata/xtract~.c
+++ b/examples/puredata/xtract~.c
@@ -72,7 +72,7 @@ static t_int *xtract_perform(t_int *w) {
t_int rv = 0;
double result = 0.0;
- for(n = 0; n < N; ++n) {
+ for(t_int n = 0; n < N; ++n) {
x->data[n] = (double)in[n];
}
@@ -148,7 +148,7 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) {
t_int n, N, M, f, F,
n_args,
type;
- t_float *argv_max;
+ double *argv_max;
t_symbol *arg1;
xtract_function_descriptor_t *fd;
char *p_name,
@@ -259,7 +259,7 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) {
if(x->is_subframe)
N = M;
- post("xtract~: window size: %d", N);
+ post("xtract~: assumed window size: %d", N);
/* do init if needed */
if(x->feature == XTRACT_MFCC){
@@ -271,9 +271,9 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) {
post("xtract~: mfcc: filters = %d",
((xtract_mel_filter *)x->argv)->n_filters);
mf->filters =
- (t_float **)getbytes(mf->n_filters * sizeof(t_float *));
+ (double **)getbytes(mf->n_filters * sizeof(double *));
for(n = 0; n < mf->n_filters; n++)
- mf->filters[n] = (float *)getbytes(N * sizeof(float));
+ mf->filters[n] = (double *)getbytes(N * sizeof(double));
xtract_init_mfcc(N, NYQUIST, XTRACT_EQUAL_GAIN, 80.0f,
18000.0f, mf->n_filters, mf->filters);
@@ -288,6 +288,9 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) {
x->argv = x->window;
x->done_init = 1;
}
+ else if(x->feature == XTRACT_WAVELET_F0){
+ xtract_init_wavelet_f0_state();
+ }
/* Initialise fft_plan if required */
if(x->feature == XTRACT_AUTOCORRELATION_FFT ||