| @@ -30,7 +30,7 @@ void tLockhartWavefolder_init(tLockhartWavefolder* const wf) · 29 unmodified lines |
| 30 | w->xn1 = 0.0f; | 30 | w->xn1 = 0.0f; |
| 31 | } | 31 | } |
| 32 | | 32 | |
| 33 | void tLockhardWavefolder_free(tLockhartWavefolder* const wf) | 33 | void tLockhartWavefolder_free(tLockhartWavefolder* const wf) |
| 34 | { | 34 | { |
| 35 | _tLockhartWavefolder* w = *wf; | 35 | _tLockhartWavefolder* w = *wf; |
| 36 | | 36 | |
| @@ -207,9 +207,9 @@ void tCrusher_setSamplingRatio (tCrusher* const cr, float ratio) · 170 unmodified lines |
| 207 | // Oversampler | 207 | // Oversampler |
| 208 | //============================================================================================================ | 208 | //============================================================================================================ |
| 209 | // Latency is equal to the phase length (numTaps / ratio) | 209 | // 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) |
| 211 | { | 211 | { |
| 212 | _tOversampler* os = *osr = (_tOversampler*) leaf_alloc(sizeof(_tOversampler)); | 212 | // _tOversampler* os = *osr = (_tOversampler*) leaf_alloc(sizeof(_tOversampler)); |
| 213 | | 213 | |
| 214 | uint8_t offset = 0; | 214 | uint8_t offset = 0; |
| 215 | if (extraQuality) offset = 6; | 215 | if (extraQuality) offset = 6; |
| @@ -226,34 +226,34 @@ void tOversampler_init(tOversampler* const osr, int ratio, oBool extraQuality) · 10 unmodified lines |
| 226 | } | 226 | } |
| 227 | } | 227 | } |
| 228 | | 228 | |
| 229 | void tOversampler_free(tOversampler* const osr) | 229 | void tOversampler_free(tOversampler* const os) |
| 230 | { | 230 | { |
| 231 | _tOversampler* os = *osr; | 231 | // _tOversampler* os = *osr; |
| 232 | | 232 | |
| 233 | leaf_free(os->upState); | 233 | leaf_free(os->upState); |
| 234 | leaf_free(os->downState); | 234 | leaf_free(os->downState); |
| 235 | leaf_free(os); | 235 | leaf_free(os); |
| 236 | } | 236 | } |
| 237 | | 237 | |
| 238 | float tOversampler_tick(tOversampler* const osr, float input, float (*effectTick)(float)) | 238 | float tOversampler_tick(tOversampler* const os, float input, float (*effectTick)(float)) |
| 239 | { | 239 | { |
| 240 | _tOversampler* os = *osr; | 240 | // _tOversampler* os = *osr; |
| 241 | | 241 | |
| 242 | float buf[os->ratio]; | 242 | float buf[os->ratio]; |
| 243 | | 243 | |
| 244 | tOversampler_upsample(osr, input, buf); | 244 | tOversampler_upsample(os, input, buf); |
| 245 | | 245 | |
| 246 | for (int i = 0; i < os->ratio; ++i) { | 246 | for (int i = 0; i < os->ratio; ++i) { |
| 247 | buf[i] = effectTick(buf[i]); | 247 | buf[i] = effectTick(buf[i]); |
| 248 | } | 248 | } |
| 249 | | 249 | |
| 250 | return tOversampler_downsample(osr, buf); | 250 | return tOversampler_downsample(os, buf); |
| 251 | } | 251 | } |
| 252 | | 252 | |
| 253 | // From CMSIS DSP Library | 253 | // 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) |
| 255 | { | 255 | { |
| 256 | _tOversampler* os = *osr; | 256 | // _tOversampler* os = *osr; |
| 257 | | 257 | |
| 258 | float *pState = os->upState; /* State pointer */ | 258 | float *pState = os->upState; /* State pointer */ |
| 259 | const float *pCoeffs = os->pCoeffs; /* Coefficient pointer */ | 259 | const float *pCoeffs = os->pCoeffs; /* Coefficient pointer */ |
| @@ -344,9 +344,9 @@ void tOversampler_upsample(tOversampler* const osr, float input, float* output) · 84 unmodified lines |
| 344 | } | 344 | } |
| 345 | | 345 | |
| 346 | // From CMSIS DSP Library | 346 | // From CMSIS DSP Library |
| 347 | float tOversampler_downsample(tOversampler *const osr, float* input) | 347 | float tOversampler_downsample(tOversampler *const os, float* input) |
| 348 | { | 348 | { |
| 349 | _tOversampler* os = *osr; | 349 | // _tOversampler* os = *osr; |
| 350 | | 350 | |
| 351 | float *pState = os->downState; /* State pointer */ | 351 | float *pState = os->downState; /* State pointer */ |
| 352 | const float *pCoeffs = os->pCoeffs; /* Coefficient pointer */ | 352 | const float *pCoeffs = os->pCoeffs; /* Coefficient pointer */ |
| @@ -428,8 +428,8 @@ float tOversampler_downsample(tOversampler *const osr, float* input) · 75 unmodified lines |
| 428 | return output; | 428 | return output; |
| 429 | } | 429 | } |
| 430 | | 430 | |
| 431 | int tOversampler_getLatency(tOversampler* const osr) | 431 | int tOversampler_getLatency(tOversampler* const os) |
| 432 | { | 432 | { |
| 433 | _tOversampler* os = *osr; | 433 | // _tOversampler* os = *osr; |
| 434 | return os->phaseLength; | 434 | return os->phaseLength; |
| 435 | } | 435 | } |