shithub: leaf

Download patch

ref: 196bc7b0bf3b1d2d03ab25bc45db57c202bb883b
parent: 53eedc9b3a3144d021559244c1d30f1fe2bae207
author: Matthew Wang <mjw7@princeton.edu>
date: Fri Dec 18 11:54:34 EST 2020

add config file; filling out docs

--- a/TestPlugin/LEAF.jucer
+++ b/TestPlugin/LEAF.jucer
@@ -76,6 +76,7 @@
         <FILE id="VTmuyj" name="leaf-tables.c" compile="1" resource="0" file="../leaf/Src/leaf-tables.c"/>
         <FILE id="HKEtqp" name="leaf.c" compile="1" resource="0" file="../leaf/Src/leaf.c"/>
       </GROUP>
+      <FILE id="a85MuA" name="leaf-config.h" compile="0" resource="0" file="../leaf/leaf-config.h"/>
       <FILE id="a1IWV9" name="leaf.cpp" compile="1" resource="0" file="../leaf/leaf.cpp"/>
       <FILE id="TzDyuj" name="leaf.h" compile="0" resource="0" file="../leaf/leaf.h"/>
     </GROUP>
--- a/leaf/Inc/leaf-analysis.h
+++ b/leaf/Inc/leaf-analysis.h
@@ -159,19 +159,19 @@
     /*!
      @defgroup tpowerfollower tPowerFollower
      @ingroup analysis
-     @brief Measure and output the power of an input signal.
+     @brief Measure and follow the power of an input signal using an exponential moving average of power.
      @{
      
      @fn void    tPowerFollower_init         (tPowerFollower* const, float factor, LEAF* const leaf)
      @brief Initialize a tPowerFollower to the default mempool of a LEAF instance.
      @param follower A pointer to the tPowerFollower to initialize.
-     @param factor
+     @param factor Smoothing factor of the moving average. 0.0-1.0, with a higher value discounting older inputs more quickly.
      @param leaf A pointer to the leaf instance.
      
      @fn void    tPowerFollower_initToPool   (tPowerFollower* const, float factor, tMempool* const)
      @brief Initialize a tPowerFollower to a specified mempool.
      @param follower A pointer to the tPowerFollower to initialize.
-     @param factor
+     @param factor Smoothing factor of the moving average. 0.0-1.0, with a higher value discounting older inputs more quickly.
      @param mempool A pointer to the tMempool to use.
      
      @fn void    tPowerFollower_free         (tPowerFollower* const)
@@ -179,17 +179,20 @@
      @param follower A pointer to the tPowerFollower to free.
      
      @fn float   tPowerFollower_tick         (tPowerFollower* const, float input)
-     @brief
+     @brief Pass a sample into the power follower and return the current power.
      @param follower A pointer to the relevant tPowerFollower.
      @param input The input sample
+     @return The current power.
      
-     @fn float   tPowerFollower_sample       (tPowerFollower* const)
-     @brief
+     @fn float   tPowerFollower_getPower       (tPowerFollower* const)
+     @brief Get the current power.
      @param follower A pointer to the relevant tPowerFollower.
+     @return The current power.
      
      @fn int     tPowerFollower_setFactor    (tPowerFollower* const, float factor)
-     @brief
+     @brief Set the smoothing factor for the moving average.
      @param follower A pointer to the relevant tPowerFollower.
+     @param factor Smoothing factor of the moving average. 0.0-1.0, with a higher value discounting older inputs more quickly.
      
      @} */
     
@@ -210,8 +213,8 @@
     void    tPowerFollower_free         (tPowerFollower* const);
     
     float   tPowerFollower_tick         (tPowerFollower* const, float input);
-    float   tPowerFollower_sample       (tPowerFollower* const);
-    int     tPowerFollower_setFactor    (tPowerFollower* const, float factor);
+    float   tPowerFollower_getPower     (tPowerFollower* const);
+    void    tPowerFollower_setFactor    (tPowerFollower* const, float factor);
     
     // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
     
@@ -248,7 +251,7 @@
      @fn void    tEnvPD_processBlock     (tEnvPD* const, float* in)
      @brief
      @param env
-     @param input
+     @param inputBlock
      
      @} */
     
@@ -338,7 +341,8 @@
      @fn int     tAttackDetection_detect         (tAttackDetection* const, float *in)
      @brief Find the largest transient in input block, return index of attack
      @param detection A pointer to the relevant tAttackDetection.
-     @param input
+     @param inputBlock
+     @return Index of the largest transient in the input.
      
      @} */
     
@@ -508,7 +512,6 @@
      @fn void    tPeriodDetection_free               (tPeriodDetection* const)
      @brief Free a tPeriodDetection from its mempool.
      @param detection A pointer to the tPeriodDetection to free.
-     @param
      
      @fn float   tPeriodDetection_tick               (tPeriodDetection* const, float sample)
      @brief
--- a/leaf/Inc/leaf-delay.h
+++ b/leaf/Inc/leaf-delay.h
@@ -56,10 +56,10 @@
      @brief
      @param delay A pointer to the relevant tDelay.
      
-     @fn int         tDelay_setDelay     (tDelay* const, uint32_t delay)
+     @fn void        tDelay_setDelay     (tDelay* const, uint32_t delay)
      @brief
      @param delay A pointer to the relevant tDelay.
-     @param delayLength
+     @param delayLength The new delay length in samples. Cannot be greater than the max delay length given on initialization.
      
      @fn uint32_t    tDelay_getDelay     (tDelay* const)
      @brief
@@ -125,7 +125,7 @@
     void        tDelay_free         (tDelay* const);
     
     void        tDelay_clear        (tDelay* const);
-    int         tDelay_setDelay     (tDelay* const, uint32_t delay);
+    void        tDelay_setDelay     (tDelay* const, uint32_t delay);
     uint32_t    tDelay_getDelay     (tDelay* const);
     void        tDelay_tapIn        (tDelay* const, float in, uint32_t tapDelay);
     float       tDelay_tapOut       (tDelay* const, uint32_t tapDelay);
@@ -167,7 +167,7 @@
      @fn void   tLinearDelay_setDelay    (tLinearDelay* const, float delay)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
-     @param delayLength
+     @param delayLength The new delay length in samples. Cannot be greater than the max delay length given on initialization.
      
      @fn float   tLinearDelay_getDelay    (tLinearDelay* const)
      @brief
@@ -177,34 +177,47 @@
      @fn void    tLinearDelay_tapIn       (tLinearDelay* const, float in, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @param input
+     @param position
      
      @fn float     tLinearDelay_tapOut      (tLinearDelay* const, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @param position
+     @return
      
      @fn float   tLinearDelay_addTo       (tLinearDelay* const, float value, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @param input
+     @param position
+     @return
      
      @fn float   tLinearDelay_tick        (tLinearDelay* const, float sample)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @param input
+     @return
      
      @fn void    tLinearDelay_tickIn      (tLinearDelay* const, float input)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @param input
      
      @fn float   tLinearDelay_tickOut     (tLinearDelay* const)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @return
      
      @fn float   tLinearDelay_getLastOut  (tLinearDelay* const)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @return
      
      @fn float   tLinearDelay_getLastIn   (tLinearDelay* const)
      @brief
      @param delay A pointer to the relevant tLinearDelay.
+     @return
      
      @} */
     
@@ -293,10 +306,10 @@
      @param delay A pointer to the relevant tHermiteDelay.
      @return
      
-     @fn int     tHermiteDelay_setDelay         (tHermiteDelay* const dl, float delay)
+     @fn void    tHermiteDelay_setDelay         (tHermiteDelay* const dl, float delay)
      @brief
      @param delay A pointer to the relevant tHermiteDelay.
-     @param delayLength
+     @param delayLength The new delay length in samples. Cannot be greater than the max delay length given on initialization.
      
      @fn float     tHermiteDelay_tapOut         (tHermiteDelay* const dl, uint32_t tapDelay)
      @brief
@@ -346,7 +359,6 @@
     
     typedef struct _tHermiteDelay
     {
-        
         tMempool mempool;
         
         float gain;
@@ -365,23 +377,23 @@
     
     typedef _tHermiteDelay* tHermiteDelay;
     
-    void       tHermiteDelay_init             (tHermiteDelay* const dl, float delay, uint32_t maxDelay, LEAF* const leaf);
-    void    tHermiteDelay_initToPool      (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp);
-    void     tHermiteDelay_free            (tHermiteDelay* const dl);
+    void    tHermiteDelay_init (tHermiteDelay* const dl, float delay, uint32_t maxDelay, LEAF* const leaf);
+    void    tHermiteDelay_initToPool (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp);
+    void    tHermiteDelay_free          (tHermiteDelay* const dl);
     
-    void    tHermiteDelay_clear            (tHermiteDelay* const dl);
-    float   tHermiteDelay_tick             (tHermiteDelay* const dl, float input);
-    void       tHermiteDelay_tickIn         (tHermiteDelay* const dl, float input);
-    float   tHermiteDelay_tickOut         (tHermiteDelay* const dl);
-    int     tHermiteDelay_setDelay         (tHermiteDelay* const dl, float delay);
-    float     tHermiteDelay_tapOut         (tHermiteDelay* const dl, uint32_t tapDelay);
-    void     tHermiteDelay_tapIn         (tHermiteDelay* const dl, float value, uint32_t tapDelay);
-    float     tHermiteDelay_addTo         (tHermiteDelay* const dl, float value, uint32_t tapDelay);
-    float   tHermiteDelay_getDelay         (tHermiteDelay* const dl);
-    float   tHermiteDelay_getLastOut     (tHermiteDelay* const dl);
+    void    tHermiteDelay_clear         (tHermiteDelay* const dl);
+    float   tHermiteDelay_tick          (tHermiteDelay* const dl, float input);
+    void    tHermiteDelay_tickIn        (tHermiteDelay* const dl, float input);
+    float   tHermiteDelay_tickOut       (tHermiteDelay* const dl);
+    void    tHermiteDelay_setDelay      (tHermiteDelay* const dl, float delay);
+    float   tHermiteDelay_tapOut        (tHermiteDelay* const dl, uint32_t tapDelay);
+    void    tHermiteDelay_tapIn         (tHermiteDelay* const dl, float value, uint32_t tapDelay);
+    float   tHermiteDelay_addTo         (tHermiteDelay* const dl, float value, uint32_t tapDelay);
+    float   tHermiteDelay_getDelay      (tHermiteDelay* const dl);
+    float   tHermiteDelay_getLastOut    (tHermiteDelay* const dl);
     float   tHermiteDelay_getLastIn     (tHermiteDelay* const dl);
-    void     tHermiteDelay_setGain         (tHermiteDelay* const dl, float gain);
-    float     tHermiteDelay_getGain         (tHermiteDelay* const dl);
+    void    tHermiteDelay_setGain       (tHermiteDelay* const dl, float gain);
+    float   tHermiteDelay_getGain       (tHermiteDelay* const dl);
     
     
     //==============================================================================
@@ -395,11 +407,15 @@
      @fn void    tAllpassDelay_init        (tAllpassDelay* const, float delay, uint32_t maxDelay, LEAF* const leaf)
      @brief Initialize a tAllpassDelay to the default mempool of a LEAF instance.
      @param delay A pointer to the tAllpassDelay to initialize.
+     @param initialLength
+     @param maxLength
      @param leaf A pointer to the leaf instance.
      
      @fn void    tAllpassDelay_initToPool  (tAllpassDelay* const, float delay, uint32_t maxDelay, tMempool* const)
      @brief Initialize a tAllpassDelay to a specified mempool.
      @param delay A pointer to the tAllpassDelay to initialize.
+     @param initialLength
+     @param maxLength
      @param mempool A pointer to the tMempool to use.
      
      @fn void    tAllpassDelay_free        (tAllpassDelay* const)
@@ -410,43 +426,55 @@
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
      
-     @fn int     tAllpassDelay_setDelay    (tAllpassDelay* const, float delay)
+     @fn void    tAllpassDelay_setDelay    (tAllpassDelay* const, float delay)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @param delayLength The new delay length in samples. Cannot be greater than the max delay length given on initialization.
      
      @fn float   tAllpassDelay_getDelay    (tAllpassDelay* const)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @return The current delay length in samples.
      
      @fn void    tAllpassDelay_tapIn       (tAllpassDelay* const, float in, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @param inptu
+     @param position
      
      @fn float   tAllpassDelay_tapOut      (tAllpassDelay* const, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @param position
+     @return
      
      @fn float   tAllpassDelay_addTo       (tAllpassDelay* const, float value, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @param input
+     @param position
+     @return
      
      @fn float   tAllpassDelay_tick        (tAllpassDelay* const, float sample)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @param input
+     @return
      
      @fn float   tAllpassDelay_getLastOut  (tAllpassDelay* const)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @return
      
      @fn float   tAllpassDelay_getLastIn   (tAllpassDelay* const)
      @brief
      @param delay A pointer to the relevant tAllpassDelay.
+     @return
      
      @} */
     
     typedef struct _tAllpassDelay
     {
-        
         tMempool mempool;
         
         float gain;
@@ -473,7 +501,7 @@
     void    tAllpassDelay_free        (tAllpassDelay* const);
     
     void    tAllpassDelay_clear       (tAllpassDelay* const);
-    int     tAllpassDelay_setDelay    (tAllpassDelay* const, float delay);
+    void    tAllpassDelay_setDelay    (tAllpassDelay* const, float delay);
     float   tAllpassDelay_getDelay    (tAllpassDelay* const);
     void    tAllpassDelay_tapIn       (tAllpassDelay* const, float in, uint32_t tapDelay);
     float   tAllpassDelay_tapOut      (tAllpassDelay* const, uint32_t tapDelay);
@@ -493,11 +521,15 @@
      @fn void    tTapeDelay_init        (tTapeDelay* const, float delay, uint32_t maxDelay, LEAF* const leaf)
      @brief Initialize a tTapeDelay to the default mempool of a LEAF instance.
      @param delay A pointer to the tTapeDelay to initialize.
+     @param initialLength
+     @param maxLength
      @param leaf A pointer to the leaf instance.
      
      @fn void    tTapeDelay_initToPool  (tTapeDelay* const, float delay, uint32_t maxDelay, tMempool* const)
      @brief Initialize a tTapeDelay to a specified mempool.
      @param delay A pointer to the tTapeDelay to initialize.
+     @param initialLength
+     @param maxLength
      @param mempool A pointer to the tMempool to use.
      
      @fn void    tTapeDelay_free        (tTapeDelay* const)
@@ -511,26 +543,37 @@
      @fn void    tTapeDelay_setDelay    (tTapeDelay* const, float delay)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @param delayLength The new delay length in samples. Cannot be greater than the max delay length given on initialization.
      
      @fn float   tTapeDelay_getDelay    (tTapeDelay* const)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @return
      
      @fn void    tTapeDelay_tapIn       (tTapeDelay* const, float in, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @param input
+     @param position
      
      @fn float   tTapeDelay_tapOut      (tTapeDelay* const d, float tapDelay)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @param position
+     @return
      
      @fn float   tTapeDelay_addTo       (tTapeDelay* const, float value, uint32_t tapDelay)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @param input
+     @param position
+     @return
      
      @fn float   tTapeDelay_tick        (tTapeDelay* const, float sample)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @param input
+     @return
      
      @fn void    tTapeDelay_incrementInPoint(tTapeDelay* const dl)
      @brief
@@ -539,10 +582,12 @@
      @fn float   tTapeDelay_getLastOut  (tTapeDelay* const)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @return
      
      @fn float   tTapeDelay_getLastIn   (tTapeDelay* const)
      @brief
      @param delay A pointer to the relevant tTapeDelay.
+     @return
      
      @} */
     
@@ -592,41 +637,45 @@
      
      @fn void    tRingBuffer_init     (tRingBuffer* const ring, int size, LEAF* const leaf)
      @brief Initialize a tRingBuffer to the default mempool of a LEAF instance.
-     @param delay A pointer to the tRingbuffer to initialize.
+     @param buffer A pointer to the tRingbuffer to initialize.
+     @param size Size of the buffer. Should be a power of 2. Will otherwise be adjusted to the nearest greater power of 2.
      @param leaf A pointer to the leaf instance.
      
      @fn void    tRingBuffer_initToPool   (tRingBuffer* const ring, int size, tMempool* const mempool)
      @brief Initialize a tRingBuffer to a specified mempool.
-     @param delay A pointer to the tRingbuffer to initialize.
+     @param buffer A pointer to the tRingbuffer to initialize.
+     @param size Size of the buffer. Should be a power of 2. Will otherwise be adjusted to the nearest greater power of 2.
      @param mempool A pointer to the tMempool to use.
      
      @fn void    tRingBuffer_free     (tRingBuffer* const ring)
      @brief Free a tRingBuffer from its mempool.
-     @param delay A pointer to the tRingBuffer to free.
+     @param buffer A pointer to the tRingBuffer to free.
      
      @fn void    tRingBuffer_push     (tRingBuffer* const ring, float val)
-     @brief
-     @param delay A pointer to the relevant tRingBuffer.
+     @brief Push a value to the ring buffer, overwriting the oldest value if the buffer is full.
+     @param buffer A pointer to the relevant tRingBuffer.
+     @param input The value to push to the buffer.
      
      @fn float   tRingBuffer_getNewest    (tRingBuffer* const ring)
-     @brief
-     @param delay A pointer to the relevant tRingBuffer.
+     @brief Get the newest value in the ring buffer.
+     @param buffer A pointer to the relevant tRingBuffer.
+     @return The newest value in the ring buffer.
      
      @fn float   tRingBuffer_getOldest    (tRingBuffer* const ring)
-     @brief
-     @param delay A pointer to the relevant tRingBuffer.
+     @brief Get the oldest value in the ring buffer.
+     @param buffer A pointer to the relevant tRingBuffer.
+     @return The oldest value in the ring buffer.
      
      @fn float   tRingBuffer_get      (tRingBuffer* const ring, int index)
-     @brief
-     @param delay A pointer to the relevant tRingBuffer.
-     
-     @fn float   tRingBuffer_clear    (tRingBuffer* const ring)
-     @brief
-     @param delay A pointer to the relevant tRingBuffer.
-     
+     @brief Get the value at an index of the buffer.
+     @param buffer A pointer to the relevant tRingBuffer.
+     @param index The index to access.
+     @return The value at the given index.
+
      @fn int     tRingBuffer_getSize  (tRingBuffer* const ring)
-     @brief
-     @param delay A pointer to the relevant tRingBuffer.
+     @brief Get the size of the ring buffer.
+     @param buffer A pointer to the relevant tRingBuffer.
+     @return The size of the buffer.
      
      @} */
     typedef struct _tRingBuffer
@@ -650,7 +699,6 @@
     float   tRingBuffer_getNewest    (tRingBuffer* const ring);
     float   tRingBuffer_getOldest    (tRingBuffer* const ring);
     float   tRingBuffer_get      (tRingBuffer* const ring, int index);
-    float   tRingBuffer_clear    (tRingBuffer* const ring);
     int     tRingBuffer_getSize  (tRingBuffer* const ring);
     
 #ifdef __cplusplus
--- a/leaf/Src/leaf-analysis.c
+++ b/leaf/Src/leaf-analysis.c
@@ -196,7 +196,7 @@
     mpool_free((char*)p, p->mempool);
 }
 
-int     tPowerFollower_setFactor(tPowerFollower* const pf, float factor)
+void tPowerFollower_setFactor(tPowerFollower* const pf, float factor)
 {
     _tPowerFollower* p = *pf;
     
@@ -207,7 +207,7 @@
     return 0;
 }
 
-float   tPowerFollower_tick(tPowerFollower* const pf, float input)
+float tPowerFollower_tick(tPowerFollower* const pf, float input)
 {
     _tPowerFollower* p = *pf;
     p->curr = p->factor*input*input+p->oneminusfactor*p->curr;
@@ -214,7 +214,7 @@
     return p->curr;
 }
 
-float   tPowerFollower_sample(tPowerFollower* const pf)
+float tPowerFollower_getPower(tPowerFollower* const pf)
 {
     _tPowerFollower* p = *pf;
     return p->curr;
--- a/leaf/Src/leaf-delay.c
+++ b/leaf/Src/leaf-delay.c
@@ -80,7 +80,7 @@
     return d->lastOut;
 }
 
-int     tDelay_setDelay (tDelay* const dl, uint32_t delay)
+void     tDelay_setDelay (tDelay* const dl, uint32_t delay)
 {
     _tDelay* d = *dl;
 
@@ -454,7 +454,7 @@
     return d->lastOut;
 }
 
-int     tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay)
+void tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay)
 {
     _tHermiteDelay* d = *dl;
 
@@ -471,8 +471,6 @@
     d->omAlpha = 1.0f - d->alpha;
 
     if ( d->outPoint == d->maxDelay ) d->outPoint = 0;
-
-    return 0;
 }
 
 float tHermiteDelay_tapOut (tHermiteDelay* const dl, uint32_t tapDelay)
@@ -620,7 +618,7 @@
     return d->lastOut;
 }
 
-int     tAllpassDelay_setDelay (tAllpassDelay* const dl, float delay)
+void     tAllpassDelay_setDelay (tAllpassDelay* const dl, float delay)
 {
     _tAllpassDelay* d = *dl;
 
--- a/leaf/Src/leaf-distortion.c
+++ b/leaf/Src/leaf-distortion.c
@@ -22,7 +22,6 @@
 // Sample-Rate reducer
 //============================================================================================================
 
-
 void tSampleReducer_init (tSampleReducer* const sr, LEAF* const leaf)
 {
     tSampleReducer_initToPool(sr, &leaf->mempool);
@@ -68,6 +67,7 @@
     
 }
 
+#if LEAF_INCLUDE_TABLES
 //============================================================================================================
 // Oversampler
 //============================================================================================================
@@ -303,6 +303,7 @@
     _tOversampler* os = *osr;
     return os->phaseLength;
 }
+#endif
 
 //============================================================================================================
 // WAVEFOLDER
--- a/leaf/Src/leaf-envelopes.c
+++ b/leaf/Src/leaf-envelopes.c
@@ -23,6 +23,7 @@
 
 #endif
 
+#if LEAF_INCLUDE_TABLES
 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Envelope ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ //
 void    tEnvelope_init(tEnvelope* const envlp, float attack, float decay, int loop, LEAF* const leaf)
 {
@@ -211,9 +212,9 @@
     
     return env->next;
 }
+#endif
 
-
-
+#if LEAF_INCLUDE_TABLES
 /* ADSR */
 void    tADSR_init(tADSR* const adsrenv, float attack, float decay, float sustain, float release, LEAF* const leaf)
 {
@@ -482,7 +483,7 @@
 
     return adsr->next;
 }
-
+#endif
 
 
 
--- a/leaf/Src/leaf-filters.c
+++ b/leaf/Src/leaf-filters.c
@@ -900,6 +900,7 @@
     svf->a3 = svf->g * svf->a2;
 }
 
+#if LEAF_INCLUDE_TABLES
 // Efficient version of tSVF where frequency is set based on 12-bit integer input for lookup in tanh wavetable.
 void   tEfficientSVF_init(tEfficientSVF* const svff, SVFType type, uint16_t input, float Q, LEAF* const leaf)
 {
@@ -970,6 +971,7 @@
     svf->a2 = svf->g * svf->a1;
     svf->a3 = svf->g * svf->a2;
 }
+#endif
 
 /* Highpass */
 void    tHighpass_init(tHighpass* const ft, float freq, LEAF* const leaf)
--- a/leaf/Src/leaf-math.c
+++ b/leaf/Src/leaf-math.c
@@ -827,11 +827,9 @@
     return fmax(fmin(a, b), fmin(fmax(a, b), c));
 }
 
+#if LEAF_INCLUDE_MINBLEP
 /// MINBLEPS
-
 // https://github.com/MrBlueXav/Dekrispator_v2 blepvco.c
-
-
 void place_step_dd(float *buffer, int index, float phase, float w, float scale)
 {
     float r;
@@ -874,3 +872,4 @@
         index++;
     }
 }
+#endif
--- a/leaf/Src/leaf-oscillators.c
+++ b/leaf/Src/leaf-oscillators.c
@@ -86,6 +86,7 @@
     c->inc = c->freq * leaf->invSampleRate;
 }
 
+#if LEAF_INCLUDE_TABLES
 // Cycle
 void    tCycle_init(tCycle* const cy, LEAF* const leaf)
 {
@@ -155,7 +156,9 @@
     
     c->inc = c->freq * leaf->invSampleRate;
 }
+#endif
 
+#if LEAF_INCLUDE_TABLES
 //========================================================================
 /* Triangle */
 void   tTriangle_init(tTriangle* const cy, LEAF* const leaf)
@@ -226,7 +229,9 @@
     
     c->inc = c->freq * leaf->invSampleRate;
 }
+#endif
 
+#if LEAF_INCLUDE_TABLES
 //========================================================================
 /* Square */
 void   tSquare_init(tSquare* const cy, LEAF* const leaf)
@@ -296,7 +301,9 @@
     
     c->inc = c->freq * leaf->invSampleRate;
 }
+#endif
 
+#if LEAF_INCLUDE_TABLES
 //=====================================================================
 // Sawtooth
 void    tSawtooth_init(tSawtooth* const cy, LEAF* const leaf)
@@ -366,6 +373,7 @@
     
     c->inc = c->freq * leaf->invSampleRate;
 }
+#endif
 
 //==============================================================================
 
--- a/leaf/Src/leaf-tables.c
+++ b/leaf/Src/leaf-tables.c
@@ -2,10 +2,13 @@
 
 #if _WIN32 || _WIN64
 
+#include "..\leaf-config.h"
 #include "..\Inc\leaf-tables.h"
 #include "..\Inc\leaf-global.h"
+
 #else
 
+#include "../leaf-config.h"
 #include "../Inc/leaf-tables.h"
 #include "../Inc/leaf-global.h"
 
@@ -14,6 +17,8 @@
 
 #include "stdlib.h"
 
+#if LEAF_INCLUDE_TABLES
+
 const float __leaf_table_fir2XLow[32] = { 0.001067048115027622,    -0.004557728776555209,    -0.016711590887520535,    -0.021065500881657994,    -0.003828695019946828,    0.01865935152799254,    0.012036365576553658,    -0.02064070362810112,    -0.02682399333687091,    0.017862623081258543,    0.0492716766870816,    -0.004310232755957251,    -0.08571879958189704,    -0.03828300159135686,    0.18420501161808442,    0.4054061613074031,    0.4054061613074031,    0.18420501161808442,    -0.03828300159135686,    -0.08571879958189704,    -0.004310232755957251,    0.0492716766870816,    0.017862623081258543,    -0.02682399333687091,    -0.02064070362810112,    0.012036365576553658,    0.01865935152799254,    -0.003828695019946828,    -0.021065500881657994,    -0.016711590887520535,    -0.004557728776555209,    0.001067048115027622
     
 };
@@ -14059,11 +14064,11 @@
 .916724f, -0.916715f, -0.916705f, -0.916695f,
 -0.916685f, -0.916676f, -0.916666f, -0.916656f, -0.916646f, -0.916637f, -0.916627f, -0.916617f, -0.916607f, -0.916598f, -0.916588f, -0.916578f, -0.916568f, -0.916559f, -0.916549f, -0.916539f, -0.916529f, -0.91652f, -0.91651f, -0.9165f,
 -0.91649f, -0.91648f, -0.916471f, -0.916461f, -0.916451f, -0.916441f, -0.916432f, -0.916422f, -0.916412f, -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
+6471f, -0.916461f, -0.916451f, -0.916441f, -0.916432f, -0.916422f, -0.916412f, -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
 6471f, -0.916461f, -0.916451f, -0.916441f, -0.916432f, -0.916422f, -0.916412f, -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
 -0.916295f, -0.916285f, -0.916275f, -0.916265f, -0.916256f, -0.916246f, -0.916236f, -0.916226f, -0.916216f, -0.916207f, -0.916197f, -0.916187f, -0.916177f, -0.916167f, -0.916157f, -0.916148f, -0.916138f, -0.916128f, -0.916118f, -0.916108f,
+6461f, -0.916451f, -0.916441f, -0.916432f, -0.916422f, -0.916412f, -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
 f, -0.916461f, -0.916451f, -0.916441f, -0.916432f, -0.916422f, -0.916412f, -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
-12f, -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
--0.916295f, -0.916285f, -0.916275f, -0.916265f, -0.916256f, -0.916246f, -0.916236f, -0.916226f, -0.916216f, -0.916207f, -0.916197f, -0.916187f, -0.916177f, -0.916167f, -0.916157f, -0.916148f, -0.916138f, -0.916128f, -0.916118f, -0.916108f,
  -0.916402f, -0.916393f, -0.916383f, -0.916373f, -0.916363f, -0.916353f, -0.916344f, -0.916334f, -0.916324f, -0.916314f, -0.916304f,
 -0.916295f, -0.916285f, -0.916275f, -0.916265f, -0.916256f, -0.916246f, -0.916236f, -0.916226f, -0.916216f, -0.916207f, -0.916197f, -0.916187f, -0.916177f, -0.916167f, -0.916157f, -0.916148f, -0.916138f, -0.916128f, -0.916118f, -0.916108f,
 -0.916099f, -0.916089f, -0.916079f, -0.916069f, -0.916059f, -0.91605f, -0.91604f, -0.91603f, -0.91602f, -0.91601f, -0.916f, -0.915991f, -0.915981f, -0.915971f, -0.915961f, -0.915951f, -0.915942f, -0.915932f, -0.915922f, -0.915912f,
@@ -15820,3 +15825,5 @@
 .445182f, -0.445133f, -0.445084f, -0.445035f, -0.444986f, -0.444938f, -0.444889f, -0.44484f, -0.444791f, -0.444742f, -0.444693f, -0.444644f, -0.444595f, -0.444546f, -0.444497f,
 -0.444448f, -0.444399f, -0.44435f, -0.444301f, -0.444252f, -0.444203f, -0.444154f, -0.444105f, -0.444056f, -0.444007f, -0.443958f, -0.443909f, -0.44386f, -0.443811f, -0.443762f, -0.443713f, -0.443664f, -0.443615f, -0.443566f, -0.443517f,
 -0.443468f, -0.443419f, -0.44337f, -0.443321f, -0.443272f, -0.443223f, -0.443173f, -0.443124f, -0.443075f, -0.443026f, -0.442977f, -0.442928f, -0.442879f, -0.44283f, -0.442781f, -0.442732f, -0.442683f, -0.442634f, -0.442585f, -0.442536f,
+44497f,
+-0.444448f, -0.444399f, -0.44435f, -0.444301f, -0.444252f, -0.444203f, -0.444154f, -0.444105f, -0.444056f, -0.444007f, -0.443958f, -0.443909f, -0.44386f, -0.443811f, -0.443762f, -0.443713f, -0.443664f, -0.443615f, -0.443566f, -0.443517f,
--- /dev/null
+++ b/leaf/leaf-config.h
@@ -1,0 +1,14 @@
+/*
+  ==============================================================================
+
+    leaf-config.h
+    Created: 18 Dec 2020 1:24:49pm
+    Author:  Matthew Wang
+
+  ==============================================================================
+*/
+
+#pragma once
+
+#define LEAF_INCLUDE_TABLES 0
+#define LEAF_INCLUDE_MINBLEP 0