shithub: leaf

Download patch

ref: 978a64fc4e52a85ef45f824d9d36e390c0a3a8e2
parent: 42af6890fc3c8e454a7599b92bfdf26f81d5ab90
author: Jeffrey Snyder <jeffsnyder@jeffreys-mbp.mynetworksettings.com>
date: Tue Aug 30 10:06:08 EDT 2022

optimizing things

--- a/leaf/Inc/leaf-math.h
+++ b/leaf/Inc/leaf-math.h
@@ -235,8 +235,16 @@
     
     float median3f(float a, float b, float c);
 
-    void place_step_dd(float *buffer, int index, float phase, float w, float scale);
-    void place_slope_dd(float *buffer, int index, float phase, float w, float slope_delta);
+#ifdef ITCMRAM
+void __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) place_step_dd(float *buffer, int index, float phase, float w, float scale);
+#else
+void place_step_dd(float *buffer, int index, float phase, float w, float scale);
+#endif
+#ifdef ITCMRAM
+void __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) place_slope_dd(float *buffer, int index, float phase, float w, float slope_delta);
+#else
+void place_slope_dd(float *buffer, int index, float phase, float w, float slope_delta);
+#endif
     //==============================================================================
     
 #ifdef __cplusplus
--- a/leaf/Inc/leaf-oscillators.h
+++ b/leaf/Inc/leaf-oscillators.h
@@ -674,7 +674,9 @@
     //==============================================================================
     
     
-#define FILLEN 256
+#define FILLEN 128 //was 256 in dekrispator code, but it seems like it just needs to be longer than dd step length (72) and probably a power of 2.
+    // smaller buffer means refilling more often but a less intense load each time it refills
+
     
     /*!
      @defgroup tmbpulse tMBPulse
@@ -799,7 +801,7 @@
         float    sync;
         float    syncdir;
         int      softsync;
-        float   _p, _w, _b, _z;
+        float   _p, _w, _b, _z, quarterwaveoffset;
         int     _j, _k;
         float   _f [FILLEN + LONGEST_DD_PULSE_LENGTH];
         float invSampleRate;
@@ -954,7 +956,9 @@
     void tMBSawPulse_initToPool(tMBSawPulse* const osc, tMempool* const mempool);
     void tMBSawPulse_free(tMBSawPulse* const osc);
 
+
     float tMBSawPulse_tick(tMBSawPulse* const osc);
+    float tMBSawPulse_sync(tMBSawPulse* const osc, float value);
     void tMBSawPulse_setFreq(tMBSawPulse* const osc, float f);
     float tMBSawPulse_sync(tMBSawPulse* const osc, float sync);
     void tMBSawPulse_setPhase(tMBSawPulse* const osc, float phase);
--- a/leaf/Inc/leaf-sampling.h
+++ b/leaf/Inc/leaf-sampling.h
@@ -451,8 +451,9 @@
      @param sampler A pointer to the relevant tMBSampler.
      
      @} */
-    
-#define FILLEN 256
+#ifndef FILLEN
+#define FILLEN 128
+#endif
 
     typedef struct _tMBSampler
     {
--- a/leaf/Inc/leaf-tables.h
+++ b/leaf/Inc/leaf-tables.h
@@ -114,7 +114,7 @@
     
     /* in minblep_tables.c: */
     extern const float_value_delta step_dd_table[];
-    extern const float             slope_dd_table[];
+    extern const  float             slope_dd_table[];
     
     /*! @} */
     
--- a/leaf/Src/leaf-distortion.c
+++ b/leaf/Src/leaf-distortion.c
@@ -124,7 +124,11 @@
 }
 
 // From CMSIS DSP Library
+#ifdef ITCMRAM
+void __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) tOversampler_upsample(tOversampler* const osr, float input, float* output)
+#else
 void tOversampler_upsample(tOversampler* const osr, float input, float* output)
+#endif
 {
     _tOversampler* os = *osr;
     
@@ -223,7 +227,11 @@
 }
 
 // From CMSIS DSP Library
+#ifdef ITCMRAM
+float __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) tOversampler_downsample(tOversampler *const osr, float* input)
+#else
 float tOversampler_downsample(tOversampler *const osr, float* input)
+#endif
 {
     _tOversampler* os = *osr;
     
@@ -613,6 +621,7 @@
 // CRUSHER
 //============================================================================================================
 #define SCALAR 5000.f
+#define INV_SCALAR 0.0002f
 
 void tCrusher_init (tCrusher* const cr, LEAF* const leaf)
 {
@@ -680,7 +689,7 @@
     
     c->div = 0.01f + val * SCALAR;
     
-    c->gain = (c->div / SCALAR) * 0.7f + 0.3f;
+    c->gain = (c->div * INV_SCALAR) * 0.7f + 0.3f;
 }
 
 // what decimal to round to
@@ -687,7 +696,7 @@
 void    tCrusher_setRound (tCrusher* const cr, float rnd)
 {
     _tCrusher* c = *cr;
-    c->rnd = fabsf(rnd);
+    c->rnd = rnd;
 }
 
 void    tCrusher_setSamplingRatio (tCrusher* const cr, float ratio)
@@ -695,5 +704,4 @@
     _tCrusher* c = *cr;
     c->srr = ratio;
     tSampleReducer_setRatio(&c->sReducer, ratio);
-
 }
--- a/leaf/Src/leaf-math.c
+++ b/leaf/Src/leaf-math.c
@@ -323,7 +323,7 @@
     
     float scale = 1.f / rnd;
     
-    return roundf(input * scale) / scale;
+    return roundf(input * scale) * rnd;
 }
 
 
@@ -365,7 +365,11 @@
     }
 }
 
-float   LEAF_clip(float min, float val, float max)
+#ifdef ITCMRAM
+float __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) LEAF_clip(float min, float val, float max)
+#else
+float LEAF_clip(float min, float val, float max)
+#endif
 {
     float tempmin = min;
     float tempmax = max;
@@ -566,7 +570,9 @@
 }
 
 //
-void LEAF_generate_table_skew_non_sym(float* buffer, float start, float end, float center, int size)
+
+
+void LEAF_generate_table_skew_non_sym_double(float* buffer, float start, float end, float center, int size)
 {
     double skew = log (0.5) / log ((center - start) / (end - start));
     double increment = 1.0 / (double)(size-1);
@@ -581,6 +587,21 @@
 }
 
 
+void LEAF_generate_table_skew_non_sym(float* buffer, float start, float end, float center, int size)
+{
+    float skew = logf (0.5) / logf ((center - start) / (end - start));
+    float increment = 1.0 / (float)(size-1);
+    float x = 0.0;
+    float proportion = 0.0;
+    for (int i = 0; i < size; i++)
+    {
+        proportion = expf (logf(x) / skew);
+        buffer[i] = (float)(start + (end - start) * proportion);
+        x += increment;
+    }
+}
+
+
 void LEAF_generate_atodb(float* buffer, int size)
 {
     float increment = 1.0f / (float)(size-1);
@@ -846,40 +867,48 @@
 #if LEAF_INCLUDE_MINBLEP_TABLES
 /// MINBLEPS
 // https://github.com/MrBlueXav/Dekrispator_v2 blepvco.c
+#ifdef ITCMRAM
+void __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) place_step_dd(float *buffer, int index, float phase, float w, float scale)
+#else
 void place_step_dd(float *buffer, int index, float phase, float w, float scale)
-    {
-        float r;
-        long i;
+#endif
+{
+	float r;
+	long i;
 
-        r = MINBLEP_PHASES * phase / w;
-        i = lrintf(r - 0.5f);
-        r -= (float)i;
-        i &= MINBLEP_PHASE_MASK;  /* extreme modulation can cause i to be out-of-range */
+	r = MINBLEP_PHASES * phase / w;
+	i = lrintf(r - 0.5f);
+	r -= (float)i;
+	i &= MINBLEP_PHASE_MASK;  /* extreme modulation can cause i to be out-of-range */
 
-        while (i < MINBLEP_PHASES * STEP_DD_PULSE_LENGTH) {
-            buffer[index] += scale * (step_dd_table[i].value + r * step_dd_table[i].delta);
-            i += MINBLEP_PHASES;
-            index++;
-        }
-    }
+	while (i < MINBLEP_PHASES * STEP_DD_PULSE_LENGTH) {
+		buffer[index] += scale * (step_dd_table[i].value + r * step_dd_table[i].delta);
+		i += MINBLEP_PHASES;
+		index++;
+	}
+}
+#ifdef ITCMRAM
+void __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) place_slope_dd(float *buffer, int index, float phase, float w, float slope_delta)
+#else
 void place_slope_dd(float *buffer, int index, float phase, float w, float slope_delta)
-	{
-		float r;
-		long i;
+#endif
+{
+	float r;
+	long i;
 
-		r = MINBLEP_PHASES * phase / w;
-		i = lrintf(r - 0.5f);
-		r -= (float)i;
-		i &= MINBLEP_PHASE_MASK;  /* extreme modulation can cause i to be out-of-range */
+	r = MINBLEP_PHASES * phase / w;
+	i = lrintf(r - 0.5f);
+	r -= (float)i;
+	i &= MINBLEP_PHASE_MASK;  /* extreme modulation can cause i to be out-of-range */
 
-		slope_delta *= w;
+	slope_delta *= w;
 
-		while (i < MINBLEP_PHASES * SLOPE_DD_PULSE_LENGTH) {
-			buffer[index] += slope_delta * (slope_dd_table[i] + r * (slope_dd_table[i + 1] - slope_dd_table[i]));
-			i += MINBLEP_PHASES;
-			index++;
-		}
+	while (i < MINBLEP_PHASES * SLOPE_DD_PULSE_LENGTH) {
+		buffer[index] += slope_delta * (slope_dd_table[i] + r * (slope_dd_table[i + 1] - slope_dd_table[i]));
+		i += MINBLEP_PHASES;
+		index++;
 	}
+}
 #endif // LEAF_INCLUDE_MINBLEP_TABLES
     /*! @} */
 
--- a/leaf/Src/leaf-oscillators.c
+++ b/leaf/Src/leaf-oscillators.c
@@ -16,6 +16,8 @@
 
 #endif
 
+
+
 #if LEAF_INCLUDE_SINE_TABLE
 // Cycle
 void    tCycle_init(tCycle* const cy, LEAF* const leaf)
@@ -1249,6 +1251,7 @@
     c->_j = 0;
     c->_p = 0.0f;  /* phase [0, 1) */
     c->_w = c->freq * c->invSampleRate;  /* phase increment */
+    c->quarterwaveoffset = c->_w * 0.25f;
     c->_b = 0.5f * (1.0f + c->waveform);  /* duty cycle (0, 1) */
     c->_k = 0.0f;  /* output state, 0 = high (0.5f), 1 = low (-0.5f) */
     memset (c->_f, 0, (FILLEN + STEP_DD_PULSE_LENGTH) * sizeof (float));
@@ -1286,7 +1289,7 @@
     invB1 = 1.0f / b1;
     if (sync > 0.0f && c->softsync > 0) c->syncdir = -c->syncdir;
     
-    sw = w * c->syncdir;
+    sw = w * c->syncdir + c->quarterwaveoffset;
     p += sw - (int)sw;
     
     if (sync > 0.0f && c->softsync == 0) {  /* sync to master */
@@ -1478,6 +1481,7 @@
     _tMBTriangle* c = *osc;
     c->freq = f;
     c->_w = c->freq * c->invSampleRate;  /* phase increment */
+    c->quarterwaveoffset = c->_w * 0.25f;
 }
 
 void tMBTriangle_setWidth(tMBTriangle* const osc, float w)
@@ -1742,8 +1746,11 @@
 
 
 
-
+#ifdef ITCMRAM
+float __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32))) tMBSawPulse_tick(tMBSawPulse* const osc)
+#else
 float tMBSawPulse_tick(tMBSawPulse* const osc)
+#endif
 {
     _tMBSawPulse* c = *osc;
 
@@ -1982,7 +1989,11 @@
     c->_w = c->freq * c->invSampleRate;  /* phase increment */
 }
 
+#ifdef ITCMRAM
+float __attribute__ ((section(".itcmram"))) __attribute__ ((aligned (32)))  tMBSawPulse_sync(tMBSawPulse* const osc, float value)
+#else
 float tMBSawPulse_sync(tMBSawPulse* const osc, float value)
+#endif
 {
     _tMBSawPulse* c = *osc;
 
--- a/leaf/Src/leaf-tables.c
+++ b/leaf/Src/leaf-tables.c
@@ -10043,7 +10043,7 @@
 .036462f, 4.034971f, 4.033481f, 4.031992f, 4.030504f, 4.029018f, 4.027532f, 4.026047f, 4.024564f, 4.023082f, 4.0216f, 4.02012f, 4.018641f, 4.017163f,
 4.015686f, 4.01421f, 4.012736f, 4.011262f, 4.00979f, 4.008318f, 4.006848f, 4.005378f, 4.00391f, 4.002443f, 4.000977f, 3.999512f, 3.998048f, 3.996585f, 3.995123f, 3.993662f, 3.992203f, 3.990744f, 3.989287f, 3.98783f,
 3.986375f, 3.98492f, 3.983467f, 3.982015f, 3.980564f, 3.979114f, 3.977664f, 3.976216f, 3.97477f, 3.973324f, 3.971879f, 3.970435f, 3.968992f, 3.967551f, 3.96611f, 3.96467f, 3.963232f, 3.961794f, 3.960358f, 3.958922f,
-22f, 3.953191f, 3.951761f, 3.950332f, 3.948903f, 3.947476f, 3.94605f, 3.944625f, 3.943201f, 3.941778f, 3.940356f, 3.938935f, 3.937515f, 3.936096f, 3.934678f, 3.933261f, 3.931845f, 3.930431f,
+22f, 3.953191f, 3.951761f, 3.950332f, 3.948903f, 3.947476f, 3.94605f, 3.944625f, 3.943201f, 3.941778f, 3.940356f, 3.938935f, 3.937515f, 3.936096f, 3.934678f, 3.933261f, 3.931845f, 3.930431f,
  3.953191f, 3.951761f, 3.950332f, 3.948903f, 3.947476f, 3.94605f, 3.944625f, 3.943201f, 3.941778f, 3.940356f, 3.938935f, 3.937515f, 3.936096f, 3.934678f, 3.933261f, 3.931845f, 3.930431f,
 3.929017f, 3.927604f, 3.926192f, 3.924781f, 3.923372f, 3.921963f, 3.920555f, 3.919148f, 3.917743f, 3.916338f, 3.914934f, 3.913532f, 3.91213f, 3.910729f, 3.90933f, 3.907931f, 3.906533f, 3.905136f, 3.903741f, 3.902346f,
 3.900952f, 3.89956f, 3.898168f, 3.896777f, 3.895388f, 3.893999f, 3.892611f, 3.891224f, 3.889839f, 3.888454f, 3.88707f, 3.885687f, 3.884305f, 3.882925f, 3.881545f, 3.880166f, 3.878788f, 3.877411f, 3.876035f, 3.87466f,
@@ -10253,7 +10253,7 @@
 597815f, 1.597582f, 1.597348f, 1.597115f,
 1.596881f, 1.596648f, 1.596414f, 1.596181f, 1.595948f, 1.595715f, 1.595482f, 1.595249f, 1.595016f, 1.594783f, 1.59455f, 1.594317f, 1.594084f, 1.593852f, 1.593619f, 1.593387f, 1.593154f, 1.592922f, 1.59269f, 1.592458f,
 1.592225f, 1.591993f, 1.591761f, 1.591529f, 1.591298f, 1.591066f, 1.590834f, 1.590602f, 1.590371f, 1.590139f, 1.589908f, 1.589676f, 1.589445f, 1.589214f, 1.588983f, 1.588752f, 1.58852f, 1.588289f, 1.588059f, 1.587828f,
-f, 1.584833f, 1.584603f, 1.584373f, 1.584143f, 1.583913f, 1.583684f, 1.583454f, 1.583225f,
+ 1.584373f, 1.584143f, 1.583913f, 1.583684f, 1.583454f, 1.583225f,
 .584833f, 1.584603f, 1.584373f, 1.584143f, 1.583913f, 1.583684f, 1.583454f, 1.583225f,
 1.582995f, 1.582766f, 1.582536f, 1.582307f, 1.582078f, 1.581849f, 1.58162f, 1.581391f, 1.581162f, 1.580933f, 1.580704f, 1.580476f, 1.580247f, 1.580018f, 1.57979f, 1.579561f, 1.579333f, 1.579105f, 1.578876f, 1.578648f,
 1.57842f, 1.578192f, 1.577964f, 1.577736f, 1.577508f, 1.57728f, 1.577053f, 1.576825f, 1.576597f, 1.57637f, 1.576142f, 1.575915f, 1.575688f, 1.57546f, 1.575233f, 1.575006f, 1.574779f, 1.574552f, 1.574325f, 1.574098f,
@@ -10462,7 +10462,7 @@
 924631f, 0.924553f, 0.924475f, 0.924396f, 0.924318f, 0.92424f, 0.924162f,
 0.924083f, 0.924005f, 0.923927f, 0.923849f, 0.923771f, 0.923693f, 0.923615f, 0.923537f, 0.923458f, 0.92338f, 0.923302f, 0.923224f, 0.923146f, 0.923068f, 0.92299f, 0.922912f, 0.922834f, 0.922756f, 0.922678f, 0.9226f,
 0.922523f, 0.922445f, 0.922367f, 0.922289f, 0.922211f, 0.922133f, 0.922055f, 0.921977f, 0.9219f, 0.921822f, 0.921744f, 0.921666f, 0.921588f, 0.921511f, 0.921433f, 0.921355f, 0.921278f, 0.9212f, 0.921122f, 0.921044f,
-f, 0.918257f, 0.91818f, 0.918103f, 0.918025f, 0.917948f,
+917948f,
  0.916562f, 0.916485f, 0.916408f,
 0.916331f, 0.916254f, 0.916177f, 0.916101f, 0.916024f, 0.915947f, 0.91587f, 0.915793f, 0.915717f, 0.91564f, 0.915563f, 0.915486f, 0.91541f, 0.915333f, 0.915256f, 0.915179f, 0.915103f, 0.915026f, 0.914949f, 0.914873f,
 0.914796f, 0.91472f, 0.914643f, 0.914566f, 0.91449f, 0.914413f, 0.914337f, 0.91426f, 0.914184f, 0.914107f, 0.914031f, 0.913954f, 0.913878f, 0.913801f, 0.913725f, 0.913648f, 0.913572f, 0.913496f, 0.913419f, 0.913343f,
@@ -13950,7 +13950,7 @@
 f, -0.932868f, -0.93286f, -0.932852f, -0.932844f, -0.932836f, -0.932828f, -0.93282f, -0.932812f, -0.932805f, -0.932797f, -0.932789f, -0.932781f, -0.932773f, -0.932765f, -0.932757f, -0.932749f, -0.932741f, -0.932733f,
 -0.932725f, -0.932717f, -0.932709f, -0.932701f, -0.932693f, -0.932685f, -0.932678f, -0.93267f, -0.932662f, -0.932654f, -0.932646f, -0.932638f, -0.93263f, -0.932622f, -0.932614f, -0.932606f, -0.932598f, -0.93259f, -0.932582f, -0.932574f,
 -0.932566f, -0.932558f, -0.93255f, -0.932542f, -0.932534f, -0.932526f, -0.932519f, -0.932511f, -0.932503f, -0.932495f, -0.932487f, -0.932479f, -0.932471f, -0.932463f, -0.932455f, -0.932447f, -0.932439f, -0.932431f, -0.932423f, -0.932415f,
-, -0.932431f, -0.932423f, -0.932415f,
+, -0.932431f, -0.932423f, -0.932415f,
 19f, -0.932311f, -0.932303f, -0.932295f, -0.932287f, -0.932279f, -0.932271f, -0.932263f, -0.932255f,
 -0.932247f, -0.932239f, -0.932231f, -0.932223f, -0.932215f, -0.932207f, -0.932199f, -0.932191f, -0.932183f, -0.932175f, -0.932167f, -0.932159f, -0.932151f, -0.932143f, -0.932135f, -0.932127f, -0.932119f, -0.932111f, -0.932103f, -0.932095f,
 -0.932087f, -0.932079f, -0.932071f, -0.932063f, -0.932055f, -0.932047f, -0.932039f, -0.932031f, -0.932023f, -0.932015f, -0.932007f, -0.931999f, -0.931991f, -0.931983f, -0.931975f, -0.931967f, -0.931959f, -0.931951f, -0.931943f, -0.931935f,
@@ -14057,7 +14057,7 @@
 916861f, -0.916851f, -0.916841f, -0.916831f, -0.916822f, -0.916812f, -0.916802f, -0.916793f, -0.916783f, -0.916773f, -0.916763f, -0.916754f, -0.916744f, -0.916734f, -0.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,
-32f, -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.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,
 -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,
@@ -14086,8 +14086,7 @@
 -0.915715f,
 -0.915705f, -0.915695f, -0.915686f, -0.915676f, -0.915666f, -0.915656f, -0.915646f, -0.915636f, -0.915626f, -0.915617f, -0.915607f, -0.915597f, -0.915587f, -0.915577f, -0.915567f, -0.915557f, -0.915547f, -0.915538f, -0.915528f, -0.915518f,
 -0.915508f, -0.915498f, -0.915488f, -0.915478f, -0.915468f, -0.915459f, -0.915449f, -0.915439f, -0.915429f, -0.915419f, -0.915409f, -0.915399f, -0.915389f, -0.915379f, -0.91537f, -0.91536f, -0.91535f, -0.91534f, -0.91533f, -0.91532f,
- -0.915666f, -0.915656f, -0.915646f, -0.915636f, -0.915626f, -0.915617f, -0.915607f, -0.915597f, -0.915587f, -0.915577f, -0.915567f, -0.915557f, -0.915547f, -0.915538f, -0.915528f, -0.915518f,
--0.915508f, -0.915498f, -0.915488f, -0.915478f, -0.915468f, -0.915459f, -0.915449f, -0.915439f, -0.915429f, -0.915419f, -0.915409f, -0.915399f, -0.915389f, -0.915379f, -0.91537f, -0.91536f, -0.91535f, -0.91534f, -0.91533f, -0.91532f,
+ -0.915626f, -0.915617f, -0.915607f, -0.915597f, -0.915587f, -0.915577f, -0.915567f, -0.915557f, -0.915547f, -0.915538f, -0.915528f, -0.915518f,
 .915646f, -0.915636f, -0.915626f, -0.915617f, -0.915607f, -0.915597f, -0.915587f, -0.915577f, -0.915567f, -0.915557f, -0.915547f, -0.915538f, -0.915528f, -0.915518f,
 -0.915508f, -0.915498f, -0.915488f, -0.915478f, -0.915468f, -0.915459f, -0.915449f, -0.915439f, -0.915429f, -0.915419f, -0.915409f, -0.915399f, -0.915389f, -0.915379f, -0.91537f, -0.91536f, -0.91535f, -0.91534f, -0.91533f, -0.91532f,
 -0.91531f, -0.9153f, -0.91529f, -0.91528f, -0.915271f, -0.915261f, -0.915251f, -0.915241f, -0.915231f, -0.915221f, -0.915211f, -0.915201f, -0.915191f, -0.915181f, -0.915171f, -0.915162f, -0.915152f, -0.915142f, -0.915132f, -0.915122f,
@@ -15243,7 +15242,7 @@
 63f, -0.67523f, -0.675197f, -0.675164f, -0.67513f, -0.675097f, -0.675064f, -0.675031f, -0.674998f, -0.674964f, -0.674931f, -0.674898f, -0.674865f,
 -0.674831f, -0.674798f, -0.674765f, -0.674732f, -0.674698f, -0.674665f, -0.674632f, -0.674599f, -0.674565f, -0.674532f, -0.674499f, -0.674466f, -0.674432f, -0.674399f, -0.674366f, -0.674333f, -0.674299f, -0.674266f, -0.674233f, -0.674199f,
 -0.674166f, -0.674133f, -0.674099f, -0.674066f, -0.674033f, -0.674f, -0.673966f, -0.673933f, -0.6739f, -0.673866f, -0.673833f, -0.6738f, -0.673766f, -0.673733f, -0.6737f, -0.673666f, -0.673633f, -0.6736f, -0.673566f, -0.673533f,
-66f, -0.674432f, -0.674399f, -0.674366f, -0.674333f, -0.674299f, -0.674266f, -0.674233f, -0.674199f,
+333f, -0.674299f, -0.674266f, -0.674233f, -0.674199f,
  -0.674432f, -0.674399f, -0.674366f, -0.674333f, -0.674299f, -0.674266f, -0.674233f, -0.674199f,
 -0.674166f, -0.674133f, -0.674099f, -0.674066f, -0.674033f, -0.674f, -0.673966f, -0.673933f, -0.6739f, -0.673866f, -0.673833f, -0.6738f, -0.673766f, -0.673733f, -0.6737f, -0.673666f, -0.673633f, -0.6736f, -0.673566f, -0.673533f,
 -0.6735f, -0.673466f, -0.673433f, -0.6734f, -0.673366f, -0.673333f, -0.673299f, -0.673266f, -0.673233f, -0.673199f, -0.673166f, -0.673133f, -0.673099f, -0.673066f, -0.673032f, -0.672999f, -0.672966f, -0.672932f, -0.672899f, -0.672865f,
@@ -15817,5 +15816,5 @@
 0.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,
-.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.44386f, -0.443811f, -0.443762f, -0.443713f, -0.443664f, -0.443615f, -0.443566f, -0.443517f,
 154f, -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,
--- a/leaf/leaf-config.h
+++ b/leaf/leaf-config.h
@@ -66,6 +66,10 @@
 #define LEAF_USE_DYNAMIC_ALLOCATION 0
 #endif
 
+#ifndef _CONSTANT_DATA_LOCATION
+#define _CONSTANT_DATA_LOCATION
+#endif
+
 //==============================================================================
 
 #endif // LEAF_CONFIG_H_INCLUDED