shithub: leaf

Download patch

ref: 20802a8e9240feec34bdb80485380f8e0a572733
parent: d7ef6d68c8b7531dfa7ec0a07ad9ad28e8c188bf
author: mulshine <mulshine@princeton.edu>
date: Wed Dec 19 09:49:05 EST 2018

Fixed bug causing distortion with Triangle and Square oscillators.

--- a/LEAF/Src/leaf-oscillator.c
+++ b/LEAF/Src/leaf-oscillator.c
@@ -307,6 +307,7 @@
 {
     p->phase = 0.0f;
     p->inc = 0.0f;
+
 }
 
 void    tPhasor_free(tPhasor* const p)
@@ -450,6 +451,9 @@
 {
     c->inc      =  0.0f;
     c->phase    =  0.0f;
+    c->tsize     = 2048;
+
+    tTriangle_setTableSize(c, c->tsize);
 }
 
 void   tTriangle_free(tTriangle* const c)
@@ -575,6 +579,9 @@
 {
     c->inc      =  0.0f;
     c->phase    =  0.0f;
+    c->tsize     = 2048;
+
+    tSquare_setTableSize(c, c->tsize);
 }
 
 void   tSquare_free(tSquare* const c)