leaf-envelopes.h
1 /*
2  ==============================================================================
3 
4  leaf-envelopes.h
5  Created: 20 Jan 2017 12:02:17pm
6  Author: Michael R Mulshine
7 
8  ==============================================================================
9  */
10 
11 #ifndef LEAF_ENVELOPES_H_INCLUDED
12 #define LEAF_ENVELOPES_H_INCLUDED
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
19 
20 #include "leaf-math.h"
21 #include "leaf-mempool.h"
22 #include "leaf-filters.h"
23 #include "leaf-delay.h"
24 #include "leaf-analysis.h"
25 #include "leaf-envelopes.h"
26 
35  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
36 
79  typedef struct _tEnvelope
80  {
81 
82  tMempool mempool;
83 
84  const float *exp_buff;
85  const float *inc_buff;
86  uint32_t buff_size;
87 
88  float next;
89 
90  float attackInc, decayInc, rampInc;
91 
92  int inAttack, inDecay, inRamp;
93 
94  int loop;
95 
96  float gain, rampPeak;
97 
98  float attackPhase, decayPhase, rampPhase;
99 
100  } _tEnvelope;
101 
102  typedef _tEnvelope* tEnvelope;
103 
104  void tEnvelope_init (tEnvelope* const, float attack, float decay, int loop, LEAF* const leaf);
105  void tEnvelope_initToPool (tEnvelope* const, float attack, float decay, int loop, tMempool* const);
106  void tEnvelope_free (tEnvelope* const);
107 
108  float tEnvelope_tick (tEnvelope* const);
109  void tEnvelope_setAttack (tEnvelope* const, float attack);
110  void tEnvelope_setDecay (tEnvelope* const, float decay);
111  void tEnvelope_loop (tEnvelope* const, int loop);
112  void tEnvelope_on (tEnvelope* const, float velocity);
113 
114  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
115 
116 
163  typedef struct _tExpSmooth
164  {
165 
166  tMempool mempool;
167  float factor, oneminusfactor;
168  float curr,dest;
169  } _tExpSmooth;
170 
171  typedef _tExpSmooth* tExpSmooth;
172 
173  void tExpSmooth_init (tExpSmooth* const, float val, float factor, LEAF* const leaf);
174  void tExpSmooth_initToPool (tExpSmooth* const, float val, float factor, tMempool* const);
175  void tExpSmooth_free (tExpSmooth* const);
176 
177  float tExpSmooth_tick (tExpSmooth* const);
178  float tExpSmooth_sample (tExpSmooth* const);
179  void tExpSmooth_setFactor (tExpSmooth* const, float factor);
180  void tExpSmooth_setDest (tExpSmooth* const, float dest);
181  void tExpSmooth_setVal (tExpSmooth* const, float val);
182  void tExpSmooth_setValAndDest(tExpSmooth* const expsmooth, float val);
183 
184  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
185 
186 
187  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
188 
243  /* ADSR */
244  typedef struct _tADSR
245  {
246 
247  tMempool mempool;
248 
249  const float *exp_buff;
250  const float *inc_buff;
251  uint32_t buff_size;
252 
253  float next;
254 
255  float attackInc, decayInc, releaseInc, rampInc;
256 
257  int inAttack, inDecay, inSustain, inRelease, inRamp;
258 
259  float sustain, gain, rampPeak, releasePeak;
260 
261  float attackPhase, decayPhase, releasePhase, rampPhase;
262 
263  float leakFactor;
264  } _tADSR;
265 
266  typedef _tADSR* tADSR;
267 
268  void tADSR_init (tADSR* const adsrenv, float attack, float decay, float sustain, float release, LEAF* const leaf);
269  void tADSR_initToPool (tADSR* const adsrenv, float attack, float decay, float sustain, float release, tMempool* const mp);
270  void tADSR_free (tADSR* const);
271 
272  float tADSR_tick (tADSR* const);
273  void tADSR_setAttack (tADSR* const, float attack);
274  void tADSR_setDecay (tADSR* const, float decay);
275  void tADSR_setSustain (tADSR* const, float sustain);
276  void tADSR_setRelease (tADSR* const, float release);
277  void tADSR_setLeakFactor (tADSR* const, float leakFactor);
278  void tADSR_on (tADSR* const, float velocity);
279  void tADSR_off (tADSR* const);
280 
281  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
282 
337  typedef struct _tADSR2
338  {
339 
340  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;
350  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;
362 
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);
366 
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);
375 
376 
377  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
378 
433  enum envState {
434  env_idle = 0,
435  env_attack,
436  env_decay,
437  env_sustain,
438  env_release,
439  env_ramp
440  };
441 
442  typedef struct _tADSR3
443  {
444 
445  tMempool mempool;
446  float sampleRateInMs;
447  int state;
448  float output;
449  float attackRate;
450  float decayRate;
451  float releaseRate;
452  float attackCoef;
453  float decayCoef;
454  float releaseCoef;
455  float sustainLevel;
456  float targetRatioA;
457  float targetRatioDR;
458  float attackBase;
459  float decayBase;
460  float releaseBase;
461  float leakFactor;
462  float targetGainSquared;
463  float factor;
464  float oneMinusFactor;
465  float gain;
466 
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 
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);
580 
581  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
582 
625  typedef struct _tRamp
626  {
627 
628  tMempool mempool;
629  float inc;
630  float inv_sr_ms;
631  float minimum_time;
632  float curr,dest;
633  float time;
634  float factor;
635  int samples_per_tick;
636  } _tRamp;
637 
638  typedef _tRamp* tRamp;
639 
640  void tRamp_init (tRamp* const, float time, int samplesPerTick, LEAF* const leaf);
641  void tRamp_initToPool (tRamp* const, float time, int samplesPerTick, tMempool* const);
642  void tRamp_free (tRamp* const);
643 
644  float tRamp_tick (tRamp* const);
645  float tRamp_sample (tRamp* const);
646  void tRamp_setTime (tRamp* const, float time);
647  void tRamp_setDest (tRamp* const, float dest);
648  void tRamp_setVal (tRamp* const, float val);
649 
696  typedef struct _tRampUpDown
697  {
698 
699  tMempool mempool;
700  float upInc;
701  float downInc;
702  float inv_sr_ms;
703  float minimum_time;
704  float curr,dest;
705  float upTime;
706  float downTime;
707  int samples_per_tick;
708  } _tRampUpDown;
709 
710  typedef _tRampUpDown* tRampUpDown;
711 
712  void tRampUpDown_init (tRampUpDown* const, float upTime, float downTime, int samplesPerTick, LEAF* const leaf);
713  void tRampUpDown_initToPool (tRampUpDown* const, float upTime, float downTime, int samplesPerTick, tMempool* const);
714  void tRampUpDown_free (tRampUpDown* const);
715 
716  float tRampUpDown_tick (tRampUpDown* const);
717  float tRampUpDown_sample (tRampUpDown* const);
718  void tRampUpDown_setUpTime (tRampUpDown* const, float upTime);
719  void tRampUpDown_setDownTime (tRampUpDown* const, float downTime);
720  void tRampUpDown_setDest (tRampUpDown* const, float dest);
721  void tRampUpDown_setVal (tRampUpDown* const, float val);
722 
723 
724 
767  typedef struct _tSlide
768  {
769 
770  tMempool mempool;
771  float prevOut;
772  float currentOut;
773  float prevIn;
774  float invUpSlide;
775  float invDownSlide;
776  float dest;
777  } _tSlide;
778 
779  typedef _tSlide* tSlide;
780 
781  void tSlide_init (tSlide* const, float upSlide, float downSlide, LEAF* const leaf);
782  void tSlide_initToPool (tSlide* const, float upSlide, float downSlide, tMempool* const);
783  void tSlide_free (tSlide* const);
784 
785  float tSlide_tick (tSlide* const, float in);
786  float tSlide_tickNoInput (tSlide* const sl);
787  void tSlide_setUpSlide (tSlide* const sl, float upSlide);
788  void tSlide_setDownSlide (tSlide* const sl, float downSlide);
789  void tSlide_setDest (tSlide* const sl, float dest);
790 
791 #ifdef __cplusplus
792 }
793 #endif
794 
795 #endif // LEAF_ENVELOPES_H_INCLUDED
796 
797 
798 
799 
tADSR4_tick
float tADSR4_tick(tADSR4 *const)
Definition: leaf-envelopes.c:949
tRampUpDown_setDest
void tRampUpDown_setDest(tRampUpDown *const, float dest)
Definition: leaf-envelopes.c:1338
tRamp_tick
float tRamp_tick(tRamp *const)
Definition: leaf-envelopes.c:1225
tADSR2_init
void tADSR2_init(tADSR2 *const, float attack, float decay, float sustain, float release, LEAF *const leaf)
Initialize a tADSR2 to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:502
tSlide_setDownSlide
void tSlide_setDownSlide(tSlide *const sl, float downSlide)
Definition: leaf-envelopes.c:1514
tADSR4_setLeakFactor
void tADSR4_setLeakFactor(tADSR4 *const, float leakFactor)
Definition: leaf-envelopes.c:905
tADSR3_init
void tADSR3_init(tADSR3 *const, float attack, float decay, float sustain, float release, LEAF *const leaf)
Initialize a tADSR3 to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:658
tSlide_init
void tSlide_init(tSlide *const, float upSlide, float downSlide, LEAF *const leaf)
Initialize a tSlide to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:1473
tADSR_setAttack
void tADSR_setAttack(tADSR *const, float attack)
Definition: leaf-envelopes.c:292
tADSR3_off
void tADSR3_off(tADSR3 *const)
Definition: leaf-envelopes.c:754
tADSR3_setRelease
void tADSR3_setRelease(tADSR3 *const, float release)
Definition: leaf-envelopes.c:730
tExpSmooth_setValAndDest
void tExpSmooth_setValAndDest(tExpSmooth *const expsmooth, float val)
Definition: leaf-envelopes.c:1450
tADSR4_setDecay
void tADSR4_setDecay(tADSR4 *const, float decay)
Definition: leaf-envelopes.c:873
tADSR2_setRelease
void tADSR2_setRelease(tADSR2 *const, float release)
Definition: leaf-envelopes.c:576
tADSR3_setLeakFactor
void tADSR3_setLeakFactor(tADSR3 *const, float leakFactor)
Definition: leaf-envelopes.c:740
tADSR_off
void tADSR_off(tADSR *const)
Definition: leaf-envelopes.c:385
tADSR2_setLeakFactor
void tADSR2_setLeakFactor(tADSR2 *const, float leakFactor)
Definition: leaf-envelopes.c:584
tExpSmooth_setFactor
void tExpSmooth_setFactor(tExpSmooth *const, float factor)
Definition: leaf-envelopes.c:1426
tSlide_initToPool
void tSlide_initToPool(tSlide *const, float upSlide, float downSlide, tMempool *const)
Initialize a tSlide to a specified mempool.
Definition: leaf-envelopes.c:1478
tRampUpDown_setUpTime
void tRampUpDown_setUpTime(tRampUpDown *const, float upTime)
Definition: leaf-envelopes.c:1307
tEnvelope_initToPool
void tEnvelope_initToPool(tEnvelope *const, float attack, float decay, int loop, tMempool *const)
Initialize a tEnvelope to a specified mempool.
Definition: leaf-envelopes.c:33
tADSR4_setAttack
void tADSR4_setAttack(tADSR4 *const, float attack)
Definition: leaf-envelopes.c:861
tRampUpDown_setVal
void tRampUpDown_setVal(tRampUpDown *const, float val)
Definition: leaf-envelopes.c:1346
tADSR_setRelease
void tADSR_setRelease(tADSR *const, float release)
Definition: leaf-envelopes.c:335
tRamp_sample
float tRamp_sample(tRamp *const)
Definition: leaf-envelopes.c:1240
tADSR3_tick
float tADSR3_tick(tADSR3 *const)
Definition: leaf-envelopes.c:764
tSlide_setUpSlide
void tSlide_setUpSlide(tSlide *const sl, float upSlide)
Definition: leaf-envelopes.c:1508
tExpSmooth_sample
float tExpSmooth_sample(tExpSmooth *const)
Definition: leaf-envelopes.c:1464
tADSR2_free
void tADSR2_free(tADSR2 *const)
Free a tADSR2 from its mempool.
Definition: leaf-envelopes.c:540
tSlide_setDest
void tSlide_setDest(tSlide *const sl, float dest)
Definition: leaf-envelopes.c:1520
tEnvelope_tick
float tEnvelope_tick(tEnvelope *const)
Definition: leaf-envelopes.c:144
tADSR_on
void tADSR_on(tADSR *const, float velocity)
Definition: leaf-envelopes.c:361
tSlide_tickNoInput
float tSlide_tickNoInput(tSlide *const sl)
Definition: leaf-envelopes.c:1526
tADSR4_setSustain
void tADSR4_setSustain(tADSR4 *const, float sustain)
Definition: leaf-envelopes.c:884
tRamp_init
void tRamp_init(tRamp *const, float time, int samplesPerTick, LEAF *const leaf)
Initialize a tRamp to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:1156
tRampUpDown_init
void tRampUpDown_init(tRampUpDown *const, float upTime, float downTime, int samplesPerTick, LEAF *const leaf)
Initialize a tRampUpDown to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:1259
tADSR2_off
void tADSR2_off(tADSR2 *const)
Definition: leaf-envelopes.c:601
tRampUpDown_setDownTime
void tRampUpDown_setDownTime(tRampUpDown *const, float downTime)
Definition: leaf-envelopes.c:1323
tEnvelope_setDecay
void tEnvelope_setDecay(tEnvelope *const, float decay)
Definition: leaf-envelopes.c:98
tADSR4_init
void tADSR4_init(tADSR4 *const, float attack, float decay, float sustain, float release, float *expBuffer, int bufferSize, LEAF *const leaf)
Initialize a tADSR4 to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:806
tADSR2_setSustain
void tADSR2_setSustain(tADSR2 *const, float sustain)
Definition: leaf-envelopes.c:562
tRamp_setVal
void tRamp_setVal(tRamp *const, float val)
Definition: leaf-envelopes.c:1218
tRampUpDown_free
void tRampUpDown_free(tRampUpDown *const)
Free a tRampUpDown from its mempool.
Definition: leaf-envelopes.c:1300
tADSR_setDecay
void tADSR_setDecay(tADSR *const, float decay)
Definition: leaf-envelopes.c:309
tRamp_free
void tRamp_free(tRamp *const)
Free a tRamp from its mempool.
Definition: leaf-envelopes.c:1187
tRamp_setTime
void tRamp_setTime(tRamp *const, float time)
Definition: leaf-envelopes.c:1194
tADSR3_initToPool
void tADSR3_initToPool(tADSR3 *const, float attack, float decay, float sustain, float release, tMempool *const)
Initialize a tADSR3 to a specified mempool.
Definition: leaf-envelopes.c:663
tADSR4_off
void tADSR4_off(tADSR4 *const)
Definition: leaf-envelopes.c:934
tEnvelope_setAttack
void tEnvelope_setAttack(tEnvelope *const, float attack)
Definition: leaf-envelopes.c:81
tADSR_init
void tADSR_init(tADSR *const adsrenv, float attack, float decay, float sustain, float release, LEAF *const leaf)
Initialize a tADSR to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:219
tSlide_tick
float tSlide_tick(tSlide *const, float in)
Definition: leaf-envelopes.c:1548
tExpSmooth_setVal
void tExpSmooth_setVal(tExpSmooth *const, float val)
Definition: leaf-envelopes.c:1444
tRampUpDown_initToPool
void tRampUpDown_initToPool(tRampUpDown *const, float upTime, float downTime, int samplesPerTick, tMempool *const)
Initialize a tRampUpDown to a specified mempool.
Definition: leaf-envelopes.c:1264
tRampUpDown_tick
float tRampUpDown_tick(tRampUpDown *const)
Definition: leaf-envelopes.c:1354
tADSR3_setDecay
void tADSR3_setDecay(tADSR3 *const, float decay)
Definition: leaf-envelopes.c:713
tADSR2_initToPool
void tADSR2_initToPool(tADSR2 *const, float attack, float decay, float sustain, float release, tMempool *const)
Initialize a tADSR2 to a specified mempool.
Definition: leaf-envelopes.c:507
tADSR_tick
float tADSR_tick(tADSR *const)
Definition: leaf-envelopes.c:399
tADSR_setSustain
void tADSR_setSustain(tADSR *const, float sustain)
Definition: leaf-envelopes.c:326
tEnvelope_init
void tEnvelope_init(tEnvelope *const, float attack, float decay, int loop, LEAF *const leaf)
Initialize a tEnvelope to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:28
tADSR_free
void tADSR_free(tADSR *const)
Free a tADSR from its mempool.
Definition: leaf-envelopes.c:286
tADSR4_on
void tADSR4_on(tADSR4 *const, float velocity)
Definition: leaf-envelopes.c:913
tADSR3_free
void tADSR3_free(tADSR3 *const)
Free a tADSR3 from its mempool.
Definition: leaf-envelopes.c:698
tExpSmooth_initToPool
void tExpSmooth_initToPool(tExpSmooth *const, float val, float factor, tMempool *const)
Initialize a tExpSmooth to a specified mempool.
Definition: leaf-envelopes.c:1405
tADSR_initToPool
void tADSR_initToPool(tADSR *const adsrenv, float attack, float decay, float sustain, float release, tMempool *const mp)
Initialize a tADSR to a specified mempool.
Definition: leaf-envelopes.c:224
tExpSmooth_setDest
void tExpSmooth_setDest(tExpSmooth *const, float dest)
Definition: leaf-envelopes.c:1438
tADSR2_tick
float tADSR2_tick(tADSR2 *const)
Definition: leaf-envelopes.c:608
tADSR2_setAttack
void tADSR2_setAttack(tADSR2 *const, float attack)
Definition: leaf-envelopes.c:546
tADSR2_setDecay
void tADSR2_setDecay(tADSR2 *const, float decay)
Definition: leaf-envelopes.c:554
tRamp_setDest
void tRamp_setDest(tRamp *const, float dest)
Definition: leaf-envelopes.c:1211
tEnvelope_free
void tEnvelope_free(tEnvelope *const)
Free a tEnvelope from its mempool.
Definition: leaf-envelopes.c:75
tExpSmooth_tick
float tExpSmooth_tick(tExpSmooth *const)
Definition: leaf-envelopes.c:1457
tADSR3_on
void tADSR3_on(tADSR3 *const, float velocity)
Definition: leaf-envelopes.c:747
tRamp_initToPool
void tRamp_initToPool(tRamp *const, float time, int samplesPerTick, tMempool *const)
Initialize a tRamp to a specified mempool.
Definition: leaf-envelopes.c:1161
tExpSmooth_init
void tExpSmooth_init(tExpSmooth *const, float val, float factor, LEAF *const leaf)
Initialize a tExpSmooth to the default mempool of a LEAF instance.
Definition: leaf-envelopes.c:1400
tADSR4_free
void tADSR4_free(tADSR4 *const)
Free a tADSR4 from its mempool.
Definition: leaf-envelopes.c:855
tADSR2_on
void tADSR2_on(tADSR2 *const, float velocity)
Definition: leaf-envelopes.c:591
tADSR4_initToPool
void tADSR4_initToPool(tADSR4 *const, float attack, float decay, float sustain, float release, float *expBuffer, int bufferSize, tMempool *const)
Initialize a tADSR4 to a specified mempool.
Definition: leaf-envelopes.c:813
tADSR_setLeakFactor
void tADSR_setLeakFactor(tADSR *const, float leakFactor)
Definition: leaf-envelopes.c:353
tADSR4_setRelease
void tADSR4_setRelease(tADSR4 *const, float release)
Definition: leaf-envelopes.c:893
tEnvelope_loop
void tEnvelope_loop(tEnvelope *const, int loop)
Definition: leaf-envelopes.c:115
tRampUpDown_sample
float tRampUpDown_sample(tRampUpDown *const)
Definition: leaf-envelopes.c:1388
tSlide_free
void tSlide_free(tSlide *const)
Free a tSlide from its mempool.
Definition: leaf-envelopes.c:1501
LEAF
Struct for an instance of LEAF.
Definition: leaf-global.h:31
tADSR4_tickNoInterp
float tADSR4_tickNoInterp(tADSR4 *const adsrenv)
Definition: leaf-envelopes.c:1074
tADSR3_setAttack
void tADSR3_setAttack(tADSR3 *const, float attack)
Definition: leaf-envelopes.c:704
tEnvelope_on
void tEnvelope_on(tEnvelope *const, float velocity)
Definition: leaf-envelopes.c:122
tADSR3_setSustain
void tADSR3_setSustain(tADSR3 *const, float sustain)
Definition: leaf-envelopes.c:722
tExpSmooth_free
void tExpSmooth_free(tExpSmooth *const)
Free a tExpSmooth from its mempool.
Definition: leaf-envelopes.c:1419