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 | tWaveTable wt; | 34 | tWaveTable wt; |
| 35 | tWaveTableS cwt; | 35 | tWaveTableS cwt; |
| 36 | tWaveSynth ws; | 36 | tWaveOsc ws; |
| 37 | 37 | ||
| 38 | tBuffer samp; | 38 | tBuffer samp; |
| 39 | tMBSampler sampler; | 39 | tMBSampler sampler; |
| 40 | 40 | ||
| 41 | const int numWavetables = 1; | 41 | const int numWavetables = 4; |
| 42 | tWaveTable wavetables[numWavetables]; | 42 | tWaveTable wavetables[numWavetables]; |
| 43 | tSimpleRetune retune; | 43 | tSimpleRetune retune; |
| 44 | 44 | ||
| @@ -80,13 +80,12 @@ void LEAFTest_init (float sampleRate, int blockSize) · 35 unmodified lines | |||
| 80 | tPhasor_init(&phasor, &leaf); | 80 | tPhasor_init(&phasor, &leaf); |
| 81 | tPhasor_setFreq(&phasor, 220.f); | 81 | tPhasor_setFreq(&phasor, 220.f); |
| 82 | 82 | ||
| 83 | float* set[4]; | 83 | tWaveTable_init(&wavetables[0], (float*)__leaf_table_sinewave, 2048, 20000.f, &leaf); |
| 84 | set[0] = (float*)__leaf_table_sinewave; | 84 | tWaveTable_init(&wavetables[1], (float*)__leaf_table_triangle, 2048, 20000.f, &leaf); |
| 85 | set[1] = (float*)__leaf_table_triangle[0]; | 85 | tWaveTable_init(&wavetables[2], (float*)__leaf_table_squarewave, 2048, 20000.f, &leaf); |
| 86 | set[2] = (float*)__leaf_table_squarewave[0]; | 86 | tWaveTable_init(&wavetables[3], (float*)__leaf_table_sawtooth, 2048, 20000.f, &leaf); |
| 87 | set[3] = (float*)__leaf_table_sawtooth[0]; | ||
| 88 | 87 | ||
| 89 | // tWaveSynth_init(&ws, set, 2048, 4, 10000.f, &leaf); | 88 | tWaveOsc_init(&ws, wavetables, numWavetables, &leaf); |
| 90 | 89 | ||
| 91 | lastLoadedAudioSize = 0; | 90 | lastLoadedAudioSize = 0; |
| 92 | loadedAudio.clear(); | 91 | loadedAudio.clear(); |
| @@ -103,14 +102,10 @@ inline double getSawFall(double angle) { · 10 unmodified lines | |||
| 103 | 102 | ||
| 104 | float LEAFTest_tick (float input) | 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 | float out = 0.0f; | 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 | return out; | 110 | return out; |
| 116 | } | 111 | } |
| @@ -125,12 +120,12 @@ void LEAFTest_block (void) · 8 unmodified lines | |||
| 125 | tMBSaw_setFreq(&bsaw, val * 10000.f); | 120 | tMBSaw_setFreq(&bsaw, val * 10000.f); |
| 126 | // tWaveTable_setFreq(&wt, val * 160000.f - 80000.0f); | 121 | // tWaveTable_setFreq(&wt, val * 160000.f - 80000.0f); |
| 127 | // tWaveTableS_setFreq(&cwt, val * 10000.); | 122 | // tWaveTableS_setFreq(&cwt, val * 10000.); |
| 128 | tWaveSynth_setFreq(&ws, val * 10000.f); | 123 | tWaveOsc_setFreq(&ws, val * 2000.f); |
| 129 | // tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f); | 124 | // tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f); |
| 130 | // tSimpleRetune_tuneVoice(&sretune, 0, 300); | 125 | // tSimpleRetune_tuneVoice(&sretune, 0, 300); |
| 131 | 126 | ||
| 132 | val = getSliderValue("slider2"); | 127 | val = getSliderValue("slider2"); |
| 133 | tWaveSynth_setIndex(&ws, val); | 128 | tWaveOsc_setIndex(&ws, val); |
| 134 | // tRetune_setPitchFactor(&retune, val * 3.0f + 0.5f, 1); | 129 | // tRetune_setPitchFactor(&retune, val * 3.0f + 0.5f, 1); |
| 135 | 130 | ||
| 136 | val = getSliderValue("slider3"); | 131 | val = getSliderValue("slider3"); |