History

minor distortion fixes; revert oversampler to not use mempool for struct

Matthew Wang committed 6 years ago

Commit 373d2741 parent 0a2afe14 files · +18 −18Browse files

Unified · Split

4 files
  1. .DS_Store +0 −0
  2. LEAF/Inc/leaf-distortion.h +2 −2
  3. LEAF/Src/leaf-distortion.c +15 −15
  4. LEAF/leaf.h +2 −2
.DS_Store+0−0

Binary file not shown.

LEAF/Inc/leaf-distortion.h+2−2
@@ -81,9 +81,9 @@ extern "C" { · 80 unmodified lines
8181 float* downState;
8282 int numTaps;
8383 int phaseLength;
84− } _tOversampler;
84+ } tOversampler;
8585
86− typedef _tOversampler* tOversampler;
86+// typedef _tOversampler* tOversampler;
8787
8888 void tOversampler_init(tOversampler* const, int order, oBool extraQuality);
8989 void tOversampler_free(tOversampler* const);
LEAF/Src/leaf-distortion.c+15−15
@@ -30,7 +30,7 @@ void tLockhartWavefolder_init(tLockhartWavefolder* const wf) · 29 unmodified lines
3030 w->xn1 = 0.0f;
3131 }
3232
33−void tLockhardWavefolder_free(tLockhartWavefolder* const wf)
33+void tLockhartWavefolder_free(tLockhartWavefolder* const wf)
3434 {
3535 _tLockhartWavefolder* w = *wf;
3636
@@ -207,9 +207,9 @@ void tCrusher_setSamplingRatio (tCrusher* const cr, float ratio) · 170 unmodified lines
207207 // Oversampler
208208 //============================================================================================================
209209 // Latency is equal to the phase length (numTaps / ratio)
210−void tOversampler_init(tOversampler* const osr, int ratio, oBool extraQuality)
210+void tOversampler_init(tOversampler* const os, int ratio, oBool extraQuality)
211211 {
212− _tOversampler* os = *osr = (_tOversampler*) leaf_alloc(sizeof(_tOversampler));
212+// _tOversampler* os = *osr = (_tOversampler*) leaf_alloc(sizeof(_tOversampler));
213213
214214 uint8_t offset = 0;
215215 if (extraQuality) offset = 6;
@@ -226,34 +226,34 @@ void tOversampler_init(tOversampler* const osr, int ratio, oBool extraQuality) · 10 unmodified lines
226226 }
227227 }
228228
229−void tOversampler_free(tOversampler* const osr)
229+void tOversampler_free(tOversampler* const os)
230230 {
231− _tOversampler* os = *osr;
231+// _tOversampler* os = *osr;
232232
233233 leaf_free(os->upState);
234234 leaf_free(os->downState);
235235 leaf_free(os);
236236 }
237237
238−float tOversampler_tick(tOversampler* const osr, float input, float (*effectTick)(float))
238+float tOversampler_tick(tOversampler* const os, float input, float (*effectTick)(float))
239239 {
240− _tOversampler* os = *osr;
240+// _tOversampler* os = *osr;
241241
242242 float buf[os->ratio];
243243
244− tOversampler_upsample(osr, input, buf);
244+ tOversampler_upsample(os, input, buf);
245245
246246 for (int i = 0; i < os->ratio; ++i) {
247247 buf[i] = effectTick(buf[i]);
248248 }
249249
250− return tOversampler_downsample(osr, buf);
250+ return tOversampler_downsample(os, buf);
251251 }
252252
253253 // From CMSIS DSP Library
254−void tOversampler_upsample(tOversampler* const osr, float input, float* output)
254+void tOversampler_upsample(tOversampler* const os, float input, float* output)
255255 {
256− _tOversampler* os = *osr;
256+// _tOversampler* os = *osr;
257257
258258 float *pState = os->upState; /* State pointer */
259259 const float *pCoeffs = os->pCoeffs; /* Coefficient pointer */
@@ -344,9 +344,9 @@ void tOversampler_upsample(tOversampler* const osr, float input, float* output) · 84 unmodified lines
344344 }
345345
346346 // From CMSIS DSP Library
347−float tOversampler_downsample(tOversampler *const osr, float* input)
347+float tOversampler_downsample(tOversampler *const os, float* input)
348348 {
349− _tOversampler* os = *osr;
349+// _tOversampler* os = *osr;
350350
351351 float *pState = os->downState; /* State pointer */
352352 const float *pCoeffs = os->pCoeffs; /* Coefficient pointer */
@@ -428,8 +428,8 @@ float tOversampler_downsample(tOversampler *const osr, float* input) · 75 unmodified lines
428428 return output;
429429 }
430430
431−int tOversampler_getLatency(tOversampler* const osr)
431+int tOversampler_getLatency(tOversampler* const os)
432432 {
433− _tOversampler* os = *osr;
433+// _tOversampler* os = *osr;
434434 return os->phaseLength;
435435 }
LEAF/leaf.h+2−2
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include ".\Inc\leaf-math.h"
2424 #include ".\Inc\leaf-mempool.h"
2525 #include ".\Inc\leaf-tables.h"
26−#include ".\Inc\leaf-tables.h"
26+#include ".\Inc\leaf-distortion.h"
2727 #include ".\Inc\leaf-oscillators.h"
2828 #include ".\Inc\leaf-filters.h"
2929 #include ".\Inc\leaf-delay.h"
@@ -44,7 +44,7 @@ · 14 unmodified lines
4444 #include "./Inc/leaf-math.h"
4545 #include "./Inc/leaf-mempool.h"
4646 #include "./Inc/leaf-tables.h"
47−#include "./Inc/leaf-tables.h"
47+#include "./Inc/leaf-distortion.h"
4848 #include "./Inc/leaf-oscillators.h"
4949 #include "./Inc/leaf-filters.h"
5050 #include "./Inc/leaf-delay.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t