History

improving minblep sampler

Matthew Wang committed 6 years ago

Commit 17913831 parent ab484c74 files · +111 −60Browse files

Showing the changes to TestPlugin/Source/MyTest.cpp (1 of 4 files). Show all

Unified · Split

TestPlugin/Source/MyTest.cpp+21−21
@@ -59,11 +59,11 @@ void LEAFTest_init (float sampleRate, int blockSize) · 58 unmodified lines
5959 bufIn = (float*) leaf_alloc(sizeof(float) * 4096);
6060 bufOut = (float*) leaf_alloc(sizeof(float) * 4096);
6161
62− tDualPitchDetector_init(&detector, mtof(53), mtof(77));
62+ tDualPitchDetector_init(&detector, mtof(48), mtof(84));
6363
6464 tCompressor_init(&compressor);
6565
66− tSVF_init(&lp, SVFTypeLowpass, mtof(77) * 2.0f, 1.0f);
66+ tSVF_init(&lp, SVFTypeLowpass, mtof(84) * 2.0f, 1.0f);
6767 tSVF_init(&hp, SVFTypeHighpass, mtof(48) * 0.5f, 1.0f);
6868
6969 tPeriodDetection_init(&pd, bufIn, bufOut, 4096, 1024);
@@ -92,9 +92,9 @@ inline double getSawFall(double angle) { · 22 unmodified lines
9292
9393 float LEAFTest_tick (float input)
9494 {
95−// tBuffer_tick(&samp, input);
96−//
97−// return tMBSampler_tick(&sampler);
95+ tBuffer_tick(&samp, input);
96+
97+ return tMBSampler_tick(&sampler);
9898
9999
100100 // tMBSaw_setFreq(&bsaw, x);
@@ -108,22 +108,22 @@ float LEAFTest_tick (float input) · 7 unmodified lines
108108 //// return tMBTriangle_tick(&btri);
109109 // return tMBPulse_tick(&bpulse);
110110
111− input = tSVF_tick(&hp, tSVF_tick(&lp, tCompressor_tick(&compressor, input)));
112−
113−// float freq = 1.0f/tPeriodDetection_tick(&pd, input) * leaf.sampleRate;
114− tDualPitchDetector_tick(&detector, input);
115− float altFreq = tDualPitchDetector_getFrequency(&detector);
116−
117−// if (fabsf(1.0f - (freq / altFreq)) < 0.05f)
118−// if (tZeroCrossingCounter_tick(&zc, input) < 0.05 && freq > 0.0f)
119− if (altFreq > 0.0f)
120− {
121− tTriangle_setFreq(&tri, altFreq);
122− }
123−
124− float g = tEnvelopeFollower_tick(&ef, input);
125−
126− return tTriangle_tick(&tri) * g;
111+// input = tSVF_tick(&hp, tSVF_tick(&lp, tCompressor_tick(&compressor, input)));
112+//
113+//// float freq = 1.0f/tPeriodDetection_tick(&pd, input) * leaf.sampleRate;
114+// tDualPitchDetector_tick(&detector, input);
115+// float altFreq = tDualPitchDetector_getFrequency(&detector);
116+//
117+//// if (fabsf(1.0f - (freq / altFreq)) < 0.05f)
118+//// if (tZeroCrossingCounter_tick(&zc, input) < 0.05 && freq > 0.0f)
119+// if (altFreq > 0.0f)
120+// {
121+// tTriangle_setFreq(&tri, altFreq);
122+// }
123+//
124+// float g = tEnvelopeFollower_tick(&ef, input);
125+//
126+// return tTriangle_tick(&tri) * g;
127127 }
128128
129129 int firstFrame = 1;

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