From 9e63d554127ef98d9155666cf4ce486193a5a539 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Tue, 11 Mar 2014 19:27:30 +0000 Subject: Set *result to note value in xtract_midicent(). Fixes bug. --- src/scalar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/scalar.c b/src/scalar.c index 0e3578f..37ea579 100644 --- a/src/scalar.c +++ b/src/scalar.c @@ -987,7 +987,7 @@ int xtract_midicent(const double *data, const int N, const void *argv, double *r { double f0 = *(double *)argv; double note = 0.0; - + note = 69 + log(f0 / 440.f) * 17.31234; note *= 100; note = round(note); @@ -997,6 +997,8 @@ int xtract_midicent(const double *data, const int N, const void *argv, double *r return XTRACT_ARGUMENT_ERROR; } + *result = note; + return XTRACT_SUCCESS; } -- cgit v1.2.3