History

mb osc sync rework; general osc clean up

Matthew Wang committed 5 years ago

Commit ef023f61 parent 87cc8193 files · +405 −458Browse files

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

Unified · Split

TestPlugin/Source/MyTest.cpp+18−2
@@ -17,6 +17,8 @@ tMBSaw bsaw; · 16 unmodified lines
1717 tMBTriangle btri;
1818 tMBPulse bpulse;
1919
20+tPhasor phasor;
21+
2022 tSVF lp, hp;
2123
2224 tPeriodDetection pd;
@@ -57,6 +59,16 @@ void LEAFTest_init (float sampleRate, int blockSize) · 34 unmodified lines
5759
5860 tWavetable_init(&wt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
5961 tCompactWavetable_init(&cwt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
62+
63+ tMBTriangle_init(&btri, &leaf);
64+ tMBPulse_init(&bpulse, &leaf);
65+ tMBSaw_init(&bsaw, &leaf);
66+ tMBSaw_setSyncMode(&bsaw, 1);
67+ tMBTriangle_setSyncMode(&btri, 0);
68+ tMBPulse_setSyncMode(&bpulse, 0);
69+
70+ tPhasor_init(&phasor, &leaf);
71+ tPhasor_setFreq(&phasor, 220.f);
6072 }
6173
6274 inline double getSawFall(double angle) {
@@ -72,8 +84,9 @@ float LEAFTest_tick (float input) · 9 unmodified lines
7284 {
7385 // return tRetune_tick(&retune, input)[0];
7486 // return tSimpleRetune_tick(&sretune, input);
87+// tMBPulse_sync(&bpulse, tPhasor_tick(&phasor) * 2.f - 1.f);
88+// return tMBPulse_tick(&bpulse);
7589 return tWavetable_tick(&wt);
76− return tCompactWavetable_tick(&cwt);
7790 }
7891
7992 int firstFrame = 1;
@@ -81,7 +94,10 @@ bool lastState = false, lastPlayState = false; · 1 unmodified line
8194 void LEAFTest_block (void)
8295 {
8396 float val = getSliderValue("slider1");
84− tWavetable_setFreq(&wt, val * 40000.);
97+ tMBTriangle_setFreq(&btri, val * 440.f);
98+ tMBPulse_setFreq(&bpulse, val * 160000.f - 80000.0f);
99+ tMBSaw_setFreq(&bsaw, val * 10000.f);
100+ tWavetable_setFreq(&wt, val * 160000.f - 80000.0f);
85101 tCompactWavetable_setFreq(&cwt, val * 10000.);
86102 // tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
87103 // tSimpleRetune_tuneVoice(&sretune, 0, 300);

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