History

reorganizing and renaming adsrs and compactwavetable objects; ADSR4 -> ADSRT, ADSR3 -> ADSRS, ADSR2 deleted, CompactWaveX -> WaveXS

Matthew Wang committed 5 years ago

Commit 4c8de0f1 parent 23656d77 files · +292 −547Browse files

Unified · Split

7 files
  1. TestPlugin/Source/MyTest.cpp +3 −3
  2. leaf/Inc/leaf-envelopes.h +103 −199
  3. leaf/Inc/leaf-oscillators.h +78 −78
  4. leaf/Inc/leaf-sampling.h +1 −1
  5. leaf/Src/leaf-envelopes.c +46 −205
  6. leaf/Src/leaf-oscillators.c +59 −59
  7. leaf/leaf-config.h +2 −2
TestPlugin/Source/MyTest.cpp+3−3
@@ -32,7 +32,7 @@ tNoise noise; · 31 unmodified lines
3232 tButterworth bw;
3333
3434 tWaveTable wt;
35−tCompactWaveTable cwt;
35+tWaveTableS cwt;
3636 tWaveSynth ws;
3737
3838 tBuffer samp;
@@ -64,7 +64,7 @@ void LEAFTest_init (float sampleRate, int blockSize) · 25 unmodified lines
6464 LEAF_init(&leaf, sampleRate, blockSize, memory, MSIZE, &getRandomFloat);
6565
6666 // tWaveTable_init(&wt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
67−// tCompactWaveTable_init(&cwt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
67+// tWaveTableS_init(&cwt, __leaf_table_sawtooth[0], 2048, 10000.f, &leaf);
6868
6969 tMBTriangle_init(&btri, &leaf);
7070 tMBPulse_init(&bpulse, &leaf);
@@ -118,7 +118,7 @@ void LEAFTest_block (void) · 47 unmodified lines
118118 tMBPulse_setFreq(&bpulse, val * 160000.f - 80000.0f);
119119 tMBSaw_setFreq(&bsaw, val * 10000.f);
120120 // tWaveTable_setFreq(&wt, val * 160000.f - 80000.0f);
121−// tCompactWaveTable_setFreq(&cwt, val * 10000.);
121+// tWaveTableS_setFreq(&cwt, val * 10000.);
122122 tWaveSynth_setFreq(&ws, 0, val * 10000.f);
123123 // tRetune_tuneVoice(&retune, 0, val * 3.0f + 0.5f);
124124 // tSimpleRetune_tuneVoice(&sretune, 0, 300);
leaf/Inc/leaf-envelopes.h+103−199
@@ -281,152 +281,153 @@ extern "C" { · 280 unmodified lines
281281 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
282282
283283 /*!
284− @defgroup tasdr2 tADSR2
284+ @defgroup tadsrt tADSRT
285285 @ingroup envelopes
286286 @brief
287287 @{
288288
289− @fn void tADSR2_init (tADSR2* const, float attack, float decay, float sustain, float release, LEAF* const leaf)
290− @brief Initialize a tADSR2 to the default mempool of a LEAF instance.
291− @param adsr A pointer to the tADSR2 to initialize.
289+ @fn void tADSRT_init (tADSRT* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, LEAF* const leaf)
290+ @brief Initialize a tADSRT to the default mempool of a LEAF instance.
291+ @param adsr A pointer to the tADSRT to initialize.
292292 @param leaf A pointer to the leaf instance.
293293
294− @fn void tADSR2_initToPool (tADSR2* const, float attack, float decay, float sustain, float release, tMempool* const)
295− @brief Initialize a tADSR2 to a specified mempool.
296− @param adsr A pointer to the tADSR2 to initialize.
294+ @fn void tADSRT_initToPool (tADSRT* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, tMempool* const)
295+ @brief Initialize a tADSRT to a specified mempool.
296+ @param adsr A pointer to the tADSRT to initialize.
297297 @param mempool A pointer to the tMempool to use.
298298
299− @fn void tADSR2_free (tADSR2* const)
300− @brief Free a tADSR2 from its mempool.
301− @param adsr A pointer to the tADSR2 to free.
299+ @fn void tADSRT_free (tADSRT* const)
300+ @brief Free a tADSRT from its mempool.
301+ @param adsr A pointer to the tADSRT to free.
302302
303− @fn float tADSR2_tick (tADSR2* const)
303+ @fn float tADSRT_tick (tADSRT* const)
304304 @brief
305− @param adsr A pointer to the relevant tADSR2.
306−
307− @fn void tADSR2_setAttack (tADSR2* const, float attack)
305+ @param adsr A pointer to the relevant tADSRT.
306+
307+ @fn float tADSRT_tickNoInterp (tADSRT* const adsrenv)
308+ @brief
309+ @param adsr A pointer to the relevant tADSRT.
310+
311+ @fn void tADSRT_setAttack (tADSRT* const, float attack)
308312 @brief
309− @param adsr A pointer to the relevant tADSR2.
313+ @param adsr A pointer to the relevant tADSRT.
310314
311− @fn void tADSR2_setDecay (tADSR2* const, float decay)
315+ @fn void tADSRT_setDecay (tADSRT* const, float decay)
312316 @brief
313− @param adsr A pointer to the relevant tADSR2.
317+ @param adsr A pointer to the relevant tADSRT.
314318
315− @fn void tADSR2_setSustain (tADSR2* const, float sustain)
319+ @fn void tADSRT_setSustain (tADSRT* const, float sustain)
316320 @brief
317− @param adsr A pointer to the relevant tADSR2.
321+ @param adsr A pointer to the relevant tADSRT.
318322
319− @fn void tADSR2_setRelease (tADSR2* const, float release)
323+ @fn void tADSRT_setRelease (tADSRT* const, float release)
320324 @brief
321− @param adsr A pointer to the relevant tADSR2.
325+ @param adsr A pointer to the relevant tADSRT.
322326
323− @fn void tADSR2_setLeakFactor (tADSR2* const, float leakFactor)
327+ @fn void tADSRT_setLeakFactor (tADSRT* const, float leakFactor)
324328 @brief
325− @param adsr A pointer to the relevant tADSR2.
329+ @param adsr A pointer to the relevant tADSRT.
326330
327− @fn void tADSR2_on (tADSR2* const, float velocity)
331+ @fn void tADSRT_on (tADSRT* const, float velocity)
328332 @brief
329− @param adsr A pointer to the relevant tADSR2.
333+ @param adsr A pointer to the relevant tADSRT.
330334
331− @fn void tADSR2_off (tADSR2* const)
335+ @fn void tADSRT_off (tADSRT* const)
332336 @brief
333− @param adsr A pointer to the relevant tADSR2.
337+ @param adsr A pointer to the relevant tADSRT.
334338
335339 @} */
336340
337− typedef struct _tADSR2
341+ typedef struct _tADSRT
338342 {
339343
340344 tMempool mempool;
341− float sampleRateInMs;
342− float attack;
343− float decay;
344− float release;
345− float attackLambda;
346− float decayLambda;
347− float releaseLambda;
348− float sustain;
349− float leakGain;
345+ const float *exp_buff;
346+ uint32_t buff_size;
347+ uint32_t buff_sizeMinusOne;
348+ float bufferSizeDividedBySampleRateInMs;
349+ float next;
350+
351+ float attackInc, decayInc, releaseInc, rampInc;
352+
353+ uint32_t whichStage;
354+
355+ float sustain, gain, rampPeak, releasePeak;
356+
357+ float attackPhase, decayPhase, releasePhase, rampPhase;
358+
350359 float leakFactor;
351− float targetGainSquared;
352− float factor;
353− float oneMinusFactor;
354− float gain;
355− uint8_t attacking;
356− uint8_t gate;
357− float env;
358− float envTarget;
359− } _tADSR2;
360−
361− typedef _tADSR2* tADSR2;
360+ } _tADSRT;
362361
363− void tADSR2_init (tADSR2* const, float attack, float decay, float sustain, float release, LEAF* const leaf);
364− void tADSR2_initToPool (tADSR2* const, float attack, float decay, float sustain, float release, tMempool* const);
365− void tADSR2_free (tADSR2* const);
362+ typedef _tADSRT* tADSRT;
366363
367− float tADSR2_tick (tADSR2* const);
368− void tADSR2_setAttack (tADSR2* const, float attack);
369− void tADSR2_setDecay (tADSR2* const, float decay);
370− void tADSR2_setSustain (tADSR2* const, float sustain);
371− void tADSR2_setRelease (tADSR2* const, float release);
372− void tADSR2_setLeakFactor (tADSR2* const, float leakFactor);
373− void tADSR2_on (tADSR2* const, float velocity);
374− void tADSR2_off (tADSR2* const);
364+ void tADSRT_init (tADSRT* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, LEAF* const leaf);
365+ void tADSRT_initToPool (tADSRT* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, tMempool* const);
366+ void tADSRT_free (tADSRT* const);
375367
368+ float tADSRT_tick (tADSRT* const);
369+ float tADSRT_tickNoInterp (tADSRT* const adsrenv);
370+ void tADSRT_setAttack (tADSRT* const, float attack);
371+ void tADSRT_setDecay (tADSRT* const, float decay);
372+ void tADSRT_setSustain (tADSRT* const, float sustain);
373+ void tADSRT_setRelease (tADSRT* const, float release);
374+ void tADSRT_setLeakFactor (tADSRT* const, float leakFactor);
375+ void tADSRT_on (tADSRT* const, float velocity);
376+ void tADSRT_off (tADSRT* const);
376377
377378 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
378379
379380 /*!
380− @defgroup tadsr3 tADSR3
381+ @defgroup tadsrs tADSRS
381382 @ingroup envelopes
382383 @brief
383384 @{
384385
385− @fn void tADSR3_init (tADSR3* const, float attack, float decay, float sustain, float release, LEAF* const leaf)
386− @brief Initialize a tADSR3 to the default mempool of a LEAF instance.
387− @param adsr A pointer to the tADSR3 to initialize.
386+ @fn void tADSRS_init (tADSRS* const, float attack, float decay, float sustain, float release, LEAF* const leaf)
387+ @brief Initialize a tADSRS to the default mempool of a LEAF instance.
388+ @param adsr A pointer to the tADSRS to initialize.
388389 @param leaf A pointer to the leaf instance.
389390
390− @fn void tADSR3_initToPool (tADSR3* const, float attack, float decay, float sustain, float release, tMempool* const)
391− @brief Initialize a tADSR3 to a specified mempool.
392− @param adsr A pointer to the tADSR3 to initialize.
391+ @fn void tADSRS_initToPool (tADSRS* const, float attack, float decay, float sustain, float release, tMempool* const)
392+ @brief Initialize a tADSRS to a specified mempool.
393+ @param adsr A pointer to the tADSRS to initialize.
393394 @param mempool A pointer to the tMempool to use.
394395
395− @fn void tADSR3_free (tADSR3* const)
396− @brief Free a tADSR3 from its mempool.
397− @param adsr A pointer to the tADSR3 to free.
396+ @fn void tADSRS_free (tADSRS* const)
397+ @brief Free a tADSRS from its mempool.
398+ @param adsr A pointer to the tADSRS to free.
398399
399− @fn float tADSR3_tick (tADSR3* const)
400+ @fn float tADSRS_tick (tADSRS* const)
400401 @brief
401− @param adsr A pointer to the relevant tADSR3.
402+ @param adsr A pointer to the relevant tADSRS.
402403
403− @fn void tADSR3_setAttack (tADSR3* const, float attack)
404+ @fn void tADSRS_setAttack (tADSRS* const, float attack)
404405 @brief
405− @param adsr A pointer to the relevant tADSR3.
406+ @param adsr A pointer to the relevant tADSRS.
406407
407− @fn void tADSR3_setDecay (tADSR3* const, float decay)
408+ @fn void tADSRS_setDecay (tADSRS* const, float decay)
408409 @brief
409− @param adsr A pointer to the relevant tADSR3.
410+ @param adsr A pointer to the relevant tADSRS.
410411
411− @fn void tADSR3_setSustain (tADSR3* const, float sustain)
412+ @fn void tADSRS_setSustain (tADSRS* const, float sustain)
412413 @brief
413− @param adsr A pointer to the relevant tADSR3.
414+ @param adsr A pointer to the relevant tADSRS.
414415
415− @fn void tADSR3_setRelease (tADSR3* const, float release)
416+ @fn void tADSRS_setRelease (tADSRS* const, float release)
416417 @brief
417− @param adsr A pointer to the relevant tADSR3.
418+ @param adsr A pointer to the relevant tADSRS.
418419
419− @fn void tADSR3_setLeakFactor (tADSR3* const, float leakFactor)
420+ @fn void tADSRS_setLeakFactor (tADSRS* const, float leakFactor)
420421 @brief
421− @param adsr A pointer to the relevant tADSR3.
422+ @param adsr A pointer to the relevant tADSRS.
422423
423− @fn void tADSR3_on (tADSR3* const, float velocity)
424+ @fn void tADSRS_on (tADSRS* const, float velocity)
424425 @brief
425− @param adsr A pointer to the relevant tADSR3.
426+ @param adsr A pointer to the relevant tADSRS.
426427
427− @fn void tADSR3_off (tADSR3* const)
428+ @fn void tADSRS_off (tADSRS* const)
428429 @brief
429− @param adsr A pointer to the relevant tADSR3.
430+ @param adsr A pointer to the relevant tADSRS.
430431
431432 @} */
432433
@@ -439,7 +440,7 @@ extern "C" { · 6 unmodified lines
439440 env_ramp
440441 };
441442
442− typedef struct _tADSR3
443+ typedef struct _tADSRS
443444 {
444445
445446 tMempool mempool;
@@ -464,119 +465,22 @@ extern "C" { · 18 unmodified lines
464465 float oneMinusFactor;
465466 float gain;
466467
467− } _tADSR3;
468−
469− typedef _tADSR3* tADSR3;
470−
471− void tADSR3_init (tADSR3* const, float attack, float decay, float sustain, float release, LEAF* const leaf);
472− void tADSR3_initToPool (tADSR3* const, float attack, float decay, float sustain, float release, tMempool* const);
473− void tADSR3_free (tADSR3* const);
474−
475− float tADSR3_tick (tADSR3* const);
476− void tADSR3_setAttack (tADSR3* const, float attack);
477− void tADSR3_setDecay (tADSR3* const, float decay);
478− void tADSR3_setSustain (tADSR3* const, float sustain);
479− void tADSR3_setRelease (tADSR3* const, float release);
480− void tADSR3_setLeakFactor (tADSR3* const, float leakFactor);
481− void tADSR3_on (tADSR3* const, float velocity);
482− void tADSR3_off (tADSR3* const);
483−
484− // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
485−
486− /*!
487− @defgroup tadsr4 tADSR4
488− @ingroup envelopes
489− @brief
490− @{
491−
492− @fn void tADSR4_init (tADSR4* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, LEAF* const leaf)
493− @brief Initialize a tADSR4 to the default mempool of a LEAF instance.
494− @param adsr A pointer to the tADSR4 to initialize.
495− @param leaf A pointer to the leaf instance.
496−
497− @fn void tADSR4_initToPool (tADSR4* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, tMempool* const)
498− @brief Initialize a tADSR4 to a specified mempool.
499− @param adsr A pointer to the tADSR4 to initialize.
500− @param mempool A pointer to the tMempool to use.
501−
502− @fn void tADSR4_free (tADSR4* const)
503− @brief Free a tADSR4 from its mempool.
504− @param adsr A pointer to the tADSR4 to free.
505−
506− @fn float tADSR4_tick (tADSR4* const)
507− @brief
508− @param adsr A pointer to the relevant tADSR4.
509−
510− @fn float tADSR4_tickNoInterp (tADSR4* const adsrenv)
511− @brief
512− @param adsr A pointer to the relevant tADSR4.
513−
514− @fn void tADSR4_setAttack (tADSR4* const, float attack)
515− @brief
516− @param adsr A pointer to the relevant tADSR4.
517−
518− @fn void tADSR4_setDecay (tADSR4* const, float decay)
519− @brief
520− @param adsr A pointer to the relevant tADSR4.
521−
522− @fn void tADSR4_setSustain (tADSR4* const, float sustain)
523− @brief
524− @param adsr A pointer to the relevant tADSR4.
525−
526− @fn void tADSR4_setRelease (tADSR4* const, float release)
527− @brief
528− @param adsr A pointer to the relevant tADSR4.
529−
530− @fn void tADSR4_setLeakFactor (tADSR4* const, float leakFactor)
531− @brief
532− @param adsr A pointer to the relevant tADSR4.
533−
534− @fn void tADSR4_on (tADSR4* const, float velocity)
535− @brief
536− @param adsr A pointer to the relevant tADSR4.
537−
538− @fn void tADSR4_off (tADSR4* const)
539− @brief
540− @param adsr A pointer to the relevant tADSR4.
541−
542− @} */
543−
544− typedef struct _tADSR4
545− {
546−
547− tMempool mempool;
548− const float *exp_buff;
549− uint32_t buff_size;
550− uint32_t buff_sizeMinusOne;
551− float bufferSizeDividedBySampleRateInMs;
552− float next;
553−
554− float attackInc, decayInc, releaseInc, rampInc;
555−
556− uint32_t whichStage;
557−
558− float sustain, gain, rampPeak, releasePeak;
559−
560− float attackPhase, decayPhase, releasePhase, rampPhase;
561−
562− float leakFactor;
563− } _tADSR4;
564−
565− typedef _tADSR4* tADSR4;
566−
567− void tADSR4_init (tADSR4* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, LEAF* const leaf);
568− void tADSR4_initToPool (tADSR4* const, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, tMempool* const);
569− void tADSR4_free (tADSR4* const);
570−
571− float tADSR4_tick (tADSR4* const);
572− float tADSR4_tickNoInterp (tADSR4* const adsrenv);
573− void tADSR4_setAttack (tADSR4* const, float attack);
574− void tADSR4_setDecay (tADSR4* const, float decay);
575− void tADSR4_setSustain (tADSR4* const, float sustain);
576− void tADSR4_setRelease (tADSR4* const, float release);
577− void tADSR4_setLeakFactor (tADSR4* const, float leakFactor);
578− void tADSR4_on (tADSR4* const, float velocity);
579− void tADSR4_off (tADSR4* const);
468+ } _tADSRS;
469+
470+ typedef _tADSRS* tADSRS;
471+
472+ void tADSRS_init (tADSRS* const, float attack, float decay, float sustain, float release, LEAF* const leaf);
473+ void tADSRS_initToPool (tADSRS* const, float attack, float decay, float sustain, float release, tMempool* const);
474+ void tADSRS_free (tADSRS* const);
475+
476+ float tADSRS_tick (tADSRS* const);
477+ void tADSRS_setAttack (tADSRS* const, float attack);
478+ void tADSRS_setDecay (tADSRS* const, float decay);
479+ void tADSRS_setSustain (tADSRS* const, float sustain);
480+ void tADSRS_setRelease (tADSRS* const, float release);
481+ void tADSRS_setLeakFactor (tADSRS* const, float leakFactor);
482+ void tADSRS_on (tADSRS* const, float velocity);
483+ void tADSRS_off (tADSRS* const);
580484
581485 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
582486
leaf/Inc/leaf-oscillators.h+78−78
@@ -1015,7 +1015,7 @@ extern "C" { · 1014 unmodified lines
10151015 //==============================================================================
10161016
10171017 /*!
1018− @defgroup twaveset tWaveSynth
1018+ @defgroup twavesynth tWaveSynth
10191019 @ingroup oscillators
10201020 @brief Set of anti-aliased wavetable oscillators that can be faded between.
10211021 @{
@@ -1091,34 +1091,34 @@ extern "C" { · 69 unmodified lines
10911091 //==============================================================================
10921092
10931093 /*!
1094− @defgroup tcompactwavetable tCompactWaveTable
1094+ @defgroup ttwavetables tWaveTableS
10951095 @ingroup oscillators
10961096 @brief A more space-efficient anti-aliased wavetable generator than tWaveTable but with slightly worse fidelity.
10971097 @{
10981098
1099− @fn void tCompactWaveTable_init (tCompactWaveTable* const osc, float* table, int size, float maxFreq, LEAF* const leaf)
1100− @brief Initialize a tCompactWaveTable to the default mempool of a LEAF instance.
1101− @param osc A pointer to the tCompactWaveTable to initialize.
1099+ @fn void tWaveTableS_init (tWaveTableS* const osc, float* table, int size, float maxFreq, LEAF* const leaf)
1100+ @brief Initialize a tWaveTableS to the default mempool of a LEAF instance.
1101+ @param osc A pointer to the tWaveTableS to initialize.
11021102 @param table A pointer to the wavetable data.
11031103 @param size The number of samples in the wavetable.
11041104 @param maxFreq The maximum expected frequency of the oscillator. The higher this is, the more memory will be needed.
11051105 @param leaf A pointer to the leaf instance.
11061106
1107− @fn void tCompactWaveTable_initToPool (tCompactWaveTable* const osc, float* table, int size, float maxFreq, tMempool* const mempool)
1108− @brief Initialize a tCompactWaveTable to a specified mempool.
1109− @param osc A pointer to the tCompactWaveTable to initialize.
1107+ @fn void tWaveTableS_initToPool (tWaveTableS* const osc, float* table, int size, float maxFreq, tMempool* const mempool)
1108+ @brief Initialize a tWaveTableS to a specified mempool.
1109+ @param osc A pointer to the tWaveTableS to initialize.
11101110 @param table A pointer to the wavetable data.
11111111 @param size The number of samples in the wave table.
11121112 @param maxFreq The maximum expected frequency of the oscillator. The higher this is, the more memory will be needed.
11131113 @param mempool A pointer to the tMempool to use.
11141114
1115− @fn void tCompactWaveTable_free (tCompactWaveTable* const osc)
1116− @brief Free a tCompactWaveTable from its mempool.
1117− @param osc A pointer to the tCompactWaveTable to free.
1115+ @fn void tWaveTableS_free (tWaveTableS* const osc)
1116+ @brief Free a tWaveTableS from its mempool.
1117+ @param osc A pointer to the tWaveTableS to free.
11181118
11191119 @} */
11201120
1121− typedef struct _tCompactWaveTable
1121+ typedef struct _tWaveTableS
11221122 {
11231123 tMempool mempool;
11241124
@@ -1129,150 +1129,150 @@ extern "C" { · 4 unmodified lines
11291129 tButterworth bl;
11301130 float dsBuffer[2];
11311131 tOversampler ds;
1132− } _tCompactWaveTable;
1132+ } _tWaveTableS;
11331133
1134− typedef _tCompactWaveTable* tCompactWaveTable;
1134+ typedef _tWaveTableS* tWaveTableS;
11351135
1136− void tCompactWaveTable_init(tCompactWaveTable* const osc, float* table, int size, float maxFreq, LEAF* const leaf);
1137− void tCompactWaveTable_initToPool(tCompactWaveTable* const osc, float* table, int size, float maxFreq, tMempool* const mempool);
1138− void tCompactWaveTable_free(tCompactWaveTable* const osc);
1136+ void tWaveTableS_init(tWaveTableS* const osc, float* table, int size, float maxFreq, LEAF* const leaf);
1137+ void tWaveTableS_initToPool(tWaveTableS* const osc, float* table, int size, float maxFreq, tMempool* const mempool);
1138+ void tWaveTableS_free(tWaveTableS* const osc);
11391139
11401140 /*!
1141− @defgroup tcompactwaveosc tCompactWaveOsc
1141+ @defgroup twaveoscs tWaveOscS
11421142 @ingroup oscillators
11431143 @brief A more space-efficient anti-aliased wavetable oscillator than tWaveOsc but with slightly worse fidelity.
11441144 @{
11451145
1146− @fn void tCompactWaveOsc_init (tCompactWaveOsc* const osc, float* table, int size, float maxFreq, LEAF* const leaf)
1147− @brief Initialize a tCompactWaveOsc to the default mempool of a LEAF instance.
1148− @param osc A pointer to the tCompactWaveOsc to initialize.
1146+ @fn void tWaveOscS_init (tWaveOscS* const osc, float* table, int size, float maxFreq, LEAF* const leaf)
1147+ @brief Initialize a tWaveOscS to the default mempool of a LEAF instance.
1148+ @param osc A pointer to the tWaveOscS to initialize.
11491149 @param table A pointer to the wavetable data.
11501150 @param size The number of samples in the wavetable.
11511151 @param maxFreq The maximum expected frequency of the oscillator. The higher this is, the more memory will be needed.
11521152 @param leaf A pointer to the leaf instance.
11531153
1154− @fn void tCompactWaveOsc_initToPool (tCompactWaveOsc* const osc, float* table, int size, float maxFreq, tMempool* const mempool)
1155− @brief Initialize a tCompactWaveOsc to a specified mempool.
1156− @param osc A pointer to the tCompactWaveOsc to initialize.
1154+ @fn void tWaveOscS_initToPool (tWaveOscS* const osc, float* table, int size, float maxFreq, tMempool* const mempool)
1155+ @brief Initialize a tWaveOscS to a specified mempool.
1156+ @param osc A pointer to the tWaveOscS to initialize.
11571157 @param table A pointer to the wavetable data.
11581158 @param size The number of samples in the wave table.
11591159 @param maxFreq The maximum expected frequency of the oscillator. The higher this is, the more memory will be needed.
11601160 @param mempool A pointer to the tMempool to use.
11611161
1162− @fn void tCompactWaveOsc_free (tCompactWaveOsc* const osc)
1163− @brief Free a tCompactWaveOsc from its mempool.
1164− @param osc A pointer to the tCompactWaveOsc to free.
1162+ @fn void tWaveOscS_free (tWaveOscS* const osc)
1163+ @brief Free a tWaveOscS from its mempool.
1164+ @param osc A pointer to the tWaveOscS to free.
11651165
1166− @fn float tCompactWaveOsc_tick (tCompactWaveOsc* const osc)
1167− @brief Tick a tCompactWaveOsc oscillator.
1168− @param osc A pointer to the relevant tCompactWaveOsc.
1166+ @fn float tWaveOscS_tick (tWaveOscS* const osc)
1167+ @brief Tick a tWaveOscS oscillator.
1168+ @param osc A pointer to the relevant tWaveOscS.
11691169 @return The ticked sample as a float from -1 to 1.
11701170
1171− @fn void tCompactWaveOsc_setFreq (tCompactWaveOsc* const osc, float freq)
1172− @brief Set the frequency of a tCompactWaveOsc oscillator.
1173− @param osc A pointer to the relevant tCompactWaveOsc.
1171+ @fn void tWaveOscS_setFreq (tWaveOscS* const osc, float freq)
1172+ @brief Set the frequency of a tWaveOscS oscillator.
1173+ @param osc A pointer to the relevant tWaveOscS.
11741174 @param freq The frequency to set the oscillator to.
11751175
11761176 @} */
11771177
1178− typedef struct _tCompactWaveOsc
1178+ typedef struct _tWaveOscS
11791179 {
11801180 tMempool mempool;
1181− tCompactWaveTable table;
1181+ tWaveTableS table;
11821182 float inc, freq;
11831183 float phase;
11841184 float phaseOffset;
11851185 int oct;
11861186 float w;
11871187 float aa;
1188− } _tCompactWaveOsc;
1188+ } _tWaveOscS;
11891189
1190− typedef _tCompactWaveOsc* tCompactWaveOsc;
1190+ typedef _tWaveOscS* tWaveOscS;
11911191
1192− void tCompactWaveOsc_init(tCompactWaveOsc* const osc, tCompactWaveTable* const table, LEAF* const leaf);
1193− void tCompactWaveOsc_initToPool(tCompactWaveOsc* const osc, tCompactWaveTable* const table, tMempool* const mempool);
1194− void tCompactWaveOsc_free(tCompactWaveOsc* const osc);
1192+ void tWaveOscS_init(tWaveOscS* const osc, tWaveTableS* const table, LEAF* const leaf);
1193+ void tWaveOscS_initToPool(tWaveOscS* const osc, tWaveTableS* const table, tMempool* const mempool);
1194+ void tWaveOscS_free(tWaveOscS* const osc);
11951195
1196− float tCompactWaveOsc_tick(tCompactWaveOsc* const osc);
1197− void tCompactWaveOsc_setFreq(tCompactWaveOsc* const osc, float freq);
1198− void tCompactWaveOsc_setAntiAliasing(tCompactWaveOsc* const osc, float aa);
1199− void tCompactWaveOsc_setPhaseOffset(tCompactWaveOsc* const osc, float phase);
1196+ float tWaveOscS_tick(tWaveOscS* const osc);
1197+ void tWaveOscS_setFreq(tWaveOscS* const osc, float freq);
1198+ void tWaveOscS_setAntiAliasing(tWaveOscS* const osc, float aa);
1199+ void tWaveOscS_setPhaseOffset(tWaveOscS* const osc, float phase);
12001200
12011201 //==============================================================================
12021202
12031203 /*!
1204− @defgroup tCompactWaveset tCompactWaveSynth
1204+ @defgroup twavesynths tWaveSynthS
12051205 @ingroup oscillators
12061206 @brief Set of anti-aliased wavetable oscillators that can be faded between.
12071207 @{
12081208
1209− @fn void tCompactWaveSynth_init(tWaveSynth* const osc, const float** tables, int n, int size, float maxFreq, LEAF* const leaf)
1210− @brief Initialize a tCompactWaveSynth to the default mempool of a LEAF instance.
1211− @param osc A pointer to the tCompactWaveSynth to initialize.
1209+ @fn void tWaveSynthS_init(tWaveSynth* const osc, const float** tables, int n, int size, float maxFreq, LEAF* const leaf)
1210+ @brief Initialize a tWaveSynthS to the default mempool of a LEAF instance.
1211+ @param osc A pointer to the tWaveSynthS to initialize.
12121212 @param tables An array of pointers to wavetable data.
12131213 @param n The number of wavetables.
12141214 @param size The number of samples in each of the wavetables.
12151215 @param maxFreq The maximum expected frequency of the oscillator. The higher this is, the more memory will be needed.
12161216 @param leaf A pointer to the leaf instance.
12171217
1218− @fn void tCompactWaveSynth_initToPool(tWaveSynth* const osc, const float** tables, int n, int size, float maxFreq, tMempool* const mempool)
1219− @brief Initialize a tCompactWaveSynth to a specified mempool.
1220− @param osc A pointer to the tCompactWaveTable to initialize.
1218+ @fn void tWaveSynthS_initToPool(tWaveSynth* const osc, const float** tables, int n, int size, float maxFreq, tMempool* const mempool)
1219+ @brief Initialize a tWaveSynthS to a specified mempool.
1220+ @param osc A pointer to the tWaveTableS to initialize.
12211221 @param tables An array of pointers to wavetable data.
12221222 @param n The number of wavetables.
12231223 @param size The number of samples in each of the wavetables.
12241224 @param maxFreq The maximum expected frequency of the oscillator. The higher this is, the more memory will be needed.
12251225 @param mempool A pointer to the tMempool to use.
12261226
1227− @fn void tCompactWaveSynth_free (tWaveSynth* const osc)
1228− @brief Free a tCompactWaveSynth from its mempool.
1229− @param osc A pointer to the tCompactWaveSynth to free.
1227+ @fn void tWaveSynthS_free (tWaveSynth* const osc)
1228+ @brief Free a tWaveSynthS from its mempool.
1229+ @param osc A pointer to the tWaveSynthS to free.
12301230
1231− @fn float tCompactWaveSynth_tick (tWaveSynth* const osc)
1232− @brief Tick a tCompactWaveSynth oscillator.
1233− @param osc A pointer to the relevant tCompactWaveSynth.
1231+ @fn float tWaveSynthS_tick (tWaveSynth* const osc)
1232+ @brief Tick a tWaveSynthS oscillator.
1233+ @param osc A pointer to the relevant tWaveSynthS.
12341234 @return The ticked sample as a float from -1 to 1.
12351235
1236− @fn void tCompactWaveSynth_setFreq (tWaveSynth* const osc, float freq)
1237− @brief Set the frequency of a tCompactWaveSynth oscillator.
1238− @param osc A pointer to the relevant tCompactWaveSynth.
1236+ @fn void tWaveSynthS_setFreq (tWaveSynth* const osc, float freq)
1237+ @brief Set the frequency of a tWaveSynthS oscillator.
1238+ @param osc A pointer to the relevant tWaveSynthS.
12391239 @param freq The frequency to set the oscillator to.
12401240
1241− @fn void tCompactWaveSynth_setIndex(tWaveSynth* const osc, float index)
1241+ @fn void tWaveSynthS_setIndex(tWaveSynth* const osc, float index)
12421242 @brief Set the output index of the wavetable set.
12431243 @param index The new index from 0.0 to 1.0 as a smooth fade from the first wavetable in the set to the last.
12441244
12451245 @} */
12461246
1247− typedef struct _tCompactWaveSynth
1247+ typedef struct _tWaveSynthS
12481248 {
12491249 tMempool mempool;
12501250
1251− tCompactWaveTable* tables;
1252− tCompactWaveOsc** oscs;
1251+ tWaveTableS* tables;
1252+ tWaveOscS** oscs;
12531253 int numTables;
12541254 int numVoices;
12551255 float* g;
12561256 float index;
12571257 float maxFreq;
1258− } _tCompactWaveSynth;
1258+ } _tWaveSynthS;
12591259
1260− typedef _tCompactWaveSynth* tCompactWaveSynth;
1260+ typedef _tWaveSynthS* tWaveSynthS;
12611261
1262− void tCompactWaveSynth_init(tCompactWaveSynth* const osc, int numVoices, float** tables, int* sizes,
1262+ void tWaveSynthS_init(tWaveSynthS* const osc, int numVoices, float** tables, int* sizes,
12631263 int numTables, float maxFreq, LEAF* const leaf);
1264− void tCompactWaveSynth_initToPool(tCompactWaveSynth* const osc, int numVoices, float** tables, int* sizes,
1264+ void tWaveSynthS_initToPool(tWaveSynthS* const osc, int numVoices, float** tables, int* sizes,
12651265 int numTables, float maxFreq, tMempool* const mempool);
1266− void tCompactWaveSynth_free(tCompactWaveSynth* const osc);
1267−
1268− float tCompactWaveSynth_tick(tCompactWaveSynth* const osc);
1269− float tCompactWaveSynth_tickVoice(tCompactWaveSynth* const cy, int voice);
1270− void tCompactWaveSynth_setFreq(tCompactWaveSynth* const osc, int voice, float freq);
1271− void tCompactWaveSynth_setAntiAliasing(tCompactWaveSynth* const osc, float aa);
1272− void tCompactWaveSynth_setIndex(tCompactWaveSynth* const osc, float index);
1273− void tCompactWaveSynth_setIndexGain(tCompactWaveSynth* const osc, int i, float gain);
1274− void tCompactWaveSynth_setIndexPhase(tCompactWaveSynth* const osc, int i, float phase);
1275−// void tCompactWaveSynth_setIndexTable(tCompactWaveSynth* const osc, int i, float* table, int size);
1266+ void tWaveSynthS_free(tWaveSynthS* const osc);
1267+
1268+ float tWaveSynthS_tick(tWaveSynthS* const osc);
1269+ float tWaveSynthS_tickVoice(tWaveSynthS* const cy, int voice);
1270+ void tWaveSynthS_setFreq(tWaveSynthS* const osc, int voice, float freq);
1271+ void tWaveSynthS_setAntiAliasing(tWaveSynthS* const osc, float aa);
1272+ void tWaveSynthS_setIndex(tWaveSynthS* const osc, float index);
1273+ void tWaveSynthS_setIndexGain(tWaveSynthS* const osc, int i, float gain);
1274+ void tWaveSynthS_setIndexPhase(tWaveSynthS* const osc, int i, float phase);
1275+// void tWaveSynthS_setIndexTable(tWaveSynthS* const osc, int i, float* table, int size);
12761276
12771277 #ifdef __cplusplus
12781278 }
leaf/Inc/leaf-sampling.h+1−1
@@ -391,7 +391,7 @@ extern "C" { · 390 unmodified lines
391391
392392
393393 /*!
394− @defgroup tMBSampler tMBSampler
394+ @defgroup tmbsampler tMBSampler
395395 @ingroup sampling
396396 @brief Loopable input sampler using minBLEP to remove discontinuities.
397397 @{
leaf/Src/leaf-envelopes.c+46−205
@@ -486,165 +486,6 @@ float tADSR_tick(tADSR* const adsrenv) · 485 unmodified lines
486486 #endif // LEAF_INCLUDE_ADSR_TABLES
487487
488488
489−
490−/* ADSR 2*/
491−//This one is adapted from the VCV Rack code
492−//-JS
493−
494−
495−
496−const float ADSR2_MIN_TIME = 1e-3f;
497−const float ADSR2_INV_MIN_TIME = 1000.0f;
498−const float ADSR2_MAX_TIME = 10.f;
499−const float ADSR2_LAMBDA_BASE = 10000.0f;
500−
501−
502−void tADSR2_init(tADSR2* const adsrenv, float attack, float decay, float sustain, float release, LEAF* const leaf)
503−{
504− tADSR2_initToPool(adsrenv, attack, decay, sustain, release, &leaf->mempool);
505−}
506−
507−void tADSR2_initToPool (tADSR2* const adsrenv, float attack, float decay, float sustain, float release, tMempool* const mp)
508−{
509− _tMempool* m = *mp;
510− _tADSR2* adsr = *adsrenv = (_tADSR2*) mpool_alloc(sizeof(_tADSR2), m);
511− adsr->mempool = m;
512−
513− LEAF* leaf = adsr->mempool->leaf;
514−
515− adsr->sampleRateInMs = leaf->sampleRate * 0.001f;
516− adsr->attack = LEAF_clip(0.0f, attack * 0.001f, 1.0f);
517− adsr->attackLambda = powf(ADSR2_LAMBDA_BASE, -adsr->attack) * ADSR2_INV_MIN_TIME;
518−
519−
520− adsr->decay = LEAF_clip(0.0f, decay * 0.001f, 1.0f);
521− adsr->decayLambda = powf(ADSR2_LAMBDA_BASE, -adsr->decay) * ADSR2_INV_MIN_TIME;
522−
523−
524− adsr->sustain= sustain;
525−
526−
527− adsr->release = LEAF_clip(0.0f, release * 0.001f, 1.0f);
528− adsr->releaseLambda = powf(ADSR2_LAMBDA_BASE, -adsr->release) * ADSR2_INV_MIN_TIME;
529−
530− adsr->attacking = 0;
531− adsr->gate = 0;
532− adsr->gain = 1.0f;
533− adsr->targetGainSquared = 1.0f;
534− adsr->factor = 0.01f;
535− adsr->oneMinusFactor = 0.99f;
536− adsr->env = 0.0f;
537− adsr->leakFactor = 1.0f;
538−}
539−
540−void tADSR2_free (tADSR2* const adsrenv)
541−{
542− _tADSR2* adsr = *adsrenv;
543− mpool_free((char*)adsr, adsr->mempool);
544−}
545−
546−void tADSR2_setAttack(tADSR2* const adsrenv, float attack)
547−{
548− _tADSR2* adsr = *adsrenv;
549− adsr->attack = LEAF_clip(0.0f, attack * 0.001f, 1.0f);
550− adsr->attackLambda = fastPowf(ADSR2_LAMBDA_BASE, -adsr->attack) * ADSR2_INV_MIN_TIME;
551−
552−}
553−
554−void tADSR2_setDecay(tADSR2* const adsrenv, float decay)
555−{
556− _tADSR2* adsr = *adsrenv;
557− adsr->decay = LEAF_clip(0.0f, decay * 0.001f, 1.0f);
558− adsr->decayLambda = fastPowf(ADSR2_LAMBDA_BASE, -adsr->decay) * ADSR2_INV_MIN_TIME;
559−
560−}
561−
562−void tADSR2_setSustain(tADSR2* const adsrenv, float sustain)
563−{
564− _tADSR2* adsr = *adsrenv;
565− adsr->sustain = sustain;
566−
567− if (adsr->gate)
568− {
569− if (adsr->attacking == 0)
570− {
571− adsr->envTarget = sustain;
572− }
573− }
574−}
575−
576−void tADSR2_setRelease(tADSR2* const adsrenv, float release)
577−{
578− _tADSR2* adsr = *adsrenv;
579− adsr->release = LEAF_clip(0.0f, release * 0.001f, 1.0f);
580− adsr->releaseLambda = fastPowf(ADSR2_LAMBDA_BASE, -adsr->release) * ADSR2_INV_MIN_TIME;
581−}
582−
583−// 0.999999 is slow leak, 0.9 is fast leak
584−void tADSR2_setLeakFactor(tADSR2* const adsrenv, float leakFactor)
585−{
586− _tADSR2* adsr = *adsrenv;
587−
588− adsr->leakFactor = leakFactor;
589−}
590−
591−void tADSR2_on(tADSR2* const adsrenv, float velocity)
592−{
593− _tADSR2* adsr = *adsrenv;
594− adsr->targetGainSquared = velocity * velocity;
595− adsr->envTarget = 1.2f;
596− adsr->leakGain = 1.0f;
597− adsr->gate = 1;
598− adsr->attacking = 1;
599−}
600−
601−void tADSR2_off(tADSR2* const adsrenv)
602−{
603− _tADSR2* adsr = *adsrenv;
604− adsr->gate = 0;
605− adsr->envTarget = 0.0f;
606−}
607−
608−float tADSR2_tick(tADSR2* const adsrenv)
609−{
610− _tADSR2* adsr = *adsrenv;
611− LEAF* leaf = adsr->mempool->leaf;
612−
613− float lambda;
614−
615− if (adsr->gate)
616− {
617− if (adsr->attacking)
618− {
619− lambda = adsr->attackLambda;
620− }
621− else
622− {
623− lambda = adsr->decayLambda;
624− }
625− }
626− else
627− {
628− lambda = adsr->releaseLambda;
629− }
630−
631−
632− // Adjust env
633− adsr->env += (adsr->envTarget - adsr->env) * lambda * leaf->invSampleRate;
634−
635− // Turn off attacking state if envelope is HIGH
636− if (adsr->env >= 1.0f)
637− {
638− adsr->attacking = 0;
639− adsr->envTarget = adsr->sustain;
640− }
641−
642− //smooth the gain value -- this is not ideal, a retrigger while the envelope is still going with a new gain will cause a jump, although it will be smoothed quickly. Maybe doing the math so the range is computed based on the gain rather than 0.->1. is preferable? But that's harder to get the exponential curve right without a lookup.
643− adsr->gain = ((adsr->factor*adsr->targetGainSquared)+(adsr->oneMinusFactor*adsr->gain));
644− adsr->leakGain *= adsr->leakFactor;
645− return adsr->env * adsr->gain * adsr->leakGain;
646−}
647−
648489 /* ADSR 3*/
649490 //This one doesn't use any lookup table - by Nigel Redmon from his blog. Thanks, Nigel!
650491 //-JS
@@ -655,15 +496,15 @@ float calcADSR3Coef(float rate, float targetRatio) · 4 unmodified lines
655496 }
656497
657498
658−void tADSR3_init(tADSR3* const adsrenv, float attack, float decay, float sustain, float release, LEAF* const leaf)
499+void tADSRS_init(tADSRS* const adsrenv, float attack, float decay, float sustain, float release, LEAF* const leaf)
659500 {
660− tADSR3_initToPool(adsrenv, attack, decay, sustain, release, &leaf->mempool);
501+ tADSRS_initToPool(adsrenv, attack, decay, sustain, release, &leaf->mempool);
661502 }
662503
663−void tADSR3_initToPool (tADSR3* const adsrenv, float attack, float decay, float sustain, float release, tMempool* const mp)
504+void tADSRS_initToPool (tADSRS* const adsrenv, float attack, float decay, float sustain, float release, tMempool* const mp)
664505 {
665506 _tMempool* m = *mp;
666− _tADSR3* adsr = *adsrenv = (_tADSR3*) mpool_alloc(sizeof(_tADSR3), m);
507+ _tADSRS* adsr = *adsrenv = (_tADSRS*) mpool_alloc(sizeof(_tADSRS), m);
667508 adsr->mempool = m;
668509
669510 LEAF* leaf = adsr->mempool->leaf;
@@ -695,41 +536,41 @@ void tADSR3_initToPool (tADSR3* const adsrenv, float attack, float decay, · 25 unmodified lines
695536 adsr->leakFactor = 1.0f;
696537 }
697538
698−void tADSR3_free (tADSR3* const adsrenv)
539+void tADSRS_free (tADSRS* const adsrenv)
699540 {
700− _tADSR3* adsr = *adsrenv;
541+ _tADSRS* adsr = *adsrenv;
701542 mpool_free((char*)adsr, adsr->mempool);
702543 }
703544
704−void tADSR3_setAttack(tADSR3* const adsrenv, float attack)
545+void tADSRS_setAttack(tADSRS* const adsrenv, float attack)
705546 {
706− _tADSR3* adsr = *adsrenv;
547+ _tADSRS* adsr = *adsrenv;
707548
708549 adsr->attackRate = attack * adsr->sampleRateInMs;
709550 adsr->attackCoef = calcADSR3Coef(adsr->attackRate, adsr->targetRatioA);
710551 adsr->attackBase = (1.0f + adsr->targetRatioA) * (1.0f - adsr->attackCoef);
711552 }
712553
713−void tADSR3_setDecay(tADSR3* const adsrenv, float decay)
554+void tADSRS_setDecay(tADSRS* const adsrenv, float decay)
714555 {
715− _tADSR3* adsr = *adsrenv;
556+ _tADSRS* adsr = *adsrenv;
716557
717558 adsr->decayRate = decay * adsr->sampleRateInMs;
718559 adsr->decayCoef = calcADSR3Coef(adsr->decayRate,adsr-> targetRatioDR);
719560 adsr->decayBase = (adsr->sustainLevel - adsr->targetRatioDR) * (1.0f - adsr->decayCoef);
720561 }
721562
722−void tADSR3_setSustain(tADSR3* const adsrenv, float sustain)
563+void tADSRS_setSustain(tADSRS* const adsrenv, float sustain)
723564 {
724− _tADSR3* adsr = *adsrenv;
565+ _tADSRS* adsr = *adsrenv;
725566
726567 adsr->sustainLevel = sustain;
727568 adsr->decayBase = (adsr->sustainLevel - adsr->targetRatioDR) * (1.0f - adsr->decayCoef);
728569 }
729570
730−void tADSR3_setRelease(tADSR3* const adsrenv, float release)
571+void tADSRS_setRelease(tADSRS* const adsrenv, float release)
731572 {
732− _tADSR3* adsr = *adsrenv;
573+ _tADSRS* adsr = *adsrenv;
733574
734575 adsr->releaseRate = release * adsr->sampleRateInMs;
735576 adsr->releaseCoef = calcADSR3Coef(adsr->releaseRate, (float)adsr->targetRatioDR);
@@ -737,23 +578,23 @@ void tADSR3_setRelease(tADSR3* const adsrenv, float release) · 1 unmodified line
737578 }
738579
739580 // 0.999999 is slow leak, 0.9 is fast leak
740−void tADSR3_setLeakFactor(tADSR3* const adsrenv, float leakFactor)
581+void tADSRS_setLeakFactor(tADSRS* const adsrenv, float leakFactor)
741582 {
742− _tADSR3* adsr = *adsrenv;
583+ _tADSRS* adsr = *adsrenv;
743584
744585 adsr->leakFactor = leakFactor;
745586 }
746587
747−void tADSR3_on(tADSR3* const adsrenv, float velocity)
588+void tADSRS_on(tADSRS* const adsrenv, float velocity)
748589 {
749− _tADSR3* adsr = *adsrenv;
590+ _tADSRS* adsr = *adsrenv;
750591 adsr->state = env_attack;
751592 adsr->targetGainSquared = velocity * velocity;
752593 }
753594
754−void tADSR3_off(tADSR3* const adsrenv)
595+void tADSRS_off(tADSRS* const adsrenv)
755596 {
756− _tADSR3* adsr = *adsrenv;
597+ _tADSRS* adsr = *adsrenv;
757598
758599 if (adsr->state != env_idle)
759600 {
@@ -761,9 +602,9 @@ void tADSR3_off(tADSR3* const adsrenv) · 1 unmodified line
761602 }
762603 }
763604
764−float tADSR3_tick(tADSR3* const adsrenv)
605+float tADSRS_tick(tADSRS* const adsrenv)
765606 {
766− _tADSR3* adsr = *adsrenv;
607+ _tADSRS* adsr = *adsrenv;
767608
768609
769610 switch (adsr->state) {
@@ -803,17 +644,17 @@ float tADSR3_tick(tADSR3* const adsrenv) · 33 unmodified lines
803644
804645 /* ADSR 4 */ // new version of our original table-based ADSR but with the table passed in by the user
805646 // use this if the size of the big ADSR tables is too much.
806−void tADSR4_init (tADSR4* const adsrenv, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, LEAF* const leaf)
647+void tADSRT_init (tADSRT* const adsrenv, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, LEAF* const leaf)
807648 {
808− tADSR4_initToPool (adsrenv, attack, decay, sustain, release, expBuffer, bufferSize, &leaf->mempool);
649+ tADSRT_initToPool (adsrenv, attack, decay, sustain, release, expBuffer, bufferSize, &leaf->mempool);
809650 }
810651
811652 //initialize with an exponential function that decays -- i.e. a call to LEAF_generate_exp(expBuffer, 0.001f, 0.0f, 1.0f, -0.0008f, EXP_BUFFER_SIZE);
812653 //times are in ms
813−void tADSR4_initToPool (tADSR4* const adsrenv, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, tMempool* const mp)
654+void tADSRT_initToPool (tADSRT* const adsrenv, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize, tMempool* const mp)
814655 {
815656 _tMempool* m = *mp;
816− _tADSR4* adsr = *adsrenv = (_tADSR4*) mpool_alloc(sizeof(_tADSR4), m);
657+ _tADSRT* adsr = *adsrenv = (_tADSRT*) mpool_alloc(sizeof(_tADSRT), m);
817658 adsr->mempool = m;
818659
819660 LEAF* leaf = adsr->mempool->leaf;
@@ -852,15 +693,15 @@ void tADSR4_initToPool (tADSR4* const adsrenv, float attack, float decay, · 32 unmodified lines
852693 adsr->leakFactor = 1.0f;
853694 }
854695
855−void tADSR4_free (tADSR4* const adsrenv)
696+void tADSRT_free (tADSRT* const adsrenv)
856697 {
857− _tADSR4* adsr = *adsrenv;
698+ _tADSRT* adsr = *adsrenv;
858699 mpool_free((char*)adsr, adsr->mempool);
859700 }
860701
861−void tADSR4_setAttack(tADSR4* const adsrenv, float attack)
702+void tADSRT_setAttack(tADSRT* const adsrenv, float attack)
862703 {
863− _tADSR4* adsr = *adsrenv;
704+ _tADSRT* adsr = *adsrenv;
864705
865706 if (attack < 0.0f)
866707 {
@@ -870,9 +711,9 @@ void tADSR4_setAttack(tADSR4* const adsrenv, float attack) · 3 unmodified lines
870711 adsr->attackInc = adsr->bufferSizeDividedBySampleRateInMs / attack;
871712 }
872713
873−void tADSR4_setDecay(tADSR4* const adsrenv, float decay)
714+void tADSRT_setDecay(tADSRT* const adsrenv, float decay)
874715 {
875− _tADSR4* adsr = *adsrenv;
716+ _tADSRT* adsr = *adsrenv;
876717
877718 if (decay < 0.0f)
878719 {
@@ -881,18 +722,18 @@ void tADSR4_setDecay(tADSR4* const adsrenv, float decay) · 2 unmodified lines
881722 adsr->decayInc = adsr->bufferSizeDividedBySampleRateInMs / decay;
882723 }
883724
884−void tADSR4_setSustain(tADSR4* const adsrenv, float sustain)
725+void tADSRT_setSustain(tADSRT* const adsrenv, float sustain)
885726 {
886− _tADSR4* adsr = *adsrenv;
727+ _tADSRT* adsr = *adsrenv;
887728
888729 if (sustain > 1.0f) adsr->sustain = 1.0f;
889730 else if (sustain < 0.0f) adsr->sustain = 0.0f;
890731 else adsr->sustain = sustain;
891732 }
892733
893−void tADSR4_setRelease(tADSR4* const adsrenv, float release)
734+void tADSRT_setRelease(tADSRT* const adsrenv, float release)
894735 {
895− _tADSR4* adsr = *adsrenv;
736+ _tADSRT* adsr = *adsrenv;
896737
897738 if (release < 0.0f)
898739 {
@@ -902,17 +743,17 @@ void tADSR4_setRelease(tADSR4* const adsrenv, float release) · 3 unmodified lines
902743 }
903744
904745 // 0.999999 is slow leak, 0.9 is fast leak
905−void tADSR4_setLeakFactor(tADSR4* const adsrenv, float leakFactor)
746+void tADSRT_setLeakFactor(tADSRT* const adsrenv, float leakFactor)
906747 {
907− _tADSR4* adsr = *adsrenv;
748+ _tADSRT* adsr = *adsrenv;
908749
909750
910751 adsr->leakFactor = leakFactor;
911752 }
912753
913−void tADSR4_on(tADSR4* const adsrenv, float velocity)
754+void tADSRT_on(tADSRT* const adsrenv, float velocity)
914755 {
915− _tADSR4* adsr = *adsrenv;
756+ _tADSRT* adsr = *adsrenv;
916757
917758 if (adsr->whichStage != env_idle) // In case ADSR retriggered while it is still happening.
918759 {
@@ -931,9 +772,9 @@ void tADSR4_on(tADSR4* const adsrenv, float velocity) · 12 unmodified lines
931772 adsr->gain = velocity;
932773 }
933774
934−void tADSR4_off(tADSR4* const adsrenv)
775+void tADSRT_off(tADSRT* const adsrenv)
935776 {
936− _tADSR4* adsr = *adsrenv;
777+ _tADSRT* adsr = *adsrenv;
937778
938779 if (adsr->whichStage == env_idle)
939780 {
@@ -946,9 +787,9 @@ void tADSR4_off(tADSR4* const adsrenv) · 6 unmodified lines
946787 }
947788 }
948789
949−float tADSR4_tick(tADSR4* const adsrenv)
790+float tADSRT_tick(tADSRT* const adsrenv)
950791 {
951− _tADSR4* adsr = *adsrenv;
792+ _tADSRT* adsr = *adsrenv;
952793
953794 switch (adsr->whichStage)
954795 {
@@ -1071,9 +912,9 @@ float tADSR4_tick(tADSR4* const adsrenv) · 116 unmodified lines
1071912 return adsr->next;
1072913 }
1073914
1074−float tADSR4_tickNoInterp(tADSR4* const adsrenv)
915+float tADSRT_tickNoInterp(tADSRT* const adsrenv)
1075916 {
1076− _tADSR4* adsr = *adsrenv;
917+ _tADSRT* adsr = *adsrenv;
1077918
1078919 switch (adsr->whichStage)
1079920 {
leaf/Src/leaf-oscillators.c+59−59
@@ -2055,15 +2055,15 @@ void tWaveSynth_setIndexPhase(tWaveSynth* const cy, int i, float phase) · 2054 unmodified lines
20552055 //=======================================================================================
20562056 //=======================================================================================
20572057
2058−void tCompactWaveTable_init(tCompactWaveTable* const cy, float* table, int size, float maxFreq, LEAF* const leaf)
2058+void tWaveTableS_init(tWaveTableS* const cy, float* table, int size, float maxFreq, LEAF* const leaf)
20592059 {
2060− tCompactWaveTable_initToPool(cy, table, size, maxFreq, &leaf->mempool);
2060+ tWaveTableS_initToPool(cy, table, size, maxFreq, &leaf->mempool);
20612061 }
20622062
2063−void tCompactWaveTable_initToPool(tCompactWaveTable* const cy, float* table, int size, float maxFreq, tMempool* const mp)
2063+void tWaveTableS_initToPool(tWaveTableS* const cy, float* table, int size, float maxFreq, tMempool* const mp)
20642064 {
20652065 _tMempool* m = *mp;
2066− _tCompactWaveTable* c = *cy = (_tCompactWaveTable*) mpool_alloc(sizeof(_tCompactWaveTable), m);
2066+ _tWaveTableS* c = *cy = (_tWaveTableS*) mpool_alloc(sizeof(_tWaveTableS), m);
20672067 c->mempool = m;
20682068
20692069 // Determine base frequency
@@ -2117,9 +2117,9 @@ void tCompactWaveTable_initToPool(tCompactWaveTable* const cy, float* table, int · 47 unmodified lines
21172117 tButterworth_free(&c->bl);
21182118 }
21192119
2120−void tCompactWaveTable_free(tCompactWaveTable* const cy)
2120+void tWaveTableS_free(tWaveTableS* const cy)
21212121 {
2122− _tCompactWaveTable* c = *cy;
2122+ _tWaveTableS* c = *cy;
21232123
21242124 for (int t = 0; t < c->numTables; ++t)
21252125 {
@@ -2133,15 +2133,15 @@ void tCompactWaveTable_free(tCompactWaveTable* const cy) · 7 unmodified lines
21332133 //================================================================================================
21342134 //================================================================================================
21352135
2136−void tCompactWaveOsc_init(tCompactWaveOsc* const cy, tCompactWaveTable* const table, LEAF* const leaf)
2136+void tWaveOscS_init(tWaveOscS* const cy, tWaveTableS* const table, LEAF* const leaf)
21372137 {
2138− tCompactWaveOsc_initToPool(cy, table, &leaf->mempool);
2138+ tWaveOscS_initToPool(cy, table, &leaf->mempool);
21392139 }
21402140
2141−void tCompactWaveOsc_initToPool(tCompactWaveOsc* const cy, tCompactWaveTable* const table, tMempool* const mp)
2141+void tWaveOscS_initToPool(tWaveOscS* const cy, tWaveTableS* const table, tMempool* const mp)
21422142 {
21432143 _tMempool* m = *mp;
2144− _tCompactWaveOsc* c = *cy = (_tCompactWaveOsc*) mpool_alloc(sizeof(_tCompactWaveOsc), m);
2144+ _tWaveOscS* c = *cy = (_tWaveOscS*) mpool_alloc(sizeof(_tWaveOscS), m);
21452145 c->mempool = m;
21462146
21472147 c->inc = 0.0f;
@@ -2149,18 +2149,18 @@ void tCompactWaveOsc_initToPool(tCompactWaveOsc* const cy, tCompactWaveTable* co · 1 unmodified line
21492149 c->phaseOffset = 0.0f;
21502150 c->aa = 0.5f;
21512151
2152− tCompactWaveOsc_setFreq(cy, 220);
2152+ tWaveOscS_setFreq(cy, 220);
21532153 }
21542154
2155−void tCompactWaveOsc_free(tCompactWaveOsc* const cy)
2155+void tWaveOscS_free(tWaveOscS* const cy)
21562156 {
2157− _tCompactWaveOsc* c = *cy;
2157+ _tWaveOscS* c = *cy;
21582158 mpool_free((char*)c, c->mempool);
21592159 }
21602160
2161−float tCompactWaveOsc_tick(tCompactWaveOsc* const cy)
2161+float tWaveOscS_tick(tWaveOscS* const cy)
21622162 {
2163− _tCompactWaveOsc* c = *cy;
2163+ _tWaveOscS* c = *cy;
21642164
21652165 float temp;
21662166 int idx;
@@ -2198,9 +2198,9 @@ float tCompactWaveOsc_tick(tCompactWaveOsc* const cy) · 31 unmodified lines
21982198 return oct0 + (oct1 - oct0) * c->w;
21992199 }
22002200
2201−void tCompactWaveOsc_setFreq(tCompactWaveOsc* const cy, float freq)
2201+void tWaveOscS_setFreq(tWaveOscS* const cy, float freq)
22022202 {
2203− _tCompactWaveOsc* c = *cy;
2203+ _tWaveOscS* c = *cy;
22042204
22052205 LEAF* leaf = c->mempool->leaf;
22062206
@@ -2220,33 +2220,33 @@ void tCompactWaveOsc_setFreq(tCompactWaveOsc* const cy, float freq) · 13 unmodified lines
22202220 if (c->oct >= c->table->numTables - 1) c->oct = c->table->numTables - 2;
22212221 }
22222222
2223−void tCompactWaveOsc_setAntiAliasing(tCompactWaveOsc* const cy, float aa)
2223+void tWaveOscS_setAntiAliasing(tWaveOscS* const cy, float aa)
22242224 {
2225− _tCompactWaveOsc* c = *cy;
2225+ _tWaveOscS* c = *cy;
22262226 c->aa = aa;
2227− tCompactWaveOsc_setFreq(cy, c->freq);
2227+ tWaveOscS_setFreq(cy, c->freq);
22282228 }
22292229
2230−void tCompactWaveOsc_setPhaseOffset(tCompactWaveOsc* const cy, float phase)
2230+void tWaveOscS_setPhaseOffset(tWaveOscS* const cy, float phase)
22312231 {
2232− _tCompactWaveOsc* c = *cy;
2232+ _tWaveOscS* c = *cy;
22332233 c->phaseOffset = phase - (int)phase;
22342234 }
22352235
22362236 //================================================================================================
22372237 //================================================================================================
22382238
2239−void tCompactWaveSynth_init(tCompactWaveSynth* const cy, int numVoices, float** tables, int* sizes,
2239+void tWaveSynthS_init(tWaveSynthS* const cy, int numVoices, float** tables, int* sizes,
22402240 int numTables, float maxFreq, LEAF* const leaf)
22412241 {
2242− tCompactWaveSynth_initToPool(cy, numVoices, tables, sizes, numTables, maxFreq, &leaf->mempool);
2242+ tWaveSynthS_initToPool(cy, numVoices, tables, sizes, numTables, maxFreq, &leaf->mempool);
22432243 }
22442244
2245−void tCompactWaveSynth_initToPool(tCompactWaveSynth* const cy, int numVoices, float** tables, int* sizes,
2245+void tWaveSynthS_initToPool(tWaveSynthS* const cy, int numVoices, float** tables, int* sizes,
22462246 int numTables, float maxFreq, tMempool* const mp)
22472247 {
22482248 _tMempool* m = *mp;
2249− _tCompactWaveSynth* c = *cy = (_tCompactWaveSynth*) mpool_alloc(sizeof(_tCompactWaveSynth), m);
2249+ _tWaveSynthS* c = *cy = (_tWaveSynthS*) mpool_alloc(sizeof(_tWaveSynthS), m);
22502250 c->mempool = m;
22512251
22522252 c->numTables = 0;
@@ -2255,8 +2255,8 @@ void tCompactWaveSynth_initToPool(tCompactWaveSynth* const cy, int numVoices, fl · 2 unmodified lines
22552255 if (sizes[t] > 0) c->numTables++;
22562256 }
22572257
2258− c->tables = (tCompactWaveTable*) mpool_alloc(sizeof(tCompactWaveTable) * c->numTables, m);
2259− c->oscs = (tCompactWaveOsc**) mpool_alloc(sizeof(tCompactWaveOsc*) * c->numTables, m);
2258+ c->tables = (tWaveTableS*) mpool_alloc(sizeof(tWaveTableS) * c->numTables, m);
2259+ c->oscs = (tWaveOscS**) mpool_alloc(sizeof(tWaveOscS*) * c->numTables, m);
22602260
22612261 c->numVoices = numVoices;
22622262
@@ -2265,9 +2265,9 @@ void tCompactWaveSynth_initToPool(tCompactWaveSynth* const cy, int numVoices, fl · 2 unmodified lines
22652265 {
22662266 if (sizes[t] > 0)
22672267 {
2268− tCompactWaveTable_initToPool(&c->tables[i], tables[t], sizes[t], maxFreq, mp);
2269− c->oscs[i] = (tCompactWaveOsc*) mpool_alloc(sizeof(tCompactWaveOsc) * c->numVoices, m);
2270− for (int v = 0; v < c->numVoices; ++v) tCompactWaveOsc_initToPool(&c->oscs[i][v], &c->tables[i], mp);
2268+ tWaveTableS_initToPool(&c->tables[i], tables[t], sizes[t], maxFreq, mp);
2269+ c->oscs[i] = (tWaveOscS*) mpool_alloc(sizeof(tWaveOscS) * c->numVoices, m);
2270+ for (int v = 0; v < c->numVoices; ++v) tWaveOscS_initToPool(&c->oscs[i][v], &c->tables[i], mp);
22712271 i++;
22722272 }
22732273 }
@@ -2279,14 +2279,14 @@ void tCompactWaveSynth_initToPool(tCompactWaveSynth* const cy, int numVoices, fl · 5 unmodified lines
22792279 c->maxFreq = maxFreq;
22802280 }
22812281
2282−void tCompactWaveSynth_free(tCompactWaveSynth* const cy)
2282+void tWaveSynthS_free(tWaveSynthS* const cy)
22832283 {
2284− _tCompactWaveSynth* c = *cy;
2284+ _tWaveSynthS* c = *cy;
22852285
22862286 for (int i = 0; i < c->numTables; ++i)
22872287 {
2288− tCompactWaveTable_free(&c->tables[i]);
2289− for (int v = 0; v < c->numVoices; ++v) tCompactWaveOsc_free(&c->oscs[i][v]);
2288+ tWaveTableS_free(&c->tables[i]);
2289+ for (int v = 0; v < c->numVoices; ++v) tWaveOscS_free(&c->oscs[i][v]);
22902290 mpool_free((char*)c->oscs[i], c->mempool);
22912291 }
22922292 mpool_free((char*)c->g, c->mempool);
@@ -2295,9 +2295,9 @@ void tCompactWaveSynth_free(tCompactWaveSynth* const cy) · 2 unmodified lines
22952295 mpool_free((char*)c, c->mempool);
22962296 }
22972297
2298−float tCompactWaveSynth_tick(tCompactWaveSynth* const cy)
2298+float tWaveSynthS_tick(tWaveSynthS* const cy)
22992299 {
2300− _tCompactWaveSynth* c = *cy;
2300+ _tWaveSynthS* c = *cy;
23012301
23022302 float f = c->index * (c->numTables - 1);
23032303
@@ -2310,7 +2310,7 @@ float tCompactWaveSynth_tick(tCompactWaveSynth* const cy) · 6 unmodified lines
23102310 for (int t = 0; t < c->numTables; ++t)
23112311 {
23122312 float s0 = 0.f;
2313− for (int v = 0; v < c->numVoices; ++v) s0 += tCompactWaveOsc_tick(&c->oscs[t][v]);
2313+ for (int v = 0; v < c->numVoices; ++v) s0 += tWaveOscS_tick(&c->oscs[t][v]);
23142314 if (t == o1) s1 = s0 * c->g[t];
23152315 if (t == o2) s2 = s0 * c->g[t];
23162316 }
@@ -2319,9 +2319,9 @@ float tCompactWaveSynth_tick(tCompactWaveSynth* const cy) · 2 unmodified lines
23192319 return s1 + (s2 - s1) * mix;
23202320 }
23212321
2322−float tCompactWaveSynth_tickVoice(tCompactWaveSynth* const cy, int voice)
2322+float tWaveSynthS_tickVoice(tWaveSynthS* const cy, int voice)
23232323 {
2324− _tCompactWaveSynth* c = *cy;
2324+ _tWaveSynthS* c = *cy;
23252325
23262326 float f = c->index * (c->numTables - 1);
23272327
@@ -2334,7 +2334,7 @@ float tCompactWaveSynth_tickVoice(tCompactWaveSynth* const cy, int voice) · 6 unmodified lines
23342334 for (int t = 0; t < c->numTables; ++t)
23352335 {
23362336 // Should we tick every voice anyway to preserve relative phases?
2337− float s0 = tCompactWaveOsc_tick(&c->oscs[t][voice]);
2337+ float s0 = tWaveOscS_tick(&c->oscs[t][voice]);
23382338 if (t == o1) s1 = s0 * c->g[t];
23392339 if (t == o2) s2 = s0 * c->g[t];
23402340 }
@@ -2343,58 +2343,58 @@ float tCompactWaveSynth_tickVoice(tCompactWaveSynth* const cy, int voice) · 2 unmodified lines
23432343 return s1 + (s2 - s1) * mix;
23442344 }
23452345
2346−void tCompactWaveSynth_setFreq(tCompactWaveSynth* const cy, int voice, float freq)
2346+void tWaveSynthS_setFreq(tWaveSynthS* const cy, int voice, float freq)
23472347 {
2348− _tCompactWaveSynth* c = *cy;
2348+ _tWaveSynthS* c = *cy;
23492349 for (int t = 0; t < c->numTables; ++t)
23502350 {
2351− tCompactWaveOsc_setFreq(&c->oscs[t][voice], freq);
2351+ tWaveOscS_setFreq(&c->oscs[t][voice], freq);
23522352 }
23532353 }
23542354
2355−void tCompactWaveSynth_setAntiAliasing(tCompactWaveSynth* const cy, float aa)
2355+void tWaveSynthS_setAntiAliasing(tWaveSynthS* const cy, float aa)
23562356 {
2357− _tCompactWaveSynth* c = *cy;
2357+ _tWaveSynthS* c = *cy;
23582358 for (int t = 0; t < c->numTables; ++t)
23592359 {
23602360 for (int v = 0; v < c->numVoices; ++v)
23612361 {
2362− tCompactWaveOsc_setAntiAliasing(&c->oscs[t][v], aa);
2362+ tWaveOscS_setAntiAliasing(&c->oscs[t][v], aa);
23632363 }
23642364 }
23652365 }
23662366
2367−void tCompactWaveSynth_setIndex(tCompactWaveSynth* const cy, float index)
2367+void tWaveSynthS_setIndex(tWaveSynthS* const cy, float index)
23682368 {
2369− _tCompactWaveSynth* c = *cy;
2369+ _tWaveSynthS* c = *cy;
23702370 c->index = index;
23712371 }
23722372
2373−void tCompactWaveSynth_setIndexGain(tCompactWaveSynth* const cy, int i, float gain)
2373+void tWaveSynthS_setIndexGain(tWaveSynthS* const cy, int i, float gain)
23742374 {
2375− _tCompactWaveSynth* c = *cy;
2375+ _tWaveSynthS* c = *cy;
23762376 if (i >= c->numTables) return;
23772377 c->g[i] = gain;
23782378 }
23792379
2380−void tCompactWaveSynth_setIndexPhase(tCompactWaveSynth* const cy, int i, float phase)
2380+void tWaveSynthS_setIndexPhase(tWaveSynthS* const cy, int i, float phase)
23812381 {
2382− _tCompactWaveSynth* c = *cy;
2382+ _tWaveSynthS* c = *cy;
23832383 if (i >= c->numTables) return;
23842384 for (int v = 0; v < c->numVoices; ++v)
23852385 {
2386− tCompactWaveOsc_setPhaseOffset(&c->oscs[i][v], phase);
2386+ tWaveOscS_setPhaseOffset(&c->oscs[i][v], phase);
23872387 }
23882388 }
23892389 //
2390−//void tCompactWaveSynth_setIndexTable(tCompactWaveSynth* const cy, int i, float* table, int size)
2390+//void tWaveSynthS_setIndexTable(tWaveSynthS* const cy, int i, float* table, int size)
23912391 //{
2392−// _tCompactWaveSynth* c = *cy;
2392+// _tWaveSynthS* c = *cy;
23932393 // if (i >= c->numTables) return;
2394−// tCompactWaveTable_free(&c->tables[i]);
2395−// tCompactWaveTable_initToPool(&c->tables[i], table, size, c->maxFreq, &c->mempool);
2394+// tWaveTableS_free(&c->tables[i]);
2395+// tWaveTableS_initToPool(&c->tables[i], table, size, c->maxFreq, &c->mempool);
23962396 // for (int v = 0; v < c->numVoices; ++v)
23972397 // {
2398−// tCompactWaveOsc_setFreq(&c->oscs[i][v], c->oscs[i][v]->freq);
2398+// tWaveOscS_setFreq(&c->oscs[i][v], c->oscs[i][v]->freq);
23992399 // }
24002400 //}
leaf/leaf-config.h+2−2
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818
1919 //==============================================================================
2020
21−//! Include FIR tables required to use tOversampler and tCompactWaveTable which uses tOversampler.
21+//! Include FIR tables required to use tOversampler and tWaveTableS which uses tOversampler.
2222 #define LEAF_INCLUDE_OVERSAMPLER_TABLES 1
2323
2424 // Unused
@@ -36,7 +36,7 @@ · 11 unmodified lines
3636 // Unused
3737 #define LEAF_INCLUDE_ADC_TABLE 0
3838
39−//! Include tables required to use tEnvelope and tADSR (but not tADSR2, tADSR3, and tADSR4).
39+//! Include tables required to use tEnvelope and tADSR (but not tADSRT and tADSRS).
4040 #define LEAF_INCLUDE_ADSR_TABLES 1
4141
4242 //! Include wave table required to use tCycle.

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