Showing the changes to TestPlugin/Source/MyTest.cpp (1 of 5 files). Show all
Unified · Split
| @@ -25,16 +25,13 @@ tEnvelope env; · 24 unmodified lines | |||
| 25 | 25 | ||
| 26 | tAutotune at; | 26 | tAutotune at; |
| 27 | 27 | ||
| 28 | |||
| 29 | tMinBLEPTable minblep; | ||
| 30 | |||
| 31 | tPhasor phasor; | 28 | tPhasor phasor; |
| 32 | 29 | ||
| 33 | tHighpass hipass; | 30 | tHighpass hipass; |
| 34 | 31 | ||
| 35 | tMBSaw saw; | 32 | tMBSaw bsaw; |
| 36 | tMBPulse pulse; | 33 | tMBTriangle btri; |
| 37 | tMBTriangle tri; | 34 | tMBPulse bpulse; |
| 38 | 35 | ||
| 39 | float gain; | 36 | float gain; |
| 40 | float freq; | 37 | float freq; |
| @@ -45,29 +42,16 @@ float x = 0.0f; · 4 unmodified lines | |||
| 45 | float y = 0.0f; | 42 | float y = 0.0f; |
| 46 | float a, b, c, d; | 43 | float a, b, c, d; |
| 47 | 44 | ||
| 48 | #define MSIZE 500000 | 45 | #define MSIZE 50000 |
| 49 | char memory[MSIZE]; | 46 | char memory[MSIZE]; |
| 50 | 47 | ||
| 51 | void LEAFTest_init (float sampleRate, int blockSize) | 48 | void 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 | ||
| 73 | inline double getSawFall(double angle) { | 57 | inline double getSawFall(double angle) { |
| @@ -81,22 +65,16 @@ inline double getSawFall(double angle) { · 7 unmodified lines | |||
| 81 | 65 | ||
| 82 | float LEAFTest_tick (float input) | 66 | float 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 | ||
| 102 | int firstFrame = 1; | 80 | int 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 | ||