Showing the changes to TestPlugin/Source/MyTest.cpp (1 of 4 files). Show all
Unified · Split
| @@ -59,11 +59,11 @@ void LEAFTest_init (float sampleRate, int blockSize) · 58 unmodified lines | |||
| 59 | bufIn = (float*) leaf_alloc(sizeof(float) * 4096); | 59 | bufIn = (float*) leaf_alloc(sizeof(float) * 4096); |
| 60 | bufOut = (float*) leaf_alloc(sizeof(float) * 4096); | 60 | bufOut = (float*) leaf_alloc(sizeof(float) * 4096); |
| 61 | 61 | ||
| 62 | tDualPitchDetector_init(&detector, mtof(53), mtof(77)); | 62 | tDualPitchDetector_init(&detector, mtof(48), mtof(84)); |
| 63 | 63 | ||
| 64 | tCompressor_init(&compressor); | 64 | tCompressor_init(&compressor); |
| 65 | 65 | ||
| 66 | tSVF_init(&lp, SVFTypeLowpass, mtof(77) * 2.0f, 1.0f); | 66 | tSVF_init(&lp, SVFTypeLowpass, mtof(84) * 2.0f, 1.0f); |
| 67 | tSVF_init(&hp, SVFTypeHighpass, mtof(48) * 0.5f, 1.0f); | 67 | tSVF_init(&hp, SVFTypeHighpass, mtof(48) * 0.5f, 1.0f); |
| 68 | 68 | ||
| 69 | tPeriodDetection_init(&pd, bufIn, bufOut, 4096, 1024); | 69 | tPeriodDetection_init(&pd, bufIn, bufOut, 4096, 1024); |
| @@ -92,9 +92,9 @@ inline double getSawFall(double angle) { · 22 unmodified lines | |||
| 92 | 92 | ||
| 93 | float LEAFTest_tick (float input) | 93 | float LEAFTest_tick (float input) |
| 94 | { | 94 | { |
| 95 | // tBuffer_tick(&samp, input); | 95 | tBuffer_tick(&samp, input); |
| 96 | // | 96 | |
| 97 | // return tMBSampler_tick(&sampler); | 97 | return tMBSampler_tick(&sampler); |
| 98 | 98 | ||
| 99 | 99 | ||
| 100 | // tMBSaw_setFreq(&bsaw, x); | 100 | // tMBSaw_setFreq(&bsaw, x); |
| @@ -108,22 +108,22 @@ float LEAFTest_tick (float input) · 7 unmodified lines | |||
| 108 | //// return tMBTriangle_tick(&btri); | 108 | //// return tMBTriangle_tick(&btri); |
| 109 | // return tMBPulse_tick(&bpulse); | 109 | // return tMBPulse_tick(&bpulse); |
| 110 | 110 | ||
| 111 | input = tSVF_tick(&hp, tSVF_tick(&lp, tCompressor_tick(&compressor, input))); | 111 | // input = tSVF_tick(&hp, tSVF_tick(&lp, tCompressor_tick(&compressor, input))); |
| 112 | 112 | // | |
| 113 | // float freq = 1.0f/tPeriodDetection_tick(&pd, input) * leaf.sampleRate; | 113 | //// float freq = 1.0f/tPeriodDetection_tick(&pd, input) * leaf.sampleRate; |
| 114 | tDualPitchDetector_tick(&detector, input); | 114 | // tDualPitchDetector_tick(&detector, input); |
| 115 | float altFreq = tDualPitchDetector_getFrequency(&detector); | 115 | // float altFreq = tDualPitchDetector_getFrequency(&detector); |
| 116 | 116 | // | |
| 117 | // if (fabsf(1.0f - (freq / altFreq)) < 0.05f) | 117 | //// if (fabsf(1.0f - (freq / altFreq)) < 0.05f) |
| 118 | // if (tZeroCrossingCounter_tick(&zc, input) < 0.05 && freq > 0.0f) | 118 | //// if (tZeroCrossingCounter_tick(&zc, input) < 0.05 && freq > 0.0f) |
| 119 | if (altFreq > 0.0f) | 119 | // if (altFreq > 0.0f) |
| 120 | { | 120 | // { |
| 121 | tTriangle_setFreq(&tri, altFreq); | 121 | // tTriangle_setFreq(&tri, altFreq); |
| 122 | } | 122 | // } |
| 123 | 123 | // | |
| 124 | float g = tEnvelopeFollower_tick(&ef, input); | 124 | // float g = tEnvelopeFollower_tick(&ef, input); |
| 125 | 125 | // | |
| 126 | return tTriangle_tick(&tri) * g; | 126 | // return tTriangle_tick(&tri) * g; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | int firstFrame = 1; | 129 | int firstFrame = 1; |