diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2014-03-11 19:27:30 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2014-03-11 19:27:30 +0000 |
commit | 9e63d554127ef98d9155666cf4ce486193a5a539 (patch) | |
tree | b9c5e19a1135329d459d9a30aab4dc51bfc3b92e /src | |
parent | 1a10aeb992d34128acd3ff049adb0ce2677fd2a2 (diff) | |
download | LibXtract-9e63d554127ef98d9155666cf4ce486193a5a539.tar.gz LibXtract-9e63d554127ef98d9155666cf4ce486193a5a539.tar.bz2 LibXtract-9e63d554127ef98d9155666cf4ce486193a5a539.zip |
Set *result to note value in xtract_midicent(). Fixes bug.
Diffstat (limited to 'src')
-rw-r--r-- | src/scalar.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |