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
25 25
26tAutotune at;26tAutotune at;
27 27
28
29tMinBLEPTable minblep;
30
31tPhasor phasor;28tPhasor phasor;
32 29
33tHighpass hipass;30tHighpass hipass;
34 31
35tMBSaw saw;32tMBSaw bsaw;
36tMBPulse pulse;33tMBTriangle btri;
37tMBTriangle tri;34tMBPulse bpulse;
38 35
39float gain;36float gain;
40float freq;37float freq;
@@ -45,29 +42,16 @@ float x = 0.0f; · 4 unmodified lines
45float y = 0.0f;42float y = 0.0f;
46float a, b, c, d;43float a, b, c, d;
47 44
48#define MSIZE 50000045#define MSIZE 50000
49char memory[MSIZE];46char memory[MSIZE];
50 47
51void LEAFTest_init (float sampleRate, int blockSize)48void LEAFTest_init (float sampleRate, int blockSize)
52{49{
53 LEAF_init(sampleRate, blockSize, memory, MSIZE, &getRandomFloat);50 LEAF_init(sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
54 51
55 int zeroCrossings = 16;52 tMBSaw_init(&bsaw);
56 int overSamplingRatio = 32;53 tMBTriangle_init(&btri);
57 54 tMBPulse_init(&bpulse);
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);
71}55}
72 56
73inline double getSawFall(double angle) {57inline double getSawFall(double angle) {
@@ -81,22 +65,16 @@ inline double getSawFall(double angle) { · 7 unmodified lines
81 65
82float LEAFTest_tick (float input)66float LEAFTest_tick (float input)
83{67{
68 tMBSaw_setFreq(&bsaw, x);
69 tMBTriangle_setFreq(&btri, x);
70 tMBPulse_setFreq(&bpulse, x);
84 71
85 tMBSaw_setFreq(&saw, y);72 tMBTriangle_setWidth(&btri, y);
86 tMBPulse_setWidth(&pulse, x);73 tMBPulse_setWidth(&bpulse, y);
87 tMBPulse_setFreq(&pulse, y);74
88 tMBTriangle_setSkew(&tri, 0.0);//x*2.0f - 1.0f);75// return tMBSaw_tick(&bsaw);
89 tMBTriangle_setFreq(&tri, y);76// return tMBTriangle_tick(&btri);
90 77 return tMBPulse_tick(&bpulse);
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);
100}78}
101 79
102int firstFrame = 1;80int firstFrame = 1;
@@ -112,7 +90,7 @@ void LEAFTest_block (void) · 9 unmodified lines
112 90
113 float val = getSliderValue("mod freq");91 float val = getSliderValue("mod freq");
114 92
115 x = val ;93 x = val * 20000.0f + 220.0f;
116 94
117 // a = val * tBuffer_getBufferLength(&buff);95 // a = val * tBuffer_getBufferLength(&buff);
118 96
@@ -120,8 +98,7 @@ void LEAFTest_block (void) · 1 unmodified line
120 98
121 val = getSliderValue("mod depth");99 val = getSliderValue("mod depth");
122 100
123 y = val * 5000.0f + 20.0f;101 y = val * 2.0f - 1.0f;
124
125 DBG(String(y));102 DBG(String(y));
126 // b = val * tBuffer_getBufferLength(&buff);103 // b = val * tBuffer_getBufferLength(&buff);
127 104

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