shithub: leaf

Download patch

ref: 6e63ff953faee4cf27d626eb0d7dcc5b1410fb91
parent: c1f26969a63aa309b5cf9f6ca36ecef30b26f7e4
author: spiricom <jeff@snyderphonics.com>
date: Mon Mar 30 19:35:38 EDT 2020

fixed frequency calculation in tRetune

binary files a/.DS_Store b/.DS_Store differ
binary files a/LEAF/.DS_Store b/LEAF/.DS_Store differ
--- a/LEAF/Src/leaf-analysis.c
+++ b/LEAF/Src/leaf-analysis.c
@@ -609,7 +609,7 @@
     int n, tindex = s->timeindex;
     int framesize = s->framesize;
     int mask = framesize - 1;
-    float norm = 1. / sqrt((float)(framesize * 2));
+    float norm = 1.0f / sqrtf((float)(framesize * 2));
     
     float *inputbuf = s->inputbuf;
     float *processbuf = s->processbuf;
--- a/LEAF/Src/leaf-effects.c
+++ b/LEAF/Src/leaf-effects.c
@@ -1209,7 +1209,7 @@
 {
     _tRetune* r = *rt;
     
-    return r->inputPeriod;
+    return (r->inputPeriod * leaf.invSampleRate);
 }
 
 float tRetune_getInputFreq(tRetune* const rt)
@@ -1216,7 +1216,7 @@
 {
     _tRetune* r = *rt;
     
-    return 1.0f/r->inputPeriod;
+    return 1.0f/(r->inputPeriod * leaf.invSampleRate);
 }
 
 //============================================================================================================