History

Added custom tTapeDelay object.

mulshine committed 7 years ago

Commit e28e39c1 parent 9d82b878 files · +332 −50Browse files

Unified · Split

8 files
  1. LEAF/Inc/leaf-delay.h +34 −1
  2. LEAF/Inc/leaf-math.h +5 −0
  3. LEAF/Inc/leaf-reverb.h +8 −7
  4. LEAF/Src_cpp/leaf-delay.cpp +169 −22
  5. LEAF/Src_cpp/leaf-math.cpp +31 −1
  6. LEAF/Src_cpp/leaf-reverb.cpp +50 −15
  7. LEAF/leaf.h +7 −1
  8. LEAF_JUCEPlugin/Source/MyTest.cpp +28 −3
LEAF/Inc/leaf-delay.h+34−1
@@ -111,6 +111,39 @@ float tDelayA_tick (tDelayA* const, float sample); · 110 unmodified lines
111111 float tDelayA_getLastOut (tDelayA* const);
112112 float tDelayA_getLastIn (tDelayA* const);
113113
114−// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
114+// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
115+
116+/* Linear interpolating delay with fixed read and write pointers, variable rate. */
117+typedef struct _tTapeDelay
118+{
119+ float gain;
120+ float* buff;
121+
122+ float lastOut, lastIn;
123+
124+ uint32_t inPoint;
125+ uint32_t outPoint;
126+
127+ uint32_t maxDelay;
128+
129+ float delay, inc, idx;
130+
131+ float alpha, omAlpha, coeff;
132+
133+ float apInput;
134+
135+} tTapeDelay;
136+
137+void tTapeDelay_init (tTapeDelay* const, float delay, uint32_t maxDelay);
138+void tTapeDelay_free (tTapeDelay* const);
139+
140+int tTapeDelay_setDelay (tTapeDelay* const, float delay);
141+float tTapeDelay_getDelay (tTapeDelay* const);
142+void tTapeDelay_tapIn (tTapeDelay* const, float in, uint32_t tapDelay);
143+float tTapeDelay_tapOut (tTapeDelay* const, uint32_t tapDelay);
144+float tTapeDelay_addTo (tTapeDelay* const, float value, uint32_t tapDelay);
145+float tTapeDelay_tick (tTapeDelay* const, float sample);
146+float tTapeDelay_getLastOut (tTapeDelay* const);
147+float tTapeDelay_getLastIn (tTapeDelay* const);
115148
116149 #endif // LEAFDELAY_H_INCLUDED
LEAF/Inc/leaf-math.h+5−0
@@ -89,6 +89,11 @@ void LEAF_generate_square (float* buffer, float basefreq, int size); · 88 unmodified lines
8989 // dope af
9090 float LEAF_chebyshevT(float in, int n);
9191 float LEAF_CompoundChebyshevT(float in, int n, float* amps);
92+
93+
94+// Hermite interpolation
95+float LEAF_interpolate_hermite (float A, float B, float C, float D, float t);
96+float LEAF_interpolation_linear (float A, float B, float t);
9297
9398 static inline float interpolate3max(float *buf, const int peakindex)
9499 {
LEAF/Inc/leaf-reverb.h+8−7
@@ -81,7 +81,6 @@ void tNRev_setMix (tNRev* const, float mix); · 80 unmodified lines
8181
8282 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
8383
84−
8584 typedef struct _tDattorro
8685 {
8786 float predelay;
@@ -90,13 +89,14 @@ typedef struct _tDattorro · 2 unmodified lines
9089 float feedback_gain;
9190 float mix;
9291
93− float size, t;
92+
93+ float size, size_max, t;
9494
9595 float f1_delay_2_last,
96− f2_delay_2_last;
96+ f2_delay_2_last;
9797
9898 float f1_last,
99− f2_last;
99+ f2_last;
100100
101101 // INPUT
102102 tDelayL in_delay;
@@ -109,6 +109,7 @@ typedef struct _tDattorro · 6 unmodified lines
109109 tOnePole f1_filter;
110110 tDelayL f1_delay_2;
111111 tDelayL f1_delay_3;
112+ tHighpass f1_hp;
112113
113114 tCycle f1_lfo;
114115
@@ -118,9 +119,10 @@ typedef struct _tDattorro · 3 unmodified lines
118119 tOnePole f2_filter;
119120 tDelayL f2_delay_2;
120121 tDelayL f2_delay_3;
122+ tHighpass f2_hp;
121123
122124 tCycle f2_lfo;
123−
125+
124126 } tDattorro;
125127
126128 void tDattorro_init (tDattorro* const);
@@ -133,7 +135,6 @@ void tDattorro_setSize (tDattorro* const, float size); · 6 unmodified lines
133135 void tDattorro_setInputDelay (tDattorro* const, float preDelay);
134136 void tDattorro_setInputFilter (tDattorro* const, float freq);
135137 void tDattorro_setFeedbackFilter (tDattorro* const, float freq);
136−void tDattorro_setFeedbackGain (tDattorro* const, float gain);
137−
138+void tDattorro_setFeedbackGain (tDattorro* const, float gain);
138139
139140 #endif // LEAFREVERB_H_INCLUDED
LEAF/Src_cpp/leaf-delay.cpp+169−22
@@ -63,8 +63,8 @@ float tDelay_tick (tDelay* const d, float input) · 62 unmodified lines
6363
6464 int tDelay_setDelay (tDelay* const d, uint32_t delay)
6565 {
66− if (delay >= d->maxDelay) d->delay = d->maxDelay;
67− else d->delay = delay;
66+ d->delay = LEAF_clip(0.0f, delay, d->maxDelay);
67+
6868
6969 // read chases write
7070 if ( d->inPoint >= delay ) d->outPoint = d->inPoint - d->delay;
@@ -163,29 +163,26 @@ float tDelayL_tick (tDelayL* const d, float input) · 92 unmodified lines
163163 d->buff[d->inPoint] = input * d->gain;
164164
165165 // Increment input pointer modulo length.
166− if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0;
167−
168−
169− // First 1/2 of interpolation
170− d->lastOut = d->buff[d->outPoint] * d->omAlpha;
171−
172− // Second 1/2 of interpolation
173− if (d->outPoint + 1 < d->maxDelay)
174− d->lastOut += d->buff[d->outPoint+1] * d->alpha;
175− else
176− d->lastOut += d->buff[0] * d->alpha;
166+ if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0;
167+
168+
169+ uint32_t idx = (uint32_t) d->outPoint;
170+
171+ d->lastOut = LEAF_interpolate_hermite (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay],
172+ d->buff[idx],
173+ d->buff[(idx + 1) % d->maxDelay],
174+ d->buff[(idx + 2) % d->maxDelay],
175+ d->alpha);
177176
178− // Increment output pointer modulo length.
179− if ( ++(d->outPoint) == d->maxDelay ) d->outPoint = 0;
177+ // Increment output pointer modulo length
178+ if ( (++d->outPoint) >= d->maxDelay ) d->outPoint = 0;
180179
181180 return d->lastOut;
182181 }
183182
184183 int tDelayL_setDelay (tDelayL* const d, float delay)
185−{
186− if (delay < 0.0f) d->delay = 0.0f;
187− else if (delay <= d->maxDelay) d->delay = delay;
188− else d->delay = d->maxDelay;
184+{
185+ d->delay = LEAF_clip(0.0f, delay, d->maxDelay);
189186
190187 float outPointer = d->inPoint - d->delay;
191188
@@ -326,9 +323,8 @@ float tDelayA_tick (tDelayA* const d, float input) · 134 unmodified lines
326323
327324 int tDelayA_setDelay (tDelayA* const d, float delay)
328325 {
329− if (delay < 0.5f) d->delay = 0.5f;
330− else if (delay <= d->maxDelay) d->delay = delay;
331− else d->delay = d->maxDelay;
326+ d->delay = LEAF_clip(0.5f, delay, d->maxDelay);
327+
332328
333329 // outPoint chases inPoint
334330 float outPointer = (float)d->inPoint - d->delay + 1.0f;
@@ -413,5 +409,156 @@ void tDelayA_setGain (tDelayA* const d, float gain) · 78 unmodified lines
413409 float tDelayA_getGain (tDelayA* const d)
414410 {
415411 return d->gain;
412+}
413+
414+// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ TapeDelay ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ //
415+void tTapeDelay_init (tTapeDelay* const d, float delay, uint32_t maxDelay)
416+{
417+ d->maxDelay = maxDelay;
418+
419+ d->delay = LEAF_clip(0.0f, delay, d->maxDelay);
420+
421+ d->buff = (float*) leaf_alloc(sizeof(float) * maxDelay);
422+
423+ d->gain = 1.0f;
424+
425+ d->lastIn = 0.0f;
426+ d->lastOut = 0.0f;
427+
428+ d->idx = 0.0f;
429+ d->inc = 1.0f;
430+ d->inPoint = 0;
431+ d->outPoint = 0;
432+
433+ tTapeDelay_setDelay(d, 1);
434+}
435+
436+void tTapeDelay_free(tTapeDelay* const d)
437+{
438+ leaf_free(d->buff);
439+ leaf_free(d);
440+}
441+
442+int count = 0;
443+
444+#define SMOOTH_FACTOR 10.f
445+
446+float tTapeDelay_tick (tTapeDelay* const d, float input)
447+{
448+ d->buff[d->inPoint] = input * d->gain;
449+
450+ // Increment input pointer modulo length.
451+ if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0;
452+
453+ int idx = (int) d->idx;
454+ d->alpha = d->idx - idx;
455+
456+ d->lastOut = LEAF_interpolate_hermite (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay],
457+ d->buff[idx],
458+ d->buff[(idx + 1) % d->maxDelay],
459+ d->buff[(idx + 2) % d->maxDelay],
460+ d->alpha);
461+
462+ float diff = (d->inPoint - d->idx);
463+ while (diff < 0.f) diff += d->maxDelay;
464+
465+ d->inc = 1.0f + (diff - d->delay) / d->delay * SMOOTH_FACTOR;
466+
467+ d->idx += d->inc;
468+
469+ if (d->idx >= d->maxDelay) d->idx = 0.f;
470+
471+ if ( ++(d->outPoint) >= d->maxDelay ) d->outPoint -= d->maxDelay;
472+
473+ return d->lastOut;
474+}
475+
476+
477+void tTapeDelay_setRate(tTapeDelay* const d, float rate)
478+{
479+ d->inc = rate;
480+}
481+
482+int tTapeDelay_setDelay (tTapeDelay* const d, float delay)
483+{
484+ d->delay = LEAF_clip(0.0f, delay, d->maxDelay);
485+
486+
487+ float outPointer = d->inPoint - d->delay;
488+
489+ while ( outPointer < 0 )
490+ outPointer += d->maxDelay; // modulo maximum length
491+
492+ d->outPoint = (uint32_t) outPointer; // integer part
493+
494+
495+ return 0;
496+}
497+
498+float tTapeDelay_tapOut (tTapeDelay* const d, float tapDelay)
499+{
500+ float tap = (float) d->inPoint - tapDelay - 1.f;
501+
502+ // Check for wraparound.
503+ while ( tap < 0.f ) tap += (float)d->maxDelay;
504+
505+ int idx = (int) tap;
506+
507+ float alpha = tap - idx;
508+
509+ float samp = LEAF_interpolate_hermite (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay],
510+ d->buff[idx],
511+ d->buff[(idx + 1) % d->maxDelay],
512+ d->buff[(idx + 2) % d->maxDelay],
513+ d->alpha);
514+
515+ return samp;
516+
517+}
518+
519+void tTapeDelay_tapIn (tTapeDelay* const d, float value, uint32_t tapDelay)
520+{
521+ int32_t tap = d->inPoint - tapDelay - 1;
522+
523+ // Check for wraparound.
524+ while ( tap < 0 ) tap += d->maxDelay;
525+
526+ d->buff[tap] = value;
527+}
528+
529+float tTapeDelay_addTo (tTapeDelay* const d, float value, uint32_t tapDelay)
530+{
531+ int32_t tap = d->inPoint - tapDelay - 1;
532+
533+ // Check for wraparound.
534+ while ( tap < 0 ) tap += d->maxDelay;
535+
536+ return (d->buff[tap] += value);
537+}
538+
539+float tTapeDelay_getDelay (tTapeDelay *d)
540+{
541+ return d->delay;
542+}
543+
544+float tTapeDelay_getLastOut (tTapeDelay* const d)
545+{
546+ return d->lastOut;
547+}
548+
549+float tTapeDelay_getLastIn (tTapeDelay* const d)
550+{
551+ return d->lastIn;
552+}
553+
554+void tTapeDelay_setGain (tTapeDelay* const d, float gain)
555+{
556+ if (gain < 0.0f) d->gain = 0.0f;
557+ else d->gain = gain;
558+}
559+
560+float tTapeDelay_getGain (tTapeDelay* const d)
561+{
562+ return d->gain;
416563 }
417564
LEAF/Src_cpp/leaf-math.cpp+31−1
@@ -231,4 +231,34 @@ float LEAF_midiToFrequency(float f) · 230 unmodified lines
231231 if( f <= -1500.0f ) return (0);
232232 else if( f > 1499.0f ) return (LEAF_midiToFrequency(1499.0f));
233233 else return ( powf(2.0f, (f - 69.0f) / 12.0f) * 440.0f );
234−}
234+}
235+
236+
237+// alpha, [0.0, 1.0]
238+float LEAF_interpolate_hermite (float A, float B, float C, float D, float alpha)
239+{
240+ alpha = LEAF_clip(0.0f, alpha, 1.0f);
241+
242+ float a = -A/2.0f + (3.0f*B)/2.0f - (3.0f*C)/2.0f + D/2.0f;
243+ float b = A - (5.0f*B)/2.0f + 2.0f*C - D / 2.0f;
244+ float c = -A/2.0f + C/2.0f;
245+ float d = B;
246+
247+ return a*alpha*alpha*alpha + b*alpha*alpha + c*alpha + d;
248+}
249+
250+// alpha, [0.0, 1.0]
251+float LEAF_interpolation_linear (float A, float B, float alpha)
252+{
253+ alpha = LEAF_clip(0.0f, alpha, 1.0f);
254+
255+ float omAlpha = 1.0f - alpha;
256+
257+ // First 1/2 of interpolation
258+ float out = A * omAlpha;
259+
260+ out += B * alpha;
261+
262+ return out;
263+}
264+
LEAF/Src_cpp/leaf-reverb.cpp+50−15
@@ -262,9 +262,12 @@ void tNRevSampleRateChanged (tNRev* const r) · 261 unmodified lines
262262 float in_allpass_delays[4] = { 4.771f, 3.595f, 12.73f, 9.307f };
263263 float in_allpass_gains[4] = { 0.75f, 0.75f, 0.625f, 0.625f };
264264
265+
265266 void tDattorro_init (tDattorro* const r)
266267 {
267− tDattorro_setSize(r, 1.0f);
268+ r->size_max = 2.0f;
269+ r->size = 1.f;
270+ r->t = r->size * leaf.sampleRate * 0.001f;
268271
269272 // INPUT
270273 tDelayL_init(&r->in_delay, 0.f, SAMP(200.f));
@@ -272,33 +275,37 @@ void tDattorro_init (tDattorro* const r) · 1 unmodified line
272275
273276 for (int i = 0; i < 4; i++)
274277 {
275− tAllpass_init(&r->in_allpass[i], in_allpass_delays[i], SAMP(20.f));
278+ tAllpass_init(&r->in_allpass[i], SAMP(in_allpass_delays[i]), SAMP(20.f)); // * r->size_max
276279 tAllpass_setGain(&r->in_allpass[i], in_allpass_gains[i]);
277280 }
278281
279282 // FEEDBACK 1
280− tAllpass_init(&r->f1_allpass, SAMP(30.51f), SAMP(100.f));
283+ tAllpass_init(&r->f1_allpass, SAMP(30.51f), SAMP(100.f)); // * r->size_max
281284 tAllpass_setGain(&r->f1_allpass, 0.7f);
282285
283− tDelayL_init(&r->f1_delay_1, SAMP(141.69f), SAMP(200.0f));
284− tDelayL_init(&r->f1_delay_2, SAMP(89.24f), SAMP(100.0f));
285− tDelayL_init(&r->f1_delay_3, SAMP(125.f), SAMP(200.0f));
286+ tDelayL_init(&r->f1_delay_1, SAMP(141.69f), SAMP(200.0f) * r->size_max + 1);
287+ tDelayL_init(&r->f1_delay_2, SAMP(89.24f), SAMP(100.0f) * r->size_max + 1);
288+ tDelayL_init(&r->f1_delay_3, SAMP(125.f), SAMP(200.0f) * r->size_max + 1);
286289
287290 tOnePole_init(&r->f1_filter, 1.f);
288291
292+ tHighpass_init(&r->f1_hp, 20.f);
293+
289294 tCycle_init(&r->f1_lfo);
290295 tCycle_setFreq(&r->f1_lfo, 0.1f);
291296
292297 // FEEDBACK 2
293− tAllpass_init(&r->f2_allpass, SAMP(22.58f), SAMP(100.f));
298+ tAllpass_init(&r->f2_allpass, SAMP(22.58f), SAMP(100.f)); // * r->size_max
294299 tAllpass_setGain(&r->f2_allpass, 0.7f);
295300
296− tDelayL_init(&r->f2_delay_1, SAMP(149.62f), SAMP(200.0f));
297− tDelayL_init(&r->f2_delay_2, SAMP(60.48f), SAMP(100.0f));
298− tDelayL_init(&r->f2_delay_3, SAMP(106.28f), SAMP(200.0f));
301+ tDelayL_init(&r->f2_delay_1, SAMP(149.62f), SAMP(200.f) * r->size_max + 1);
302+ tDelayL_init(&r->f2_delay_2, SAMP(60.48f), SAMP(100.f) * r->size_max + 1);
303+ tDelayL_init(&r->f2_delay_3, SAMP(106.28f), SAMP(200.f) * r->size_max + 1);
299304
300305 tOnePole_init(&r->f2_filter, 1.f);
301306
307+ tHighpass_init(&r->f2_hp, 20.f);
308+
302309 tCycle_init(&r->f2_lfo);
303310 tCycle_setFreq(&r->f2_lfo, 0.07f);
304311
@@ -313,6 +320,8 @@ void tDattorro_init (tDattorro* const r) · 8 unmodified lines
313320 tDattorro_setFeedbackFilter(r, 5000.f);
314321
315322 tDattorro_setFeedbackGain(r, 0.4f);
323+
324+
316325 }
317326
318327 void tDattorro_free (tDattorro* const r)
@@ -382,6 +391,8 @@ float tDattorro_tick (tDattorro* const r, float input) · 63 unmodified lines
382391
383392 f1_sample = r->f1_delay_2_last + f1_sample;
384393
394+ f1_sample = tHighpass_tick(&r->f1_hp, f1_sample);
395+
385396 f1_sample *= r->feedback_gain;
386397
387398 r->f1_last = tDelayL_tick(&r->f1_delay_3, f1_sample);
@@ -405,6 +416,8 @@ float tDattorro_tick (tDattorro* const r, float input) · 17 unmodified lines
405416
406417 f2_sample = r->f2_delay_2_last + f2_sample;
407418
419+ f2_sample = tHighpass_tick(&r->f2_hp, f2_sample);
420+
408421 f2_sample *= r->feedback_gain;
409422
410423 r->f2_last = tDelayL_tick(&r->f2_delay_3, f2_sample);
@@ -412,7 +425,7 @@ float tDattorro_tick (tDattorro* const r, float input) · 1 unmodified line
412425
413426 // TAP OUT 1
414427 f1_sample = tDelayL_tapOut(&r->f1_delay_1, SAMP(8.9f)) +
415− tDelayL_tapOut(&r->f1_delay_1, SAMP(99.8f));
428+ tDelayL_tapOut(&r->f1_delay_1, SAMP(99.8f));
416429
417430 f1_sample -= tDelayL_tapOut(&r->f1_delay_2, SAMP(64.2f));
418431
@@ -428,7 +441,7 @@ float tDattorro_tick (tDattorro* const r, float input) · 9 unmodified lines
428441
429442 // TAP OUT 2
430443 f2_sample = tDelayL_tapOut(&r->f2_delay_1, SAMP(11.8f)) +
431− tDelayL_tapOut(&r->f2_delay_1, SAMP(121.7f));
444+ tDelayL_tapOut(&r->f2_delay_1, SAMP(121.7f));
432445
433446 f2_sample -= tDelayL_tapOut(&r->f2_delay_2, SAMP(6.3f));
434447
@@ -454,8 +467,31 @@ void tDattorro_setMix (tDattorro* const r, float mix) · 19 unmodified lines
454467
455468 void tDattorro_setSize (tDattorro* const r, float size)
456469 {
457− r->size = LEAF_clip(0.001f, size, 100.0f);
470+ r->size = LEAF_clip(0.01f, size*r->size_max, r->size_max);
458471 r->t = r->size * leaf.sampleRate * 0.001f;
472+
473+ /*
474+ for (int i = 0; i < 4; i++)
475+ {
476+ tAllpass_setDelay(&r->in_allpass[i], SAMP(in_allpass_delays[i]));
477+ }
478+ */
479+
480+ // FEEDBACK 1
481+ //tAllpass_setDelay(&r->f1_allpass, SAMP(30.51f));
482+
483+ tDelayL_setDelay(&r->f1_delay_1, SAMP(141.69f));
484+ tDelayL_setDelay(&r->f1_delay_2, SAMP(89.24f));
485+ tDelayL_setDelay(&r->f1_delay_3, SAMP(125.f));
486+
487+ // maybe change rate of SINE LFO's when size changes?
488+
489+ // FEEDBACK 2
490+ //tAllpass_setDelay(&r->f2_allpass, SAMP(22.58f));
491+
492+ tDelayL_setDelay(&r->f2_delay_1, SAMP(149.62f));
493+ tDelayL_setDelay(&r->f2_delay_2, SAMP(60.48f));
494+ tDelayL_setDelay(&r->f2_delay_3, SAMP(106.28f));
459495 }
460496
461497 void tDattorro_setInputDelay (tDattorro* const r, float preDelay)
@@ -483,5 +519,4 @@ void tDattorro_setFeedbackFilter (tDattorro* const r, float freq) · 21 unmodified lines
483519 void tDattorro_setFeedbackGain (tDattorro* const r, float gain)
484520 {
485521 r->feedback_gain = gain;
486−}
487−
522+}
LEAF/leaf.h+7−1
@@ -9,7 +9,13 @@ · 8 unmodified lines
99 */
1010
1111 #ifndef LEAF_H_INCLUDED
12−#define LEAF_H_INCLUDED
12+#define LEAF_H_INCLUDED
13+
14+#define DEBUG 1
15+
16+#if DEBUG
17+#include "../JuceLibraryCode/JuceHeader.h"
18+#endif
1319
1420 #if _WIN32 || _WIN64
1521
LEAF_JUCEPlugin/Source/MyTest.cpp+28−3
@@ -18,19 +18,31 @@ static void run_pool_test(void); · 17 unmodified lines
1818
1919 tDattorro reverb;
2020
21+
22+tTapeDelay delay;
23+
24+float size;
25+tRamp dtime;
26+
2127
2228 void LEAFTest_init (float sampleRate, int blockSize)
2329 {
2430 LEAF_init(sampleRate, blockSize, &randomNumberGenerator);
2531
2632 tDattorro_init(&reverb);
33+
34+ //tTapeDelay_init(&delay, 0.5f * leaf.sampleRate, leaf.sampleRate);
2735
36+ tRamp_init(&dtime, 500.0f, 1);
37+
38+
2839 setSliderValue("mix", reverb.mix);
2940 setSliderValue("predelay", reverb.predelay / 200.0f);
3041 setSliderValue("input filter", reverb.input_filter / 20000.0f);
3142 setSliderValue("feedback filter", reverb.feedback_filter / 20000.0f);
3243 setSliderValue("feedback gain", reverb.feedback_gain);
33− //setSliderValue("size", reverb.size / 4.0f);
44+ setSliderValue("size", reverb.size / 4.0f);
45+
3446
3547 leaf_pool_report();
3648 }
@@ -53,12 +65,20 @@ float LEAFTest_tick (float input) · 16 unmodified lines
5365 input = 1.0f;
5466 }
5567 #endif
68+ //tTapeDelay_setDelay(&delay, tRamp_tick(&dtime));
69+
70+ //return tTapeDelay_tick(&delay, input);
71+
72+
73+ tDattorro_setSize(&reverb, tRamp_tick(&dtime));
5674
5775 return tDattorro_tick(&reverb, input);
76+
5877 }
5978
6079 void LEAFTest_block (void)
6180 {
81+
6282 float val = getSliderValue("mix");
6383 tDattorro_setMix(&reverb, val);
6484
@@ -74,8 +94,13 @@ void LEAFTest_block (void) · 9 unmodified lines
7494 val = getSliderValue("feedback gain");
7595 tDattorro_setFeedbackGain(&reverb, val);
7696
77− //val = getSliderValue("size");
78− //tDattorro_setSize(&reverb, val * 4.0f);
97+ val = getSliderValue("size");
98+ tRamp_setDest(&dtime, val * reverb.size_max);
99+
100+
101+ //float val = getSliderValue("size");
102+ //tRamp_setDest(&dtime, val * leaf.sampleRate + 1);
103+
79104 }
80105
81106 void LEAFTest_controllerInput (int cnum, float cval)

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