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
9#include "LEAFTest.h"9#include "LEAFTest.h"
10#include "MyTest.h"10#include "MyTest.h"
11 11
12
13static void leaf_pool_report(void);12static void leaf_pool_report(void);
14static void leaf_pool_dump(void);13static void leaf_pool_dump(void);
15static void run_pool_test(void);14static void run_pool_test(void);
@@ -18,11 +17,6 @@ tMBSaw bsaw; · 2 unmodified lines
18tMBTriangle btri;17tMBTriangle btri;
19tMBPulse bpulse;18tMBPulse bpulse;
20 19
21tRetune retune;
22tSimpleRetune sretune;
23
24tCompressor compressor;
25
26tSVF lp, hp;20tSVF lp, hp;
27 21
28tPeriodDetection pd;22tPeriodDetection pd;
@@ -32,6 +26,12 @@ tEnvelopeFollower ef; · 3 unmodified lines
32 26
33tTriangle tri;27tTriangle tri;
34 28
29tNoise noise;
30tButterworth bw;
31
32tWavetable wt;
33tCompactWavetable cwt;
34
35tBuffer samp;35tBuffer samp;
36tMBSampler sampler;36tMBSampler sampler;
37 37
@@ -55,9 +55,8 @@ void LEAFTest_init (float sampleRate, int blockSize) · 17 unmodified lines
55{55{
56 LEAF_init(&leaf, sampleRate, blockSize, memory, MSIZE, &getRandomFloat);56 LEAF_init(&leaf, sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
57 57
58 tRetune_init(&retune, 1, mtof(48), mtof(72), 2048, &leaf);58 tWavetable_init(&wt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
59 tSimpleRetune_init(&sretune, 1, mtof(48), mtof(72), 2048, &leaf);59 tCompactWavetable_init(&cwt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
60 tSimpleRetune_setMode(&sretune, 1);
61}60}
62 61
63inline double getSawFall(double angle) {62inline double getSawFall(double angle) {
@@ -72,7 +71,9 @@ inline double getSawFall(double angle) { · 8 unmodified lines
72float LEAFTest_tick (float input)71float LEAFTest_tick (float input)
73{72{
74// return tRetune_tick(&retune, input)[0];73// 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);
76}77}
77 78
78int firstFrame = 1;79int firstFrame = 1;
@@ -80,8 +81,10 @@ bool lastState = false, lastPlayState = false; · 1 unmodified line
80void LEAFTest_block (void)81void LEAFTest_block (void)
81{82{
82 float val = getSliderValue("slider1");83 float val = getSliderValue("slider1");
83 tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);84 tWavetable_setFreq(&wt, val * 40000.);
84 tSimpleRetune_tuneVoice(&sretune, 0, 300);85 tCompactWavetable_setFreq(&cwt, val * 10000.);
86// tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
87// tSimpleRetune_tuneVoice(&sretune, 0, 300);
85 88
86 val = getSliderValue("slider2");89 val = getSliderValue("slider2");
87// tRetune_setPitchFactor(&retune, val * 3.0f + 0.5f, 1);90// 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