History

split tMinBLEP into tMinBLEPTable and tMinBLEPHandler to help avoid redundant memory usage

Matthew Wang committed 6 years ago

Commit 1c3d6be1 parent 5c365ac3 files · +199 −172Browse files

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

Unified · Split

TestPlugin/Source/MyTest.cpp+13−5
@@ -26,7 +26,7 @@ tEnvelope env; · 25 unmodified lines
2626 tAutotune at;
2727
2828
29−tMinBLEP minblep;
29+tMinBLEPTable minblep;
3030
3131 tPhasor phasor;
3232
@@ -52,11 +52,19 @@ void LEAFTest_init (float sampleRate, int blockSize) · 19 unmodified lines
5252 {
5353 LEAF_init(sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
5454
55− tMBSaw_init(&saw);
55+ int zeroCrossings = 16;
56+ int overSamplingRatio = 32;
5657
57− tMBPulse_init(&pulse);
58+ tMinBLEPTable_init(&minblep, zeroCrossings, overSamplingRatio);
5859
59− tMBTriangle_init(&tri);
60+ tMBSaw_init(&saw, &minblep);
61+ tMBSaw_free(&saw);
62+
63+ tMBPulse_init(&pulse, &minblep);
64+
65+ tMBTriangle_init(&tri, &minblep);
66+ tMBTriangle_free(&tri);
67+ tMBTriangle_init(&tri, &minblep);
6068
6169 tPhasor_init(&phasor);
6270
@@ -85,7 +93,7 @@ float LEAFTest_tick (float input) · 22 unmodified lines
8593
8694 // if (phasor->phaseDidReset) tMBSaw_sync(&saw, 0.0f);
8795 // if (phasor->phaseDidReset) tMBPulse_sync(&pulse, 0.0f);
88− if (phasor->phaseDidReset) tMBTriangle_sync(&tri, 0.0f);
96+// if (phasor->phaseDidReset) tMBTriangle_sync(&tri, 0.0f);
8997
9098 // return tMBSaw_tick(&saw);
9199 // return tMBPulse_tick(&pulse);

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