History

improved wavetable oscs; added tCompactWavetable

Matthew Wang committed 5 years ago

Commit 0400bc11 parent 32f24278 files · +418 −104Browse files

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

Unified · Split

TestPlugin/Source/MyTest.cpp+15−12
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #include "LEAFTest.h"
1010 #include "MyTest.h"
1111
12−
1312 static void leaf_pool_report(void);
1413 static void leaf_pool_dump(void);
1514 static void run_pool_test(void);
@@ -18,11 +17,6 @@ tMBSaw bsaw; · 2 unmodified lines
1817 tMBTriangle btri;
1918 tMBPulse bpulse;
2019
21−tRetune retune;
22−tSimpleRetune sretune;
23−
24−tCompressor compressor;
25−
2620 tSVF lp, hp;
2721
2822 tPeriodDetection pd;
@@ -32,6 +26,12 @@ tEnvelopeFollower ef; · 3 unmodified lines
3226
3327 tTriangle tri;
3428
29+tNoise noise;
30+tButterworth bw;
31+
32+tWavetable wt;
33+tCompactWavetable cwt;
34+
3535 tBuffer samp;
3636 tMBSampler sampler;
3737
@@ -55,9 +55,8 @@ void LEAFTest_init (float sampleRate, int blockSize) · 17 unmodified lines
5555 {
5656 LEAF_init(&leaf, sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
5757
58− tRetune_init(&retune, 1, mtof(48), mtof(72), 2048, &leaf);
59− tSimpleRetune_init(&sretune, 1, mtof(48), mtof(72), 2048, &leaf);
60− tSimpleRetune_setMode(&sretune, 1);
58+ tWavetable_init(&wt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
59+ tCompactWavetable_init(&cwt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
6160 }
6261
6362 inline double getSawFall(double angle) {
@@ -72,7 +71,9 @@ inline double getSawFall(double angle) { · 8 unmodified lines
7271 float LEAFTest_tick (float input)
7372 {
7473 // return tRetune_tick(&retune, input)[0];
75− return tSimpleRetune_tick(&sretune, input);
74+// return tSimpleRetune_tick(&sretune, input);
75+ return tWavetable_tick(&wt);
76+ return tCompactWavetable_tick(&cwt);
7677 }
7778
7879 int firstFrame = 1;
@@ -80,8 +81,10 @@ bool lastState = false, lastPlayState = false; · 1 unmodified line
8081 void LEAFTest_block (void)
8182 {
8283 float val = getSliderValue("slider1");
83− tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
84− tSimpleRetune_tuneVoice(&sretune, 0, 300);
84+ tWavetable_setFreq(&wt, val * 40000.);
85+ tCompactWavetable_setFreq(&cwt, val * 10000.);
86+// tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
87+// tSimpleRetune_tuneVoice(&sretune, 0, 300);
8588
8689 val = getSliderValue("slider2");
8790 // tRetune_setPitchFactor(&retune, val * 3.0f + 0.5f, 1);

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