shithub: leaf

Download patch

ref: 3ffbba1467802e8ab1a05ef75ba17c3d4d0a50bf
parent: 3f2152fc708e39afd48f50d7761a8b21f2480451
author: Matthew Wang <mjw7@princeton.edu>
date: Wed May 27 14:57:49 EDT 2020

replace void* with char* and do explicit casts for pointers

binary files a/.DS_Store b/.DS_Store differ
--- a/LEAF/Inc/leaf-envelopes.h
+++ b/LEAF/Inc/leaf-envelopes.h
@@ -45,9 +45,9 @@
         
         float attackInc, decayInc, rampInc;
         
-        oBool inAttack, inDecay, inRamp;
+        int inAttack, inDecay, inRamp;
         
-        oBool loop;
+        int loop;
         
         float gain, rampPeak;
         
@@ -57,15 +57,15 @@
     
     typedef _tEnvelope* tEnvelope;
     
-    void    tEnvelope_init          (tEnvelope* const, float attack, float decay, oBool loop);
+    void    tEnvelope_init          (tEnvelope* const, float attack, float decay, int loop);
     void    tEnvelope_free          (tEnvelope* const);
-    void    tEnvelope_initToPool    (tEnvelope* const, float attack, float decay, oBool loop, tMempool* const);
+    void    tEnvelope_initToPool    (tEnvelope* const, float attack, float decay, int loop, tMempool* const);
     void    tEnvelope_freeFromPool  (tEnvelope* const, tMempool* const);
     
     float   tEnvelope_tick          (tEnvelope* const);
     void    tEnvelope_setAttack     (tEnvelope* const, float attack);
     void    tEnvelope_setDecay      (tEnvelope* const, float decay);
-    void    tEnvelope_loop          (tEnvelope* const, oBool loop);
+    void    tEnvelope_loop          (tEnvelope* const, int loop);
     void    tEnvelope_on            (tEnvelope* const, float velocity);
     
     // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
--- a/LEAF/Inc/leaf-instruments.h
+++ b/LEAF/Inc/leaf-instruments.h
@@ -44,7 +44,7 @@
         tHighpass highpass;
         float oscMix;
         float filterCutoff;
-        oBool useStick;
+        uint8_t useStick;
         
     } _t808Cowbell;
     
--- a/LEAF/Inc/leaf-mempool.h
+++ b/LEAF/Inc/leaf-mempool.h
@@ -63,7 +63,7 @@
     
     // node of free list
     typedef struct mpool_node_t {
-        void                *pool;     // memory pool field
+        char                *pool;     // memory pool field
         struct mpool_node_t *next;     // next node pointer
         struct mpool_node_t *prev;     // prev node pointer
         size_t size;
@@ -71,7 +71,7 @@
     
     typedef struct _tMempool
     {
-        void*         mpool;       // start of the mpool
+        char*         mpool;       // start of the mpool
         size_t        usize;       // used size of the pool
         size_t        msize;       // max size of the pool
         mpool_node_t* head;        // first node of memory pool free list
@@ -117,7 +117,7 @@
     //==============================================================================
 
     //    typedef struct mpool_t {
-    //        void*         mpool;       // start of the mpool
+    //        char*         mpool;       // start of the mpool
     //        size_t        usize;       // used size of the pool
     //        size_t        msize;       // max size of the pool
     //        mpool_node_t* head;        // first node of memory pool free list
@@ -125,10 +125,10 @@
     
     void mpool_create (char* memory, size_t size, _tMempool* pool);
     
-    void* mpool_alloc(size_t size, _tMempool* pool);
-    void* mpool_calloc(size_t asize, _tMempool* pool);
+    char* mpool_alloc(size_t size, _tMempool* pool);
+    char* mpool_calloc(size_t asize, _tMempool* pool);
     
-    void mpool_free(void* ptr, _tMempool* pool);
+    void mpool_free(char* ptr, _tMempool* pool);
     
     size_t mpool_get_size(_tMempool* pool);
     size_t mpool_get_used(_tMempool* pool);
@@ -135,15 +135,15 @@
     
     void leaf_pool_init(char* memory, size_t size);
     
-    void* leaf_alloc(size_t size);
-    void* leaf_calloc(size_t size);
+    char* leaf_alloc(size_t size);
+    char* leaf_calloc(size_t size);
     
-    void leaf_free(void* ptr);
+    void leaf_free(char* ptr);
     
     size_t leaf_pool_get_size(void);
     size_t leaf_pool_get_used(void);
     
-    void* leaf_pool_get_pool(void);
+    char* leaf_pool_get_pool(void);
     
     void leaf_mempool_overrun(void);
     
--- a/LEAF/Inc/leaf-oscillators.h
+++ b/LEAF/Inc/leaf-oscillators.h
@@ -98,7 +98,7 @@
         // Underlying phasor
         float phase;
         float inc,freq;
-        TableName oct;
+        int oct;
         float w;
     } _tTriangle;
     
@@ -166,7 +166,7 @@
         // Underlying phasor
         float phase;
         float inc,freq;
-        TableName oct;
+        int oct;
         float w;
     } _tSquare;
     
@@ -234,7 +234,7 @@
         // Underlying phasor
         float phase;
         float inc,freq;
-        TableName oct;
+        int oct;
         float w;
     } _tSawtooth;
     
--- a/LEAF/Inc/leaf-tables.h
+++ b/LEAF/Inc/leaf-tables.h
@@ -19,7 +19,11 @@
 
 //==============================================================================
 
-
+#define USE_SAWTOOTH_TABLE 1
+#define USE_SQUARE_TABLE 1
+#define USE_TRIANGLE_TABLE 1
+#define USE_SHAPER_TABLE 1
+    
 #define SINE_TABLE_SIZE 2048
 #define SAW_TABLE_SIZE 2048
 #define SQR_TABLE_SIZE 2048
--- a/LEAF/Src/leaf-analysis.c
+++ b/LEAF/Src/leaf-analysis.c
@@ -35,7 +35,7 @@
 {
     _tEnvelopeFollower* e = *ef;
     
-    leaf_free(e);
+    leaf_free((char*)e);
 }
 
 void    tEnvelopeFollower_initToPool    (tEnvelopeFollower* const ef, float attackThreshold, float decayCoeff, tMempool* const mp)
@@ -53,7 +53,7 @@
     _tMempool* m = *mp;
     _tEnvelopeFollower* e = *ef;
     
-    mpool_free(e, m);
+    mpool_free((char*)e, m);
 }
 
 float   tEnvelopeFollower_tick(tEnvelopeFollower* const ef, float x)
@@ -118,9 +118,9 @@
 {
     _tMempool* m = *mp;
     _tZeroCrossing* z = *zc;
-    mpool_free(z->inBuffer, m);
-    mpool_free(z->countBuffer, m);
-    mpool_free(z, m);
+    mpool_free((char*)z->inBuffer, m);
+    mpool_free((char*)z->countBuffer, m);
+    mpool_free((char*)z, m);
 }
 
 //returns proportion of zero crossings within window size (0.0 would be none in window, 1.0 would be all zero crossings)
@@ -197,7 +197,7 @@
 {
     _tPowerFollower* p = *pf;
     
-    leaf_free(p);
+    leaf_free((char*)p);
 }
 
 void    tPowerFollower_initToPool   (tPowerFollower* const pf, float factor, tMempool* const mp)
@@ -215,7 +215,7 @@
     _tMempool* m = *mp;
     _tPowerFollower* p = *pf;
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 int     tPowerFollower_setFactor(tPowerFollower* const pf, float factor)
@@ -295,7 +295,7 @@
 {
     _tEnvPD* x = *xpd;
     
-    leaf_free(x);
+    leaf_free((char*)x);
 }
 
 void    tEnvPD_initToPool       (tEnvPD* const xpd, int ws, int hs, int bs, tMempool* const mp)
@@ -346,7 +346,7 @@
     _tMempool* m = *mp;
     _tEnvPD* x = *xpd;
     
-    mpool_free(x, m);
+    mpool_free((char*)x, m);
 }
 
 float tEnvPD_tick (tEnvPD* const xpd)
@@ -412,7 +412,7 @@
 {
     _tAttackDetection* a = *ad;
     
-    leaf_free(a);
+    leaf_free((char*)a);
 }
 
 void    tAttackDetection_initToPool     (tAttackDetection* const ad, int blocksize, int atk, int rel, tMempool* const mp)
@@ -428,7 +428,7 @@
     _tMempool* m = *mp;
     _tAttackDetection* a = *ad;
     
-    mpool_free(a, m);
+    mpool_free((char*)a, m);
 }
 
 /*******Public Functions***********/
@@ -580,11 +580,11 @@
 {
     _tSNAC* s = *snac;
     
-    leaf_free(s->inputbuf);
-    leaf_free(s->processbuf);
-    leaf_free(s->spectrumbuf);
-    leaf_free(s->biasbuf);
-    leaf_free(s);
+    leaf_free((char*)s->inputbuf);
+    leaf_free((char*)s->processbuf);
+    leaf_free((char*)s->spectrumbuf);
+    leaf_free((char*)s->biasbuf);
+    leaf_free((char*)s);
 }
 
 void    tSNAC_initToPool    (tSNAC* const snac, int overlaparg, tMempool* const mp)
@@ -614,11 +614,11 @@
     _tMempool* m = *mp;
     _tSNAC* s = *snac;
     
-    mpool_free(s->inputbuf, m);
-    mpool_free(s->processbuf, m);
-    mpool_free(s->spectrumbuf, m);
-    mpool_free(s->biasbuf, m);
-    mpool_free(s, m);
+    mpool_free((char*)s->inputbuf, m);
+    mpool_free((char*)s->processbuf, m);
+    mpool_free((char*)s->spectrumbuf, m);
+    mpool_free((char*)s->biasbuf, m);
+    mpool_free((char*)s, m);
 }
 
 /******************************************************************************/
@@ -977,7 +977,7 @@
     
     tEnvPD_freeFromPool(&p->env, mp);
     tSNAC_freeFromPool(&p->snac, mp);
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 float tPeriodDetection_tick (tPeriodDetection* pd, float sample)
--- a/LEAF/Src/leaf-delay.c
+++ b/LEAF/Src/leaf-delay.c
@@ -56,8 +56,8 @@
     _tMempool* m = *mp;
     _tDelay* d = *dl;
     
-    mpool_free(d->buff, m);
-    mpool_free(d, m);
+    mpool_free((char*)d->buff, m);
+    mpool_free((char*)d, m);
 }
 
 void    tDelay_clear(tDelay* const dl)
@@ -206,8 +206,8 @@
     _tMempool* m = *mp;
     _tLinearDelay* d = *dl;
     
-    mpool_free(d->buff, m);
-    mpool_free(d, m);
+    mpool_free((char*)d->buff, m);
+    mpool_free((char*)d, m);
 }
 
 void    tLinearDelay_clear(tLinearDelay* const dl)
@@ -404,8 +404,8 @@
     _tMempool* m = *mp;
     _tHermiteDelay* d = *dl;
 
-    mpool_free(d->buff, m);
-    mpool_free(d, m);
+    mpool_free((char*)d->buff, m);
+    mpool_free((char*)d, m);
 }
 
 
@@ -606,8 +606,8 @@
     _tMempool* m = *mp;
     _tAllpassDelay* d = *dl;
     
-    mpool_free(d->buff, m);
-    mpool_free(d, m);
+    mpool_free((char*)d->buff, m);
+    mpool_free((char*)d, m);
 }
 
 void    tAllpassDelay_clear(tAllpassDelay* const dl)
@@ -781,8 +781,8 @@
     _tMempool* m = *mp;
     _tTapeDelay* d = *dl;
     
-    mpool_free(d->buff, m);
-    mpool_free(d, m);
+    mpool_free((char*)d->buff, m);
+    mpool_free((char*)d, m);
 }
 
 void    tTapeDelay_clear(tTapeDelay* const dl)
--- a/LEAF/Src/leaf-distortion.c
+++ b/LEAF/Src/leaf-distortion.c
@@ -36,7 +36,7 @@
 {
     _tSampleReducer* s = *sr;
     
-    leaf_free(s);
+    leaf_free((char*)s);
 }
 
 void    tSampleReducer_initToPool   (tSampleReducer* const sr, tMempool* const mp)
@@ -54,7 +54,7 @@
     _tMempool* m = *mp;
     _tSampleReducer* s = *sr;
     
-    mpool_free(s, m);
+    mpool_free((char*)s, m);
 }
 
 float tSampleReducer_tick(tSampleReducer* const sr, float input)
@@ -97,8 +97,8 @@
         os->numTaps = __leaf_tablesize_firNumTaps[idx];
         os->phaseLength = os->numTaps / os->ratio;
         os->pCoeffs = (float*) __leaf_tableref_firCoeffs[idx];
-        os->upState = leaf_alloc(sizeof(float) * os->numTaps * 2);
-        os->downState = leaf_alloc(sizeof(float) * os->numTaps * 2);
+        os->upState = (float*) leaf_alloc(sizeof(float) * os->numTaps * 2);
+        os->downState = (float*) leaf_alloc(sizeof(float) * os->numTaps * 2);
     }
 }
 
@@ -106,9 +106,9 @@
 {
     _tOversampler* os = *osr;
     
-    leaf_free(os->upState);
-    leaf_free(os->downState);
-    leaf_free(os);
+    leaf_free((char*)os->upState);
+    leaf_free((char*)os->downState);
+    leaf_free((char*)os);
 }
 
 void    tOversampler_initToPool     (tOversampler* const osr, int ratio, oBool extraQuality, tMempool* const mp)
@@ -126,8 +126,8 @@
         os->numTaps = __leaf_tablesize_firNumTaps[idx];
         os->phaseLength = os->numTaps / os->ratio;
         os->pCoeffs = (float*) __leaf_tableref_firCoeffs[idx];
-        os->upState = mpool_alloc(sizeof(float) * os->numTaps * 2, m);
-        os->downState = mpool_alloc(sizeof(float) * os->numTaps * 2, m);
+        os->upState = (float*) mpool_alloc(sizeof(float) * os->numTaps * 2, m);
+        os->downState = (float*) mpool_alloc(sizeof(float) * os->numTaps * 2, m);
     }
 }
 
@@ -136,9 +136,9 @@
     _tMempool* m = *mp;
     _tOversampler* os = *osr;
     
-    mpool_free(os->upState, m);
-    mpool_free(os->downState, m);
-    mpool_free(os, m);
+    mpool_free((char*)os->upState, m);
+    mpool_free((char*)os->downState, m);
+    mpool_free((char*)os, m);
 }
 
 float tOversampler_tick(tOversampler* const osr, float input, float (*effectTick)(float))
@@ -357,7 +357,7 @@
 {
     _tLockhartWavefolder* w = *wf;
     
-    leaf_free(w);
+    leaf_free((char*)w);
 }
 
 void    tLockhartWavefolder_initToPool   (tLockhartWavefolder* const wf, tMempool* const mp)
@@ -409,7 +409,7 @@
     _tMempool* m = *mp;
     _tLockhartWavefolder* w = *wf;
     
-    mpool_free(w, m);
+    mpool_free((char*)w, m);
 }
 
 
@@ -613,7 +613,7 @@
 {
     _tCrusher* c = *cr;
     tSampleReducer_free(&c->sReducer);
-    leaf_free(c);
+    leaf_free((char*)c);
 }
 
 void    tCrusher_initToPool   (tCrusher* const cr, tMempool* const mp)
@@ -634,7 +634,7 @@
     _tMempool* m = *mp;
     _tCrusher* c = *cr;
     tSampleReducer_freeFromPool(&c->sReducer, mp);
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tCrusher_tick    (tCrusher* const cr, float input)
--- a/LEAF/Src/leaf-dynamics.c
+++ b/LEAF/Src/leaf-dynamics.c
@@ -60,7 +60,7 @@
 {
     _tCompressor* c = *comp;
     
-    leaf_free(c);
+    leaf_free((char*)c);
 }
 
 void    tCompressor_initToPool  (tCompressor* const comp, tMempool* const mp)
@@ -84,7 +84,7 @@
     _tMempool* m = *mp;
     _tCompressor* c = *comp;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float tCompressor_tick(tCompressor* const comp, float in)
@@ -154,7 +154,7 @@
     _tFeedbackLeveler* p = *fb;
     
     tPowerFollower_free(&p->pwrFlw);
-    leaf_free(p);
+    leaf_free((char*)p);
 }
 
 void    tFeedbackLeveler_initToPool     (tFeedbackLeveler* const fb, float targetLevel, float factor, float strength, int mode, tMempool* const mp)
@@ -175,7 +175,7 @@
     _tFeedbackLeveler* p = *fb;
     
     tPowerFollower_freeFromPool(&p->pwrFlw, mp);
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 void     tFeedbackLeveler_setStrength(tFeedbackLeveler* const fb, float strength)
@@ -247,7 +247,7 @@
     _tMempool* m = *mp;
     _tThreshold* t = *th;
 
-    mpool_free(t, m);
+    mpool_free((char*)t, m);
 }
 
 int tThreshold_tick(tThreshold* const th, float in)
--- a/LEAF/Src/leaf-effects.c
+++ b/LEAF/Src/leaf-effects.c
@@ -52,13 +52,13 @@
 {
     _tTalkbox* v = *voc;
     
-    leaf_free(v->buf1);
-    leaf_free(v->buf0);
-    leaf_free(v->window);
-    leaf_free(v->car1);
-    leaf_free(v->car0);
+    leaf_free((char*)v->buf1);
+    leaf_free((char*)v->buf0);
+    leaf_free((char*)v->window);
+    leaf_free((char*)v->car1);
+    leaf_free((char*)v->car0);
     
-    leaf_free(v);
+    leaf_free((char*)v);
 }
 
 void    tTalkbox_initToPool     (tTalkbox* const voc, int bufsize, tMempool* const mp)
@@ -89,13 +89,13 @@
     _tMempool* m = *mp;
     _tTalkbox* v = *voc;
     
-    mpool_free(v->buf1, m);
-    mpool_free(v->buf0, m);
-    mpool_free(v->window, m);
-    mpool_free(v->car1, m);
-    mpool_free(v->car0, m);
+    mpool_free((char*)v->buf1, m);
+    mpool_free((char*)v->buf0, m);
+    mpool_free((char*)v->window, m);
+    mpool_free((char*)v->car1, m);
+    mpool_free((char*)v->car0, m);
     
-    mpool_free(v, m);
+    mpool_free((char*)v, m);
 }
 
 void tTalkbox_update(tTalkbox* const voc) ///update internal parameters...
@@ -373,7 +373,7 @@
 {
     _tVocoder* v = *voc;
     
-    leaf_free(v);
+    leaf_free((char*)v);
 }
 
 void    tVocoder_initToPool     (tVocoder* const voc, tMempool* const mp)
@@ -398,7 +398,7 @@
     _tMempool* m = *mp;
     _tVocoder* v = *voc;
     
-    mpool_free(v, m);
+    mpool_free((char*)v, m);
 }
 
 void        tVocoder_update      (tVocoder* const voc)
@@ -591,7 +591,7 @@
 {
 	_tMempool* m = *mp;
 	_tRosenbergGlottalPulse* g = *gp;
-	mpool_free(g, m);
+	mpool_free((char*)g, m);
 }
 
 float   tRosenbergGlottalPulse_tick           (tRosenbergGlottalPulse* const gp)
@@ -675,8 +675,8 @@
 {
     _tSOLAD* w = *wp;
     
-    leaf_free(w->delaybuf);
-    leaf_free(w);
+    leaf_free((char*)w->delaybuf);
+    leaf_free((char*)w);
 }
 
 void    tSOLAD_initToPool       (tSOLAD* const wp, tMempool* const mp)
@@ -696,8 +696,8 @@
     _tMempool* m = *mp;
     _tSOLAD* w = *wp;
     
-    mpool_free(w->delaybuf, m);
-    mpool_free(w, m);
+    mpool_free((char*)w->delaybuf, m);
+    mpool_free((char*)w, m);
 }
 
 // send one block of input samples, receive one block of output samples
@@ -1059,7 +1059,7 @@
     
     tSOLAD_free(&ps->sola);
     tHighpass_free(&ps->hp);
-    leaf_free(ps);
+    leaf_free((char*)ps);
 }
 
 void    tPitchShift_initToPool      (tPitchShift* const psr, tPeriodDetection* const pd, float* out, int bufSize, tMempool* const mp)
@@ -1095,7 +1095,7 @@
     
     tSOLAD_freeFromPool(&ps->sola, mp);
     tHighpass_freeFromPool(&ps->hp, mp);
-    mpool_free(ps, m);
+    mpool_free((char*)ps, m);
 }
 
 void tPitchShift_setPitchFactor(tPitchShift* psr, float pf)
@@ -1269,14 +1269,14 @@
     for (int i = 0; i < r->numVoices; ++i)
     {
         tPitchShift_freeFromPool(&r->ps[i], mp);
-        mpool_free(r->outBuffers[i], m);
+        mpool_free((char*)r->outBuffers[i], m);
     }
-    mpool_free(r->tickOutput, m);
-    mpool_free(r->pitchFactor, m);
-    mpool_free(r->ps, m);
-    mpool_free(r->inBuffer, m);
-    mpool_free(r->outBuffers, m);
-    mpool_free(r, m);
+    mpool_free((char*)r->tickOutput, m);
+    mpool_free((char*)r->pitchFactor, m);
+    mpool_free((char*)r->ps, m);
+    mpool_free((char*)r->inBuffer, m);
+    mpool_free((char*)r->outBuffers, m);
+    mpool_free((char*)r, m);
 }
 
 float* tRetune_tick(tRetune* const rt, float sample)
@@ -1300,12 +1300,12 @@
     for (int i = 0; i < r->numVoices; ++i)
     {
         tPitchShift_free(&r->ps[i]);
-        leaf_free(r->outBuffers[i]);
+        leaf_free((char*)r->outBuffers[i]);
     }
-    leaf_free(r->tickOutput);
-    leaf_free(r->pitchFactor);
-    leaf_free(r->ps);
-    leaf_free(r->outBuffers);
+    leaf_free((char*)r->tickOutput);
+    leaf_free((char*)r->pitchFactor);
+    leaf_free((char*)r->ps);
+    leaf_free((char*)r->outBuffers);
     
     r->numVoices = numVoices;
     
@@ -1442,14 +1442,14 @@
     for (int i = 0; i < r->numVoices; ++i)
     {
         tPitchShift_freeFromPool(&r->ps[i], mp);
-        mpool_free(r->outBuffers[i], m);
+        mpool_free((char*)r->outBuffers[i], m);
     }
-    mpool_free(r->tickOutput, m);
-    mpool_free(r->freq, m);
-    mpool_free(r->ps, m);
-    mpool_free(r->inBuffer, m);
-    mpool_free(r->outBuffers, m);
-    mpool_free(r, m);
+    mpool_free((char*)r->tickOutput, m);
+    mpool_free((char*)r->freq, m);
+    mpool_free((char*)r->ps, m);
+    mpool_free((char*)r->inBuffer, m);
+    mpool_free((char*)r->outBuffers, m);
+    mpool_free((char*)r, m);
 }
 
 float* tAutotune_tick(tAutotune* const rt, float sample)
@@ -1477,12 +1477,12 @@
     for (int i = 0; i < r->numVoices; ++i)
     {
         tPitchShift_free(&r->ps[i]);
-        leaf_free(r->outBuffers[i]);
+        leaf_free((char*)r->outBuffers[i]);
     }
-    leaf_free(r->tickOutput);
-    leaf_free(r->freq);
-    leaf_free(r->ps);
-    leaf_free(r->outBuffers);
+    leaf_free((char*)r->tickOutput);
+    leaf_free((char*)r->freq);
+    leaf_free((char*)r->ps);
+    leaf_free((char*)r->outBuffers);
     
     r->numVoices = numVoices;
     
@@ -1611,20 +1611,20 @@
 {
     _tFormantShifter* fs = *fsr;
     
-    leaf_free(fs->fk);
-    leaf_free(fs->fb);
-    leaf_free(fs->fc);
-    leaf_free(fs->frb);
-    leaf_free(fs->frc);
-    leaf_free(fs->fsig);
-    leaf_free(fs->fsmooth);
-    leaf_free(fs->ftvec);
-    leaf_free(fs->fbuff);
+    leaf_free((char*)fs->fk);
+    leaf_free((char*)fs->fb);
+    leaf_free((char*)fs->fc);
+    leaf_free((char*)fs->frb);
+    leaf_free((char*)fs->frc);
+    leaf_free((char*)fs->fsig);
+    leaf_free((char*)fs->fsmooth);
+    leaf_free((char*)fs->ftvec);
+    leaf_free((char*)fs->fbuff);
     tHighpass_free(&fs->hp);
     tHighpass_free(&fs->hp2);
 	tFeedbackLeveler_free(&fs->fbl1);
 	tFeedbackLeveler_free(&fs->fbl2);
-    leaf_free(fs);
+    leaf_free((char*)fs);
 }
 
 void    tFormantShifter_initToPool      (tFormantShifter* const fsr, int order, tMempool* const mp)
@@ -1666,20 +1666,20 @@
     _tMempool* m = *mp;
     _tFormantShifter* fs = *fsr;
     
-    mpool_free(fs->fk, m);
-    mpool_free(fs->fb, m);
-    mpool_free(fs->fc, m);
-    mpool_free(fs->frb, m);
-    mpool_free(fs->frc, m);
-    mpool_free(fs->fsig, m);
-    mpool_free(fs->fsmooth, m);
-    mpool_free(fs->ftvec, m);
-    mpool_free(fs->fbuff, m);
+    mpool_free((char*)fs->fk, m);
+    mpool_free((char*)fs->fb, m);
+    mpool_free((char*)fs->fc, m);
+    mpool_free((char*)fs->frb, m);
+    mpool_free((char*)fs->frc, m);
+    mpool_free((char*)fs->fsig, m);
+    mpool_free((char*)fs->fsmooth, m);
+    mpool_free((char*)fs->ftvec, m);
+    mpool_free((char*)fs->fbuff, m);
     tHighpass_freeFromPool(&fs->hp, mp);
     tHighpass_freeFromPool(&fs->hp2, mp);
     tFeedbackLeveler_freeFromPool(&fs->fbl1, mp);
     tFeedbackLeveler_freeFromPool(&fs->fbl2, mp);
-    mpool_free(fs, m);
+    mpool_free((char*)fs, m);
 }
 
 float tFormantShifter_tick(tFormantShifter* const fsr, float in)
--- a/LEAF/Src/leaf-electrical.c
+++ b/LEAF/Src/leaf-electrical.c
@@ -175,7 +175,7 @@
 {
     _tWDF* r = *wdf;
     
-    leaf_free(r);
+    leaf_free((char*)r);
 }
 
 void    tWDF_initToPool             (tWDF* const wdf, WDFComponentType type, float value, tWDF* const rL, tWDF* const rR, tMempool* const mp)
@@ -191,7 +191,7 @@
     _tMempool* m = *mp;
     _tWDF* r = *wdf;
     
-    mpool_free(r, m);
+    mpool_free((char*)r, m);
 }
 
 float tWDF_tick(tWDF* const wdf, float sample, tWDF* const outputPoint, uint8_t paramsChanged)
--- a/LEAF/Src/leaf-envelopes.c
+++ b/LEAF/Src/leaf-envelopes.c
@@ -24,7 +24,7 @@
 #endif
 
 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Envelope ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ //
-void    tEnvelope_init(tEnvelope* const envlp, float attack, float decay, oBool loop)
+void    tEnvelope_init(tEnvelope* const envlp, float attack, float decay, int loop)
 {
     _tEnvelope* env = *envlp = (_tEnvelope*) leaf_alloc(sizeof(_tEnvelope));
     
@@ -67,10 +67,10 @@
 void tEnvelope_free(tEnvelope* const envlp)
 {
     _tEnvelope* env = *envlp;
-    leaf_free(env);
+    leaf_free((char*)env);
 }
 
-void    tEnvelope_initToPool    (tEnvelope* const envlp, float attack, float decay, oBool loop, tMempool* const mp)
+void    tEnvelope_initToPool    (tEnvelope* const envlp, float attack, float decay, int loop, tMempool* const mp)
 {
     _tMempool* m = *mp;
     _tEnvelope* env = *envlp = (_tEnvelope*) mpool_alloc(sizeof(_tEnvelope), m);
@@ -115,7 +115,7 @@
 {
     _tMempool* m = *mp;
     _tEnvelope* env = *envlp;
-    mpool_free(env, m);
+    mpool_free((char*)env, m);
 }
 
 void     tEnvelope_setAttack(tEnvelope* const envlp, float attack)
@@ -152,7 +152,7 @@
     env->decayInc = env->inc_buff[decayIndex];
 }
 
-void     tEnvelope_loop(tEnvelope* const envlp, oBool loop)
+void     tEnvelope_loop(tEnvelope* const envlp, int loop)
 {
     _tEnvelope* env = *envlp;
     env->loop = loop;
@@ -331,7 +331,7 @@
 {
     _tMempool* m = *mp;
     _tADSR* adsr = *adsrenv;
-    mpool_free(adsr, m);
+    mpool_free((char*)adsr, m);
 }
 
 void     tADSR_setAttack(tADSR* const adsrenv, float attack)
@@ -587,7 +587,7 @@
 {
     _tMempool* m = *mp;
     _tADSR2* adsr = *adsrenv;
-    mpool_free(adsr, m);
+    mpool_free((char*)adsr, m);
 }
 
 void     tADSR2_setAttack(tADSR2* const adsrenv, float attack)
@@ -745,7 +745,7 @@
 {
     _tMempool* m = *mp;
     _tADSR3* adsr = *adsrenv;
-    mpool_free(adsr, m);
+    mpool_free((char*)adsr, m);
 }
 
 void     tADSR3_setAttack(tADSR3* const adsrenv, float attack)
@@ -903,7 +903,7 @@
 {
     _tMempool* m = *mp;
     _tADSR4* adsr = *adsrenv;
-    mpool_free(adsr, m);
+    mpool_free((char*)adsr, m);
 }
 
 void     tADSR4_setAttack(tADSR4* const adsrenv, float attack)
@@ -1227,7 +1227,7 @@
 {
     _tRamp* ramp = *r;
     
-    leaf_free(ramp);
+    leaf_free((char*)ramp);
 }
 
 void    tRamp_initToPool    (tRamp* const r, float time, int samples_per_tick, tMempool* const mp)
@@ -1258,7 +1258,7 @@
     _tMempool* m = *mp;
     _tRamp* ramp = *r;
     
-    mpool_free(ramp, m);
+    mpool_free((char*)ramp, m);
 }
 
 void     tRamp_setTime(tRamp* const ramp, float time)
@@ -1372,7 +1372,7 @@
     _tMempool* m = *mp;
     _tRampUpDown* ramp = *r;
 
-    mpool_free(ramp, m);
+    mpool_free((char*)ramp, m);
 }
 
 void     tRampUpDown_setUpTime(tRampUpDown* const ramp, float upTime)
@@ -1484,7 +1484,7 @@
 {
     _tExpSmooth* smooth = *expsmooth;
     
-    leaf_free(smooth);
+    leaf_free((char*)smooth);
 }
 
 void    tExpSmooth_initToPool   (tExpSmooth* const expsmooth, float val, float factor, tMempool* const mp)
@@ -1505,7 +1505,7 @@
     _tMempool* m = *mp;
     _tExpSmooth* smooth = *expsmooth;
     
-    mpool_free(smooth, m);
+    mpool_free((char*)smooth, m);
 }
 
 void     tExpSmooth_setFactor(tExpSmooth* const expsmooth, float factor)
@@ -1588,7 +1588,7 @@
 	_tMempool* m = *mp;
 	    _tSlide* s = *sl;
 
-	    mpool_free(s, m);
+	    mpool_free((char*)s, m);
 }
 
 float tSlide_tick(tSlide* const sl, float in)
--- a/LEAF/Src/leaf-filters.c
+++ b/LEAF/Src/leaf-filters.c
@@ -37,7 +37,7 @@
     _tAllpass* f = *ft;
     
     tLinearDelay_free(&f->delay);
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tAllpass_initToPool     (tAllpass* const ft, float initDelay, uint32_t maxDelay, tMempool* const mp)
@@ -58,7 +58,7 @@
     _tAllpass* f = *ft;
     
     tLinearDelay_freeFromPool(&f->delay, mp);
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 void    tAllpass_setDelay(tAllpass* const ft, float delay)
@@ -106,7 +106,7 @@
 {
     _tOnePole* f = *ft;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tOnePole_initToPool     (tOnePole* const ft, float freq, tMempool* const mp)
@@ -128,7 +128,7 @@
     _tMempool* m = *mp;
     _tOnePole* f = *ft;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 void    tOnePole_setB0(tOnePole* const ft, float b0)
@@ -209,7 +209,7 @@
 {
     _tTwoPole* f = *ft;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tTwoPole_initToPool     (tTwoPole* const ft, tMempool* const mp)
@@ -230,7 +230,7 @@
     _tMempool* m = *mp;
     _tTwoPole* f = *ft;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 float   tTwoPole_tick(tTwoPole* const ft, float input)
@@ -335,7 +335,7 @@
 {
     _tOneZero* f = *ft;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tOneZero_initToPool     (tOneZero* const ft, float theZero, tMempool* const mp)
@@ -354,7 +354,7 @@
     _tMempool* m = *mp;
     _tOneZero* f = *ft;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 float   tOneZero_tick(tOneZero* const ft, float input)
@@ -450,7 +450,7 @@
 {
     _tTwoZero* f = *ft;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tTwoZero_initToPool     (tTwoZero* const ft, tMempool* const mp)
@@ -468,7 +468,7 @@
     _tMempool* m = *mp;
     _tTwoZero* f = *ft;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 float   tTwoZero_tick(tTwoZero* const ft, float input)
@@ -558,7 +558,7 @@
 {
     _tPoleZero* f = *pzf;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tPoleZero_initToPool        (tPoleZero* const pzf, tMempool* const mp)
@@ -579,7 +579,7 @@
     _tMempool* m = *mp;
     _tPoleZero* f = *pzf;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 void    tPoleZero_setB0(tPoleZero* const pzf, float b0)
@@ -689,7 +689,7 @@
 {
     _tBiQuad* f = *ft;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tBiQuad_initToPool     (tBiQuad* const ft, tMempool* const mp)
@@ -713,7 +713,7 @@
     _tMempool* m = *mp;
     _tBiQuad* f = *ft;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 float   tBiQuad_tick(tBiQuad* const ft, float input)
@@ -923,7 +923,7 @@
     _tMempool* m = *mp;
     _tSVF* svf = *svff;
     
-    mpool_free(svf, m);
+    mpool_free((char*)svf, m);
 }
 
 float   tSVF_tick(tSVF* const svff, float v0)
@@ -992,7 +992,7 @@
 {
     _tEfficientSVF* svf = *svff;
     
-    leaf_free(svf);
+    leaf_free((char*)svf);
 }
 
 void    tEfficientSVF_initToPool    (tEfficientSVF* const svff, SVFType type, uint16_t input, float Q, tMempool* const mp)
@@ -1017,7 +1017,7 @@
     _tMempool* m = *mp;
     _tEfficientSVF* svf = *svff;
     
-    mpool_free(svf, m);
+    mpool_free((char*)svf, m);
 }
 
 float   tEfficientSVF_tick(tEfficientSVF* const svff, float v0)
@@ -1076,7 +1076,7 @@
 {
     _tHighpass* f = *ft;
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tHighpass_initToPool    (tHighpass* const ft, float freq, tMempool* const mp)
@@ -1096,7 +1096,7 @@
     _tMempool* m = *mp;
     _tHighpass* f = *ft;
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 void     tHighpass_setFreq(tHighpass* const ft, float freq)
@@ -1157,7 +1157,7 @@
         tSVF_free(&f->high[i]);
     }
     
-    leaf_free(f);
+    leaf_free((char*)f);
 }
 
 void    tButterworth_initToPool     (tButterworth* const ft, int N, float f1, float f2, tMempool* const mp)
@@ -1191,7 +1191,7 @@
         tSVF_freeFromPool(&f->high[i], mp);
     }
     
-    mpool_free(f, m);
+    mpool_free((char*)f, m);
 }
 
 float tButterworth_tick(tButterworth* const ft, float samp)
@@ -1249,8 +1249,8 @@
 {
     _tFIR* fir = *firf;
     
-    leaf_free(fir->past);
-    leaf_free(fir);
+    leaf_free((char*)fir->past);
+    leaf_free((char*)fir);
 }
 
 void    tFIR_initToPool     (tFIR* const firf, float* coeffs, int numTaps, tMempool* const mp)
@@ -1269,8 +1269,8 @@
     _tMempool* m = *mp;
     _tFIR* fir = *firf;
     
-    mpool_free(fir->past, m);
-    mpool_free(fir, m);
+    mpool_free((char*)fir->past, m);
+    mpool_free((char*)fir, m);
 }
 
 float	tFIR_tick(tFIR* const firf, float input)
@@ -1321,9 +1321,9 @@
     _tMempool* m = *mp;
     _tMedianFilter* f = *mf;
 
-    mpool_free(f->val, m);
-    mpool_free(f->age, m);
-    mpool_free(f, m);
+    mpool_free((char*)f->val, m);
+    mpool_free((char*)f->age, m);
+    mpool_free((char*)f, m);
 }
 
 float   tMedianFilter_tick           (tMedianFilter* const mf, float input)
@@ -1399,7 +1399,7 @@
 {
 	 _tMempool* m = *mp;
 		 _tVZFilter* f = *vf = (_tVZFilter*) mpool_alloc(sizeof(_tVZFilter), m);
-		 mpool_free(f, m);
+		 mpool_free((char*)f, m);
 }
 
 void 	tVZFilter_setSampleRate  (tVZFilter* const vf, float sampleRate)
@@ -1699,7 +1699,7 @@
 {
 	 _tMempool* m = *mp;
 	 _tDiodeFilter* f = *vf = (_tDiodeFilter*) mpool_alloc(sizeof(_tDiodeFilter), m);
-	 mpool_free(f, m);
+	 mpool_free((char*)f, m);
 }
 
 float tanhXdX(float x)
--- a/LEAF/Src/leaf-instruments.c
+++ b/LEAF/Src/leaf-instruments.c
@@ -60,7 +60,7 @@
     tHighpass_free(&cowbell->highpass);
     tNoise_free(&cowbell->stick);
     tEnvelope_free(&cowbell->envStick);
-    leaf_free(cowbell);
+    leaf_free((char*)cowbell);
 }
 
 void        t808Cowbell_initToPool      (t808Cowbell* const cowbellInst, int useStick, tMempool* const mp)
@@ -107,7 +107,7 @@
     tHighpass_freeFromPool(&cowbell->highpass, mp);
     tNoise_freeFromPool(&cowbell->stick, mp);
     tEnvelope_freeFromPool(&cowbell->envStick, mp);
-    mpool_free(cowbell, m);
+    mpool_free((char*)cowbell, m);
 }
 
 void t808Cowbell_on(t808Cowbell* const cowbellInst, float vel)
@@ -236,7 +236,7 @@
     
     tHighpass_free(&hihat->highpass);
     
-    leaf_free(hihat);
+    leaf_free((char*)hihat);
 }
 
 void    t808Hihat_initToPool  (t808Hihat* const hihatInst, tMempool* const mp)
@@ -294,7 +294,7 @@
     
     tHighpass_freeFromPool(&hihat->highpass, mp);
     
-    mpool_free(hihat, m);
+    mpool_free((char*)hihat, m);
 }
 
 void t808Hihat_on(t808Hihat* const hihatInst, float vel)
@@ -448,7 +448,7 @@
     tEnvelope_free(&snare->noiseEnvGain);
     tEnvelope_free(&snare->noiseEnvFilter);
     
-    leaf_free(snare);
+    leaf_free((char*)snare);
 }
 
 void    t808Snare_initToPool    (t808Snare* const snareInst, tMempool* const mp)
@@ -499,7 +499,7 @@
     tEnvelope_freeFromPool(&snare->noiseEnvGain, mp);
     tEnvelope_freeFromPool(&snare->noiseEnvFilter, mp);
     
-    mpool_free(snare, m);
+    mpool_free((char*)snare, m);
 }
 
 void t808Snare_on(t808Snare* const snareInst, float vel)
@@ -623,7 +623,7 @@
 	tNoise_free(&kick->noiseOsc);
 	tEnvelope_free(&kick->noiseEnvGain);
     
-    leaf_free(kick);
+    leaf_free((char*)kick);
 }
 
 void    t808Kick_initToPool (t808Kick* const kickInst, tMempool* const mp)
@@ -658,7 +658,7 @@
     tNoise_freeFromPool(&kick->noiseOsc, mp);
     tEnvelope_freeFromPool(&kick->noiseEnvGain, mp);
     
-    mpool_free(kick, m);
+    mpool_free((char*)kick, m);
 }
 
 float       t808Kick_tick                  (t808Kick* const kickInst)
--- a/LEAF/Src/leaf-math.c
+++ b/LEAF/Src/leaf-math.c
@@ -126,8 +126,8 @@
 {
     if (x >= -127.0)
     {
-        register float accumulator, xPower;
-        register union {float f; int32_t i;} xBits;
+        float accumulator, xPower;
+        union {float f; int32_t i;} xBits;
         
         xBits.i = (int32_t)(x + 4096.0f) - 4096L;               /* integer part */
         x -= (float)(xBits.i);                                             /* fractional part */
--- a/LEAF/Src/leaf-mempool.c
+++ b/LEAF/Src/leaf-mempool.c
@@ -52,7 +52,7 @@
  * private function
  */
 static inline size_t mpool_align(size_t size);
-static inline mpool_node_t* create_node(void* block_location, mpool_node_t* next, mpool_node_t* prev, size_t size);
+static inline mpool_node_t* create_node(char* block_location, mpool_node_t* next, mpool_node_t* prev, size_t size);
 static inline void delink_node(mpool_node_t* node);
 
 /**
@@ -62,7 +62,7 @@
 {
     leaf.header_size = mpool_align(sizeof(mpool_node_t));
     
-    pool->mpool = (void*)memory;
+    pool->mpool = (char*)memory;
     pool->usize  = 0;
     pool->msize  = size;
     
@@ -87,7 +87,7 @@
 /**
  * allocate memory from memory pool
  */
-void* mpool_alloc(size_t asize, _tMempool* pool)
+char* mpool_alloc(size_t asize, _tMempool* pool)
 {
     // If the head is NULL, the mempool is full
     if (pool->head == NULL)
@@ -161,7 +161,7 @@
 /**
  * allocate memory from memory pool and also clear that memory to be blank
  */
-void* mpool_calloc(size_t asize, _tMempool* pool)
+char* mpool_calloc(size_t asize, _tMempool* pool)
 {
     // If the head is NULL, the mempool is full
     if (pool->head == NULL)
@@ -227,10 +227,10 @@
     return node_to_alloc->pool;
 }
 
-void* leaf_alloc(size_t size)
+char* leaf_alloc(size_t size)
 {
     //printf("alloc %i\n", size);
-    void* block = mpool_alloc(size, &leaf._mempool);
+    char* block = mpool_alloc(size, &leaf._mempool);
     
     if (block == NULL) leaf_mempool_overrun();
     
@@ -237,10 +237,10 @@
     return block;
 }
 
-void* leaf_calloc(size_t size)
+char* leaf_calloc(size_t size)
 {
     //printf("alloc %i\n", size);
-    void* block = mpool_calloc(size, &leaf._mempool);
+    char* block = mpool_calloc(size, &leaf._mempool);
     
     if (block == NULL) leaf_mempool_overrun();
     
@@ -248,7 +248,7 @@
     return block;
 }
 
-void mpool_free(void* ptr, _tMempool* pool)
+void mpool_free(char* ptr, _tMempool* pool)
 {
     //if (ptr < pool->mpool || ptr >= pool->mpool + pool->msize)
     // Get the node at the freed space
@@ -310,7 +310,7 @@
     //    for (int i = 0; i < freed_node->size; i++) freed_pool[i] = 0;
 }
 
-void leaf_free(void* ptr)
+void leaf_free(char* ptr)
 {
     mpool_free(ptr, &leaf._mempool);
 }
@@ -335,9 +335,9 @@
     return mpool_get_used(&leaf._mempool);
 }
 
-void* leaf_pool_get_pool(void)
+char* leaf_pool_get_pool(void)
 {
-    float* buff = (float*)leaf._mempool.mpool;
+    char* buff = leaf._mempool.mpool;
     
     return buff;
 }
@@ -349,7 +349,7 @@
     return (size + (MPOOL_ALIGN_SIZE - 1)) & ~(MPOOL_ALIGN_SIZE - 1);
 }
 
-static inline mpool_node_t* create_node(void* block_location, mpool_node_t* next, mpool_node_t* prev, size_t size)
+static inline mpool_node_t* create_node(char* block_location, mpool_node_t* next, mpool_node_t* prev, size_t size)
 {
     mpool_node_t* node = (mpool_node_t*)block_location;
     node->pool = block_location + leaf.header_size;
@@ -408,5 +408,5 @@
     _tMempool* mm = *mem;
     _tMempool* m = *mp;
     
-    mpool_free(m, mm);
+    mpool_free((char*)m, mm);
 }
--- a/LEAF/Src/leaf-midi.c
+++ b/LEAF/Src/leaf-midi.c
@@ -36,7 +36,7 @@
 {
     _tStack* ns = *stack;
     
-    leaf_free(ns);
+    leaf_free((char*)ns);
 }
 
 void    tStack_initToPool           (tStack* const stack, tMempool* const mp)
@@ -57,7 +57,7 @@
     _tMempool* m = *mp;
     _tStack* ns = *stack;
     
-    mpool_free(ns, m);
+    mpool_free((char*)ns, m);
 }
 
 // If stack contains note, returns index. Else returns -1;
@@ -322,18 +322,18 @@
     for (int i = 0; i < poly->maxNumVoices; i++)
     {
         tRamp_free(&poly->ramps[i]);
-        leaf_free(poly->voices[i]);
+        leaf_free((char*)poly->voices[i]);
     }
     tRamp_free(&poly->pitchBendRamp);
     tStack_free(&poly->stack);
     tStack_free(&poly->orderStack);
     
-    leaf_free(poly->voices);
-    leaf_free(poly->ramps);
-    leaf_free(poly->rampVals);
-    leaf_free(poly->firstReceived);
+    leaf_free((char*)poly->voices);
+    leaf_free((char*)poly->ramps);
+    leaf_free((char*)poly->rampVals);
+    leaf_free((char*)poly->firstReceived);
     
-    leaf_free(poly);
+    leaf_free((char*)poly);
 }
 
 void    tPoly_initToPool            (tPoly* const polyh, int maxNumVoices, tMempool* const mp)
@@ -390,18 +390,18 @@
     for (int i = 0; i < poly->maxNumVoices; i++)
     {
         tRamp_freeFromPool(&poly->ramps[i], mp);
-        mpool_free(poly->voices[i], m);
+        mpool_free((char*)poly->voices[i], m);
     }
     tRamp_freeFromPool(&poly->pitchBendRamp, mp);
     tStack_freeFromPool(&poly->stack, mp);
     tStack_freeFromPool(&poly->orderStack, mp);
     
-    mpool_free(poly->voices, m);
-    mpool_free(poly->ramps, m);
-    mpool_free(poly->rampVals, m);
-    mpool_free(poly->firstReceived, m);
+    mpool_free((char*)poly->voices, m);
+    mpool_free((char*)poly->ramps, m);
+    mpool_free((char*)poly->rampVals, m);
+    mpool_free((char*)poly->firstReceived, m);
     
-    mpool_free(poly, m);
+    mpool_free((char*)poly, m);
 }
 
 void tPoly_tickPitch(tPoly* polyh)
@@ -730,11 +730,11 @@
 
     for (int i = 0; i < poly->maxNumVoices; i++)
     {
-        mpool_free(poly->voices[i], m);
+        mpool_free((char*)poly->voices[i], m);
     }
     tStack_freeFromPool(&poly->stack, mp);
-    mpool_free(poly->voices, m);
-    mpool_free(poly, m);
+    mpool_free((char*)poly->voices, m);
+    mpool_free((char*)poly, m);
 }
 
 int tSimplePoly_noteOn(tSimplePoly* const polyh, int note, uint8_t vel)
--- a/LEAF/Src/leaf-oscillators.c
+++ b/LEAF/Src/leaf-oscillators.c
@@ -42,7 +42,7 @@
     _tMempool* m = *mp;
     _tCycle* c = *cy;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 void     tCycle_setFreq(tCycle* const cy, float freq)
@@ -116,7 +116,7 @@
     _tMempool* m = *mp;
     _tTriangle* c = *cy;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 void tTriangle_setFreq(tTriangle* const cy, float freq)
@@ -190,7 +190,7 @@
     _tMempool* m = *mp;
     _tSquare* c = *cy;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 void    tSquare_setFreq(tSquare* const cy, float freq)
@@ -263,7 +263,7 @@
     _tMempool* m = *mp;
     _tSawtooth* c = *cy;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 void    tSawtooth_setFreq(tSawtooth* const cy, float freq)
@@ -338,8 +338,8 @@
     _tMempool* m = *mp;
     _tSine* c = *cy;
     
-    mpool_free(c->sine, m);
-    mpool_free(c, m);
+    mpool_free((char*)c->sine, m);
+    mpool_free((char*)c, m);
 }
 
 void     tSine_setFreq(tSine* const cy, float freq)
@@ -413,7 +413,7 @@
     _tMempool* m = *mp;
     _tTri* c = *cy;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tTri_tick          (tTri* const osc)
@@ -492,7 +492,7 @@
     _tMempool* m = *mp;
     _tPulse* c = *osc;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tPulse_tick        (tPulse* const osc)
@@ -556,7 +556,7 @@
     _tMempool* m = *mp;
     _tSaw* c = *osc;
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tSaw_tick          (tSaw* const osc)
@@ -618,7 +618,7 @@
     _tMempool* m = *mp;
     _tPhasor* p = *ph;
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 void    tPhasor_setFreq(tPhasor* const ph, float freq)
@@ -672,7 +672,7 @@
     _tMempool* m = *mp;
     _tNoise* n = *ns;
     
-    mpool_free(n, m);
+    mpool_free((char*)n, m);
 }
 
 float   tNoise_tick(tNoise* const ns)
@@ -752,7 +752,7 @@
     _tNeuron* n = *nr;
     
     tPoleZero_free(&n->f);
-    mpool_free(n, m);
+    mpool_free((char*)n, m);
 }
 
 void   tNeuron_reset(tNeuron* const nr)
@@ -981,15 +981,15 @@
     _tMempool* m = *mp;
     _tMinBLEP* mb = *minblep;
     
-    mpool_free(mb->offset, m);
+    mpool_free((char*)mb->offset, m);
 //    mpool_free(mb->freqMultiple, m);
-    mpool_free(mb->pos_change_magnitude, m);
-    mpool_free(mb->vel_change_magnitude, m);
+    mpool_free((char*)mb->pos_change_magnitude, m);
+    mpool_free((char*)mb->vel_change_magnitude, m);
     
-    mpool_free(mb->minBlepArray, m);
-    mpool_free(mb->minBlepDerivArray, m);
+    mpool_free((char*)mb->minBlepArray, m);
+    mpool_free((char*)mb->minBlepDerivArray, m);
     
-    mpool_free(mb, m);
+    mpool_free((char*)mb, m);
 }
 
 // SINC Function
@@ -1382,7 +1382,7 @@
     tMinBLEP_freeFromPool(&c->minBlep, mp);
     tHighpass_freeFromPool(&c->dcBlock, mp);
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tMBTriangle_tick          (tMBTriangle* const osc)
@@ -1521,7 +1521,7 @@
     tMinBLEP_freeFromPool(&c->minBlep, mp);
     tHighpass_freeFromPool(&c->dcBlock, mp);
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tMBPulse_tick        (tMBPulse* const osc)
@@ -1618,7 +1618,7 @@
     tMinBLEP_freeFromPool(&c->minBlep, mp);
     tHighpass_freeFromPool(&c->dcBlock, mp);
     
-    mpool_free(c, m);
+    mpool_free((char*)c, m);
 }
 
 float   tMBSaw_tick          (tMBSaw* const osc)
--- a/LEAF/Src/leaf-physical.c
+++ b/LEAF/Src/leaf-physical.c
@@ -56,7 +56,7 @@
     tOneZero_freeFromPool(&p->loopFilter, mp);
     tAllpassDelay_freeFromPool(&p->delayLine, mp);
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 float   tPluck_getLastOut    (tPluck* const pl)
@@ -194,7 +194,7 @@
         tBiQuad_freeFromPool(&p->biquad[i], mp);
     }
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 float   tKarplusStrong_getLastOut    (tKarplusStrong* const pl)
@@ -396,7 +396,7 @@
     tHighpass_freeFromPool(&p->DCblocker, mp);
     tFeedbackLeveler_freeFromPool(&p->fbLev, mp);
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 void     tSimpleLivingString_setFreq(tSimpleLivingString* const pl, float freq)
@@ -544,7 +544,7 @@
     tFeedbackLeveler_freeFromPool(&p->fbLevU, mp);
     tFeedbackLeveler_freeFromPool(&p->fbLevL, mp);
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 void     tLivingString_setFreq(tLivingString* const pl, float freq)
@@ -683,7 +683,7 @@
 {
     _tReedTable* p = *pm;
     
-    leaf_free(p);
+    leaf_free((char*)p);
 }
 
 void    tReedTable_initToPool   (tReedTable* const pm, float offset, float slope, tMempool* const mp)
@@ -700,7 +700,7 @@
     _tMempool* m = *mp;
     _tReedTable* p = *pm;
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 float   tReedTable_tick      (tReedTable* const pm, float input)
--- a/LEAF/Src/leaf-reverb.c
+++ b/LEAF/Src/leaf-reverb.c
@@ -62,7 +62,7 @@
     tDelay_free(&r->allpassDelays[0]);
     tDelay_free(&r->allpassDelays[1]);
     tDelay_free(&r->combDelay);
-    leaf_free(r);
+    leaf_free((char*)r);
 }
 
 void    tPRCReverb_initToPool   (tPRCReverb* const rev, float t60, tMempool* const mp)
@@ -110,7 +110,7 @@
     tDelay_freeFromPool(&r->allpassDelays[0], mp);
     tDelay_freeFromPool(&r->allpassDelays[1], mp);
     tDelay_freeFromPool(&r->combDelay, mp);
-    mpool_free(r, m);
+    mpool_free((char*)r, m);
 }
 
 void    tPRCRevert_clear(tPRCReverb* const rev)
@@ -237,7 +237,7 @@
     	tLinearDelay_free(&r->allpassDelays[i]);
     }
     
-    leaf_free(r);
+    leaf_free((char*)r);
 }
 
 void    tNReverb_initToPool     (tNReverb* const rev, float t60, tMempool* const mp)
@@ -296,7 +296,7 @@
         tLinearDelay_freeFromPool(&r->allpassDelays[i], mp);
     }
     
-    mpool_free(r, m);
+    mpool_free((char*)r, m);
 }
 
 void    tNReverb_setT60(tNReverb* const rev, float t60)
@@ -567,7 +567,7 @@
     
     tCycle_freeFromPool(&r->f2_lfo, mp);
     
-    mpool_free(r, m);
+    mpool_free((char*)r, m);
 }
 
 void    tDattorroReverb_clear             (tDattorroReverb* const rev)
--- a/LEAF/Src/leaf-sampling.c
+++ b/LEAF/Src/leaf-sampling.c
@@ -53,8 +53,8 @@
     _tMempool* m = *mp;
     _tBuffer* s = *sb;
     
-    mpool_free(s->buff, m);
-    mpool_free(s, m);
+    mpool_free((char*)s->buff, m);
+    mpool_free((char*)s, m);
 }
 
 void tBuffer_tick (tBuffer* const sb, float sample)
@@ -206,7 +206,7 @@
     _tSampler* p = *sp;
     tRamp_freeFromPool(&p->gain, mp);
     
-    mpool_free(p, m);
+    mpool_free((char*)p, m);
 }
 
 void tSampler_setSample (tSampler* const sp, tBuffer* const b)
@@ -768,7 +768,7 @@
     tEnvelopeFollower_freeFromPool(&a->ef, mp);
     tSampler_freeFromPool(&a->sampler, mp);
     
-    mpool_free(a, m);
+    mpool_free((char*)a, m);
 }
 
 float   tAutoSampler_tick               (tAutoSampler* const as, float input)
--- /dev/null
+++ b/LEAF/leaf.cpp
@@ -1,0 +1,45 @@
+#if _WIN32 || _WIN64
+
+#include ".\leaf.h"
+#include ".\Src\leaf-math.c"
+#include ".\Src\leaf-mempool.c"
+#include ".\Src\leaf-tables.c"
+#include ".\Src\leaf-distortion.c"
+#include ".\Src\leaf-oscillators.c"
+#include ".\Src\leaf-filters.c"
+#include ".\Src\leaf-delay.c"
+#include ".\Src\leaf-reverb.c"
+#include ".\Src\leaf-effects.c"
+#include ".\Src\leaf-envelopes.c"
+#include ".\Src\leaf-dynamics.c"
+#include ".\Src\leaf-analysis.c"
+#include ".\Src\leaf-instruments.c"
+#include ".\Src\leaf-midi.c"
+#include ".\Src\leaf-sampling.c"
+#include ".\Src\leaf-physical.c"
+#include ".\Src\leaf-electrical.c"
+#include ".\Src\leaf.c"
+
+#else
+
+#include "./leaf.h"
+#include "./Src/leaf-math.c"
+#include "./Src/leaf-mempool.c"
+#include "./Src/leaf-tables.c"
+#include "./Src/leaf-distortion.c"
+#include "./Src/leaf-dynamics.c"
+#include "./Src/leaf-oscillators.c"
+#include "./Src/leaf-filters.c"
+#include "./Src/leaf-delay.c"
+#include "./Src/leaf-reverb.c"
+#include "./Src/leaf-effects.c"
+#include "./Src/leaf-envelopes.c"
+#include "./Src/leaf-analysis.c"
+#include "./Src/leaf-instruments.c"
+#include "./Src/leaf-midi.c"
+#include "./Src/leaf-sampling.c"
+#include "./Src/leaf-physical.c"
+#include "./Src/leaf-electrical.c"
+#include "./Src/leaf.c"
+
+#endif
--- a/LEAF/leaf.h
+++ b/LEAF/leaf.h
@@ -1,3 +1,17 @@
+/** BEGIN_JUCE_MODULE_DECLARATION
+ 
+ ID:            leaf
+ vendor:
+ version:        0.0.1
+ name:
+ description:
+ website:
+ license:        Proprietary
+ 
+ dependencies:
+ 
+ END_JUCE_MODULE_DECLARATION
+ */
 /*
  ==============================================================================
  
--- a/LEAF_JUCEPlugin/LEAF.jucer
+++ b/LEAF_JUCEPlugin/LEAF.jucer
@@ -76,6 +76,7 @@
           <FILE id="Oh72PT" name="leaf-electrical.c" compile="1" resource="0"
                 file="../LEAF/Src/leaf-electrical.c"/>
         </GROUP>
+        <FILE id="XvFyGq" name="leaf.cpp" compile="1" resource="0" file="../LEAF/leaf.cpp"/>
         <FILE id="dmljDQ" name="leaf.h" compile="0" resource="0" file="../LEAF/leaf.h"/>
       </GROUP>
       <GROUP id="{FFA9F0EC-F45A-74FC-5A10-9B3CAA731E7C}" name="External">
--- a/LEAF_JUCEPlugin/Source/MyTest.cpp
+++ b/LEAF_JUCEPlugin/Source/MyTest.cpp
@@ -202,7 +202,7 @@
     {
         buffer[i] = (float)(i*2);
     }
-    leaf_free(buffer);
+    leaf_free((char*)buffer);
     
     leaf_pool_report();