Showing the changes to TestPlugin/Source/MyTest.cpp (1 of 5 files). Show all
Unified · Split
| @@ -33,12 +33,12 @@ tButterworth bw; · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | tWaveTable wt; |
| 35 | 35 | tWaveTableS cwt; |
| 36 | −tWaveSynth ws; | |
| 36 | +tWaveOsc ws; | |
| 37 | 37 | |
| 38 | 38 | tBuffer samp; |
| 39 | 39 | tMBSampler sampler; |
| 40 | 40 | |
| 41 | −const int numWavetables = 1; | |
| 41 | +const int numWavetables = 4; | |
| 42 | 42 | tWaveTable wavetables[numWavetables]; |
| 43 | 43 | tSimpleRetune retune; |
| 44 | 44 | |
| @@ -80,13 +80,12 @@ void LEAFTest_init (float sampleRate, int blockSize) · 35 unmodified lines | ||
| 80 | 80 | tPhasor_init(&phasor, &leaf); |
| 81 | 81 | tPhasor_setFreq(&phasor, 220.f); |
| 82 | 82 | |
| 83 | − float* set[4]; | |
| 84 | − set[0] = (float*)__leaf_table_sinewave; | |
| 85 | − set[1] = (float*)__leaf_table_triangle[0]; | |
| 86 | − set[2] = (float*)__leaf_table_squarewave[0]; | |
| 87 | − set[3] = (float*)__leaf_table_sawtooth[0]; | |
| 83 | + tWaveTable_init(&wavetables[0], (float*)__leaf_table_sinewave, 2048, 20000.f, &leaf); | |
| 84 | + tWaveTable_init(&wavetables[1], (float*)__leaf_table_triangle, 2048, 20000.f, &leaf); | |
| 85 | + tWaveTable_init(&wavetables[2], (float*)__leaf_table_squarewave, 2048, 20000.f, &leaf); | |
| 86 | + tWaveTable_init(&wavetables[3], (float*)__leaf_table_sawtooth, 2048, 20000.f, &leaf); | |
| 88 | 87 | |
| 89 | −// tWaveSynth_init(&ws, set, 2048, 4, 10000.f, &leaf); | |
| 88 | + tWaveOsc_init(&ws, wavetables, numWavetables, &leaf); | |
| 90 | 89 | |
| 91 | 90 | lastLoadedAudioSize = 0; |
| 92 | 91 | loadedAudio.clear(); |
| @@ -103,14 +102,10 @@ inline double getSawFall(double angle) { · 10 unmodified lines | ||
| 103 | 102 | |
| 104 | 103 | float LEAFTest_tick (float input) |
| 105 | 104 | { |
| 106 | − tSimpleRetune_tuneVoice(&retune, 0, mtof(roundf(ftom(tSimpleRetune_getInputFrequency(&retune))))); | |
| 107 | − return tSimpleRetune_tick(&retune, input); | |
| 108 | − | |
| 109 | − | |
| 110 | 105 | float out = 0.0f; |
| 111 | − for (int i = 0; i < fmin(loadedAudio.size(), numWavetables); ++i) | |
| 106 | + for (int i = 0; i < numWavetables; ++i) | |
| 112 | 107 | { |
| 113 | −// out += tWaveTable_tick(&wavetables[i]); | |
| 108 | + out += tWaveOsc_tick(&ws); | |
| 114 | 109 | } |
| 115 | 110 | return out; |
| 116 | 111 | } |
| @@ -125,12 +120,12 @@ void LEAFTest_block (void) · 8 unmodified lines | ||
| 125 | 120 | tMBSaw_setFreq(&bsaw, val * 10000.f); |
| 126 | 121 | // tWaveTable_setFreq(&wt, val * 160000.f - 80000.0f); |
| 127 | 122 | // tWaveTableS_setFreq(&cwt, val * 10000.); |
| 128 | − tWaveSynth_setFreq(&ws, val * 10000.f); | |
| 123 | + tWaveOsc_setFreq(&ws, val * 2000.f); | |
| 129 | 124 | // tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f); |
| 130 | 125 | // tSimpleRetune_tuneVoice(&sretune, 0, 300); |
| 131 | 126 | |
| 132 | 127 | val = getSliderValue("slider2"); |
| 133 | − tWaveSynth_setIndex(&ws, val); | |
| 128 | + tWaveOsc_setIndex(&ws, val); | |
| 134 | 129 | // tRetune_setPitchFactor(&retune, val * 3.0f + 0.5f, 1); |
| 135 | 130 | |
| 136 | 131 | val = getSliderValue("slider3"); |