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
26tAutotune at;26tAutotune at;
27 27
28 28
29tMinBLEP minblep;29tMinBLEPTable minblep;
30 30
31tPhasor phasor;31tPhasor phasor;
32 32
@@ -52,11 +52,19 @@ void LEAFTest_init (float sampleRate, int blockSize) · 19 unmodified lines
52{52{
53 LEAF_init(sampleRate, blockSize, memory, MSIZE, &getRandomFloat);53 LEAF_init(sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
54 54
55 tMBSaw_init(&saw);55 int zeroCrossings = 16;
56 int overSamplingRatio = 32;
56 57
57 tMBPulse_init(&pulse);58 tMinBLEPTable_init(&minblep, zeroCrossings, overSamplingRatio);
58 59
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);
60 68
61 tPhasor_init(&phasor);69 tPhasor_init(&phasor);
62 70
@@ -85,7 +93,7 @@ float LEAFTest_tick (float input) · 22 unmodified lines
85 93
86// if (phasor->phaseDidReset) tMBSaw_sync(&saw, 0.0f);94// if (phasor->phaseDidReset) tMBSaw_sync(&saw, 0.0f);
87// if (phasor->phaseDidReset) tMBPulse_sync(&pulse, 0.0f);95// 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);
89 97
90// return tMBSaw_tick(&saw);98// return tMBSaw_tick(&saw);
91// return tMBPulse_tick(&pulse);99// 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