History

replaced minblep implementation

Matthew Wang committed 6 years ago

Commit dc28b781 parent 4e40b215 files · +2400 −938Browse files

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

Unified · Split

TestPlugin/Source/MyTest.cpp+18−41
@@ -25,16 +25,13 @@ tEnvelope env; · 24 unmodified lines
2525
2626 tAutotune at;
2727
28−
29−tMinBLEPTable minblep;
30−
3128 tPhasor phasor;
3229
3330 tHighpass hipass;
3431
35−tMBSaw saw;
36−tMBPulse pulse;
37−tMBTriangle tri;
32+tMBSaw bsaw;
33+tMBTriangle btri;
34+tMBPulse bpulse;
3835
3936 float gain;
4037 float freq;
@@ -45,29 +42,16 @@ float x = 0.0f; · 4 unmodified lines
4542 float y = 0.0f;
4643 float a, b, c, d;
4744
48−#define MSIZE 500000
45+#define MSIZE 50000
4946 char memory[MSIZE];
5047
5148 void LEAFTest_init (float sampleRate, int blockSize)
5249 {
5350 LEAF_init(sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
5451
55− int zeroCrossings = 16;
56− int overSamplingRatio = 32;
57−
58− tMinBLEPTable_init(&minblep, zeroCrossings, overSamplingRatio);
59−
60− tMBSaw_init(&saw, &minblep);
61−
62− tMBPulse_init(&pulse, &minblep);
63−
64− tMBTriangle_init(&tri, &minblep);
65− tMBTriangle_free(&tri);
66− tMBTriangle_init(&tri, &minblep);
67−
68− tPhasor_init(&phasor);
69−
70− tPhasor_setFreq(&phasor, 200);
52+ tMBSaw_init(&bsaw);
53+ tMBTriangle_init(&btri);
54+ tMBPulse_init(&bpulse);
7155 }
7256
7357 inline double getSawFall(double angle) {
@@ -81,22 +65,16 @@ inline double getSawFall(double angle) { · 7 unmodified lines
8165
8266 float LEAFTest_tick (float input)
8367 {
68+ tMBSaw_setFreq(&bsaw, x);
69+ tMBTriangle_setFreq(&btri, x);
70+ tMBPulse_setFreq(&bpulse, x);
8471
85− tMBSaw_setFreq(&saw, y);
86− tMBPulse_setWidth(&pulse, x);
87− tMBPulse_setFreq(&pulse, y);
88− tMBTriangle_setSkew(&tri, 0.0);//x*2.0f - 1.0f);
89− tMBTriangle_setFreq(&tri, y);
90−
91− tPhasor_tick(&phasor);
92−
93−// if (phasor->phaseDidReset) tMBSaw_sync(&saw, 0.0f);
94−// if (phasor->phaseDidReset) tMBPulse_sync(&pulse, 0.0f);
95−// if (phasor->phaseDidReset) tMBTriangle_sync(&tri, 0.0f);
96−
97− return tMBSaw_tick(&saw);
98−// return tMBPulse_tick(&pulse);
99−// return tMBTriangle_tick(&tri);
72+ tMBTriangle_setWidth(&btri, y);
73+ tMBPulse_setWidth(&bpulse, y);
74+
75+// return tMBSaw_tick(&bsaw);
76+// return tMBTriangle_tick(&btri);
77+ return tMBPulse_tick(&bpulse);
10078 }
10179
10280 int firstFrame = 1;
@@ -112,7 +90,7 @@ void LEAFTest_block (void) · 9 unmodified lines
11290
11391 float val = getSliderValue("mod freq");
11492
115− x = val ;
93+ x = val * 20000.0f + 220.0f;
11694
11795 // a = val * tBuffer_getBufferLength(&buff);
11896
@@ -120,8 +98,7 @@ void LEAFTest_block (void) · 1 unmodified line
12098
12199 val = getSliderValue("mod depth");
122100
123− y = val * 5000.0f + 20.0f;
124−
101+ y = val * 2.0f - 1.0f;
125102 DBG(String(y));
126103 // b = val * tBuffer_getBufferLength(&buff);
127104

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