History

removed tWaveOsc and tWaveOscS; removed unneeded arguments from tWaveSynth and tWaveSynthS; renamed tWaveSynth and tWaveSynthS to tWaveOsc and tWaveOscS

Matthew Wang committed 5 years ago

Commit 8329ace1 parent 479c76d5 files · +118 −627Browse files

Showing the changes to TestPlugin/Source/MyTest.cpp (1 of 5 files). Show all

Unified · Split

TestPlugin/Source/MyTest.cpp+11−16
@@ -33,12 +33,12 @@ tButterworth bw; · 32 unmodified lines
3333
3434 tWaveTable wt;
3535 tWaveTableS cwt;
36−tWaveSynth ws;
36+tWaveOsc ws;
3737
3838 tBuffer samp;
3939 tMBSampler sampler;
4040
41−const int numWavetables = 1;
41+const int numWavetables = 4;
4242 tWaveTable wavetables[numWavetables];
4343 tSimpleRetune retune;
4444
@@ -80,13 +80,12 @@ void LEAFTest_init (float sampleRate, int blockSize) · 35 unmodified lines
8080 tPhasor_init(&phasor, &leaf);
8181 tPhasor_setFreq(&phasor, 220.f);
8282
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);
8887
89−// tWaveSynth_init(&ws, set, 2048, 4, 10000.f, &leaf);
88+ tWaveOsc_init(&ws, wavetables, numWavetables, &leaf);
9089
9190 lastLoadedAudioSize = 0;
9291 loadedAudio.clear();
@@ -103,14 +102,10 @@ inline double getSawFall(double angle) { · 10 unmodified lines
103102
104103 float LEAFTest_tick (float input)
105104 {
106− tSimpleRetune_tuneVoice(&retune, 0, mtof(roundf(ftom(tSimpleRetune_getInputFrequency(&retune)))));
107− return tSimpleRetune_tick(&retune, input);
108−
109−
110105 float out = 0.0f;
111− for (int i = 0; i < fmin(loadedAudio.size(), numWavetables); ++i)
106+ for (int i = 0; i < numWavetables; ++i)
112107 {
113−// out += tWaveTable_tick(&wavetables[i]);
108+ out += tWaveOsc_tick(&ws);
114109 }
115110 return out;
116111 }
@@ -125,12 +120,12 @@ void LEAFTest_block (void) · 8 unmodified lines
125120 tMBSaw_setFreq(&bsaw, val * 10000.f);
126121 // tWaveTable_setFreq(&wt, val * 160000.f - 80000.0f);
127122 // tWaveTableS_setFreq(&cwt, val * 10000.);
128− tWaveSynth_setFreq(&ws, val * 10000.f);
123+ tWaveOsc_setFreq(&ws, val * 2000.f);
129124 // tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
130125 // tSimpleRetune_tuneVoice(&sretune, 0, 300);
131126
132127 val = getSliderValue("slider2");
133− tWaveSynth_setIndex(&ws, val);
128+ tWaveOsc_setIndex(&ws, val);
134129 // tRetune_setPitchFactor(&retune, val * 3.0f + 0.5f, 1);
135130
136131 val = getSliderValue("slider3");

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