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