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
17tMBTriangle btri;17tMBTriangle btri;
18tMBPulse bpulse;18tMBPulse bpulse;
19 19
20tPhasor phasor;
21
20tSVF lp, hp;22tSVF lp, hp;
21 23
22tPeriodDetection pd;24tPeriodDetection pd;
@@ -57,6 +59,16 @@ void LEAFTest_init (float sampleRate, int blockSize) · 34 unmodified lines
57 59
58 tWavetable_init(&wt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);60 tWavetable_init(&wt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
59 tCompactWavetable_init(&cwt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);61 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);
60}72}
61 73
62inline double getSawFall(double angle) {74inline double getSawFall(double angle) {
@@ -72,8 +84,9 @@ float LEAFTest_tick (float input) · 9 unmodified lines
72{84{
73// return tRetune_tick(&retune, input)[0];85// return tRetune_tick(&retune, input)[0];
74// return tSimpleRetune_tick(&sretune, input);86// return tSimpleRetune_tick(&sretune, input);
87// tMBPulse_sync(&bpulse, tPhasor_tick(&phasor) * 2.f - 1.f);
88// return tMBPulse_tick(&bpulse);
75 return tWavetable_tick(&wt);89 return tWavetable_tick(&wt);
76 return tCompactWavetable_tick(&cwt);
77}90}
78 91
79int firstFrame = 1;92int firstFrame = 1;
@@ -81,7 +94,10 @@ bool lastState = false, lastPlayState = false; · 1 unmodified line
81void LEAFTest_block (void)94void LEAFTest_block (void)
82{95{
83 float val = getSliderValue("slider1");96 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);
85 tCompactWavetable_setFreq(&cwt, val * 10000.);101 tCompactWavetable_setFreq(&cwt, val * 10000.);
86// tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);102// tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
87// tSimpleRetune_tuneVoice(&sretune, 0, 300);103// 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