leaf-physical.h
1 /*
2  ==============================================================================
3 
4  leaf-physical.h
5  Created: 30 Nov 2018 10:41:55am
6  Author: airship
7 
8  ==============================================================================
9  */
10 
11 #ifndef LEAF_PHYSICAL_H_INCLUDED
12 #define LEAF_PHYSICAL_H_INCLUDED
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18  //==============================================================================
19 
20 #include "leaf-global.h"
21 #include "leaf-math.h"
22 #include "leaf-mempool.h"
23 #include "leaf-delay.h"
24 #include "leaf-filters.h"
25 #include "leaf-oscillators.h"
26 #include "leaf-envelopes.h"
27 #include "leaf-dynamics.h"
28 
37  //==============================================================================
38 
89  typedef struct _tPluck
90  {
91 
92  tMempool mempool;
93 
94  tAllpassDelay delayLine; // Allpass or Linear?? big difference...
95  tOneZero loopFilter;
96  tOnePole pickFilter;
97  tNoise noise;
98 
99  float lastOut;
100  float loopGain;
101  float lastFreq;
102 
103  float sr;
104  } _tPluck;
105 
106  typedef _tPluck* tPluck;
107 
108  void tPluck_init (tPluck* const, float lowestFrequency, LEAF* const leaf); //float delayBuff[DELAY_LENGTH]);
109  void tPluck_initToPool (tPluck* const, float lowestFrequency, tMempool* const);
110  void tPluck_free (tPluck* const);
111 
112  float tPluck_tick (tPluck* const);
113  void tPluck_pluck (tPluck* const, float amplitude);
114  void tPluck_noteOn (tPluck* const, float frequency, float amplitude );
115  void tPluck_noteOff (tPluck* const, float amplitude );
116  void tPluck_setFrequency (tPluck* const, float frequency );
117  void tPluck_controlChange (tPluck* const, int number, float value);
118  float tPluck_getLastOut (tPluck* const);
119 
120  //==============================================================================
121 
184  typedef enum SKControlType
185  {
186  SKPickPosition = 0,
187  SKStringDamping,
188  SKDetune,
189  SKControlTypeNil
190  } SKControlType;
191 
192  typedef struct _tKarplusStrong
193  {
194 
195  tMempool mempool;
196 
197  tAllpassDelay delayLine;
198  tLinearDelay combDelay;
199  tOneZero filter;
200  tNoise noise;
201  tBiQuad biquad[4];
202 
203  uint32_t length;
204  float loopGain;
205  float baseLoopGain;
206  float lastFrequency;
207  float lastLength;
208  float stretching;
209  float pluckAmplitude;
210  float pickupPosition;
211 
212  float lastOut;
213  } _tKarplusStrong;
214 
215  typedef _tKarplusStrong* tKarplusStrong;
216 
217  void tKarplusStrong_init (tKarplusStrong* const, float lowestFrequency, LEAF* const leaf); // float delayBuff[2][DELAY_LENGTH]);
218  void tKarplusStrong_initToPool (tKarplusStrong* const, float lowestFrequency, tMempool* const);
219  void tKarplusStrong_free (tKarplusStrong* const);
220 
221  float tKarplusStrong_tick (tKarplusStrong* const);
222  void tKarplusStrong_pluck (tKarplusStrong* const, float amplitude);
223  void tKarplusStrong_noteOn (tKarplusStrong* const, float frequency, float amplitude );
224  void tKarplusStrong_noteOff (tKarplusStrong* const, float amplitude );
225  void tKarplusStrong_setFrequency (tKarplusStrong* const, float frequency );
226  void tKarplusStrong_controlChange (tKarplusStrong* const, SKControlType type, float value);
227  void tKarplusStrong_setStretch (tKarplusStrong* const, float stretch );
228  void tKarplusStrong_setPickupPosition (tKarplusStrong* const, float position );
229  void tKarplusStrong_setBaseLoopGain (tKarplusStrong* const, float aGain );
230  float tKarplusStrong_getLastOut (tKarplusStrong* const);
231 
232  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
233 
296  typedef struct _tSimpleLivingString
297  {
298 
299  tMempool mempool;
300  float freq, waveLengthInSamples; // the frequency of the string, determining delay length
301  float dampFreq; // frequency for the bridge LP filter, in Hz
302  float decay; // amplitude damping factor for the string (only active in mode 0)
303  int levMode;
304  float curr;
305  tLinearDelay delayLine;
306  tOnePole bridgeFilter;
307  tHighpass DCblocker;
308  tFeedbackLeveler fbLev;
309  tExpSmooth wlSmooth;
310  } _tSimpleLivingString;
311 
312  typedef _tSimpleLivingString* tSimpleLivingString;
313 
314  void tSimpleLivingString_init (tSimpleLivingString* const, float freq, float dampFreq,
315  float decay, float targetLev, float levSmoothFactor,
316  float levStrength, int levMode, LEAF* const leaf);
317  void tSimpleLivingString_initToPool (tSimpleLivingString* const, float freq, float dampFreq,
318  float decay, float targetLev, float levSmoothFactor,
319  float levStrength, int levMode, tMempool* const);
320  void tSimpleLivingString_free (tSimpleLivingString* const);
321 
322  float tSimpleLivingString_tick (tSimpleLivingString* const, float input);
323  float tSimpleLivingString_sample (tSimpleLivingString* const);
324  void tSimpleLivingString_setFreq (tSimpleLivingString* const, float freq);
325  void tSimpleLivingString_setWaveLength (tSimpleLivingString* const, float waveLength); // in samples
326  void tSimpleLivingString_setDampFreq (tSimpleLivingString* const, float dampFreq);
327  void tSimpleLivingString_setDecay (tSimpleLivingString* const, float decay); // should be near 1.0
328  void tSimpleLivingString_setTargetLev (tSimpleLivingString* const, float targetLev);
329  void tSimpleLivingString_setLevSmoothFactor (tSimpleLivingString* const, float levSmoothFactor);
330  void tSimpleLivingString_setLevStrength (tSimpleLivingString* const, float levStrength);
331  void tSimpleLivingString_setLevMode (tSimpleLivingString* const, int levMode);
332 
333  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
334 
405  typedef struct _tLivingString
406  {
407 
408  tMempool mempool;
409  float freq, waveLengthInSamples; // the frequency of the whole string, determining delay length
410  float pickPos; // the pick position, dividing the string in two, in ratio
411  float prepIndex; // the amount of pressure on the pickpoint of the string (near 0=soft obj, near 1=hard obj)
412  float dampFreq; // frequency for the bridge LP filter, in Hz
413  float decay; // amplitude damping factor for the string (only active in mode 0)
414  int levMode;
415  float curr;
416  tLinearDelay delLF,delUF,delUB,delLB; // delay for lower/upper/forward/backward part of the waveguide model
417  tOnePole bridgeFilter, nutFilter, prepFilterU, prepFilterL;
418  tHighpass DCblockerL, DCblockerU;
419  tFeedbackLeveler fbLevU, fbLevL;
420  tExpSmooth wlSmooth, ppSmooth;
421  } _tLivingString;
422 
423  typedef _tLivingString* tLivingString;
424 
425  void tLivingString_init (tLivingString* const, float freq, float pickPos, float prepIndex,
426  float dampFreq, float decay, float targetLev, float levSmoothFactor,
427  float levStrength, int levMode, LEAF* const leaf);
428  void tLivingString_initToPool (tLivingString* const, float freq, float pickPos, float prepIndex,
429  float dampFreq, float decay, float targetLev, float levSmoothFactor,
430  float levStrength, int levMode, tMempool* const);
431  void tLivingString_free (tLivingString* const);
432 
433  float tLivingString_tick (tLivingString* const, float input);
434  float tLivingString_sample (tLivingString* const);
435  void tLivingString_setFreq (tLivingString* const, float freq);
436  void tLivingString_setWaveLength (tLivingString* const, float waveLength); // in samples
437  void tLivingString_setPickPos (tLivingString* const, float pickPos);
438  void tLivingString_setPrepIndex (tLivingString* const, float prepIndex);
439  void tLivingString_setDampFreq (tLivingString* const, float dampFreq);
440  void tLivingString_setDecay (tLivingString* const, float decay); // should be near 1.0
441  void tLivingString_setTargetLev (tLivingString* const, float targetLev);
442  void tLivingString_setLevSmoothFactor (tLivingString* const, float levSmoothFactor);
443  void tLivingString_setLevStrength (tLivingString* const, float levStrength);
444  void tLivingString_setLevMode (tLivingString* const, int levMode);
445 
446 
447 
448  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
449 
524  typedef struct _tComplexLivingString
525  {
526 
527  tMempool mempool;
528  float freq, waveLengthInSamples; // the frequency of the whole string, determining delay length
529  float pickPos; // the pick position, dividing the string, in ratio
530  float prepPos; // preparation position, in ratio
531  int prepLower;
532  float prepIndex; // the amount of pressure on the pickpoint of the string (near 0=soft obj, near 1=hard obj)
533  float dampFreq; // frequency for the bridge LP filter, in Hz
534  float decay; // amplitude damping factor for the string (only active in mode 0)
535  int levMode;
536  float curr;
537  tLinearDelay delLF,delUF, delMF, delMB, delUB,delLB; // delay for lower/upper/forward/backward part of the waveguide model
538  tOnePole bridgeFilter, nutFilter, prepFilterU, prepFilterL;
539  tHighpass DCblockerL, DCblockerU;
540  tFeedbackLeveler fbLevU, fbLevL;
541  tExpSmooth wlSmooth, pickPosSmooth, prepPosSmooth;
542  } _tComplexLivingString;
543 
544  typedef _tComplexLivingString* tComplexLivingString;
545 
546  void tComplexLivingString_init (tComplexLivingString* const, float freq, float pickPos,
547  float prepPos, float prepIndex, float dampFreq,
548  float decay, float targetLev, float levSmoothFactor,
549  float levStrength, int levMode, LEAF* const leaf);
550  void tComplexLivingString_initToPool (tComplexLivingString* const, float freq, float pickPos,
551  float prepPos, float prepIndex, float dampFreq,
552  float decay, float targetLev, float levSmoothFactor,
553  float levStrength, int levMode, tMempool* const);
554  void tComplexLivingString_free (tComplexLivingString* const);
555 
556  float tComplexLivingString_tick (tComplexLivingString* const, float input);
557  float tComplexLivingString_sample (tComplexLivingString* const);
558  void tComplexLivingString_setFreq (tComplexLivingString* const, float freq);
559  void tComplexLivingString_setWaveLength (tComplexLivingString* const, float waveLength); // in samples
560  void tComplexLivingString_setPickPos (tComplexLivingString* const, float pickPos);
561  void tComplexLivingString_setPrepPos (tComplexLivingString* const, float prepPos);
562  void tComplexLivingString_setPrepIndex (tComplexLivingString* const, float prepIndex);
563  void tComplexLivingString_setDampFreq (tComplexLivingString* const, float dampFreq);
564  void tComplexLivingString_setDecay (tComplexLivingString* const, float decay); // should be near 1.0
565  void tComplexLivingString_setTargetLev (tComplexLivingString* const, float targetLev);
566  void tComplexLivingString_setLevSmoothFactor (tComplexLivingString* const, float levSmoothFactor);
567  void tComplexLivingString_setLevStrength (tComplexLivingString* const, float levStrength);
568  void tComplexLivingString_setLevMode (tComplexLivingString* const, int levMode);
569 
570  // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
571 
572 
611  typedef struct _tReedTable
612  {
613 
614  tMempool mempool;
615  float offset, slope;
616  } _tReedTable;
617 
618  typedef _tReedTable* tReedTable;
619 
620  void tReedTable_init (tReedTable* const, float offset, float slope, LEAF* const leaf);
621  void tReedTable_initToPool (tReedTable* const, float offset, float slope, tMempool* const);
622  void tReedTable_free (tReedTable* const);
623 
624  float tReedTable_tick (tReedTable* const, float input);
625  float tReedTable_tanh_tick (tReedTable* const, float input); //tanh softclip version of reed table - replacing the hard clip in original stk code
626  void tReedTable_setOffset (tReedTable* const, float offset);
627  void tReedTable_setSlope (tReedTable* const, float slope);
628 
629  //==============================================================================
630 
631 #ifdef __cplusplus
632 }
633 #endif
634 
635 #endif // LEAF_PHYSICAL_H_INCLUDED
636 
637 //==============================================================================
638 
tComplexLivingString_setLevStrength
void tComplexLivingString_setLevStrength(tComplexLivingString *const, float levStrength)
Definition: leaf-physical.c:820
tReedTable_setOffset
void tReedTable_setOffset(tReedTable *const, float offset)
Definition: leaf-physical.c:961
tKarplusStrong_setStretch
void tKarplusStrong_setStretch(tKarplusStrong *const, float stretch)
Set the stretch "factor" of the string (0.0 - 1.0).
Definition: leaf-physical.c:277
tLivingString_free
void tLivingString_free(tLivingString *const)
Free a tLivingString from its mempool.
Definition: leaf-physical.c:516
tPluck_free
void tPluck_free(tPluck *const)
Free a tPluck from its mempool.
Definition: leaf-physical.c:46
tKarplusStrong_controlChange
void tKarplusStrong_controlChange(tKarplusStrong *const, SKControlType type, float value)
Perform the control change specified by number and value (0.0 - 128.0). Use SKPickPosition,...
Definition: leaf-physical.c:327
tKarplusStrong_init
void tKarplusStrong_init(tKarplusStrong *const, float lowestFrequency, LEAF *const leaf)
Initialize a tKarplusStrong to the default mempool of a LEAF instance.
Definition: leaf-physical.c:137
tComplexLivingString_free
void tComplexLivingString_free(tComplexLivingString *const)
Free a tComplexLivingString from its mempool.
Definition: leaf-physical.c:720
tPluck_noteOff
void tPluck_noteOff(tPluck *const, float amplitude)
Stop a note with the given amplitude (speed of decay)
Definition: leaf-physical.c:95
tReedTable_init
void tReedTable_init(tReedTable *const, float offset, float slope, LEAF *const leaf)
Initialize a tReedTable to the default mempool of a LEAF instance.
Definition: leaf-physical.c:908
tReedTable_setSlope
void tReedTable_setSlope(tReedTable *const, float slope)
Definition: leaf-physical.c:967
tComplexLivingString_initToPool
void tComplexLivingString_initToPool(tComplexLivingString *const, float freq, float pickPos, float prepPos, float prepIndex, float dampFreq, float decay, float targetLev, float levSmoothFactor, float levStrength, int levMode, tMempool *const)
Initialize a tComplexLivingString to a specified mempool.
Definition: leaf-physical.c:673
tSimpleLivingString_setDampFreq
void tSimpleLivingString_setDampFreq(tSimpleLivingString *const, float dampFreq)
Definition: leaf-physical.c:414
tLivingString_setTargetLev
void tLivingString_setTargetLev(tLivingString *const, float targetLev)
Definition: leaf-physical.c:590
tComplexLivingString_setPrepIndex
void tComplexLivingString_setPrepIndex(tComplexLivingString *const, float prepIndex)
Definition: leaf-physical.c:783
tComplexLivingString_setPickPos
void tComplexLivingString_setPickPos(tComplexLivingString *const, float pickPos)
Definition: leaf-physical.c:765
tLivingString_initToPool
void tLivingString_initToPool(tLivingString *const, float freq, float pickPos, float prepIndex, float dampFreq, float decay, float targetLev, float levSmoothFactor, float levStrength, int levMode, tMempool *const)
Initialize a tLivingString to a specified mempool.
Definition: leaf-physical.c:478
tReedTable_tanh_tick
float tReedTable_tanh_tick(tReedTable *const, float input)
Definition: leaf-physical.c:949
tSimpleLivingString_setTargetLev
void tSimpleLivingString_setTargetLev(tSimpleLivingString *const, float targetLev)
Definition: leaf-physical.c:426
tKarplusStrong_setFrequency
void tKarplusStrong_setFrequency(tKarplusStrong *const, float frequency)
Set instrument parameters for a particular frequency.
Definition: leaf-physical.c:254
tSimpleLivingString_setLevSmoothFactor
void tSimpleLivingString_setLevSmoothFactor(tSimpleLivingString *const, float levSmoothFactor)
Definition: leaf-physical.c:432
tLivingString_setFreq
void tLivingString_setFreq(tLivingString *const, float freq)
Definition: leaf-physical.c:538
tKarplusStrong_tick
float tKarplusStrong_tick(tKarplusStrong *const)
Definition: leaf-physical.c:199
tLivingString_setLevMode
void tLivingString_setLevMode(tLivingString *const, int levMode)
Definition: leaf-physical.c:611
tComplexLivingString_setTargetLev
void tComplexLivingString_setTargetLev(tComplexLivingString *const, float targetLev)
Definition: leaf-physical.c:806
tComplexLivingString_setWaveLength
void tComplexLivingString_setWaveLength(tComplexLivingString *const, float waveLength)
Definition: leaf-physical.c:756
tPluck_tick
float tPluck_tick(tPluck *const)
Definition: leaf-physical.c:64
tKarplusStrong_setBaseLoopGain
void tKarplusStrong_setBaseLoopGain(tKarplusStrong *const, float aGain)
Set the base loop gain.
Definition: leaf-physical.c:317
tLivingString_setLevSmoothFactor
void tLivingString_setLevSmoothFactor(tLivingString *const, float levSmoothFactor)
Definition: leaf-physical.c:597
tKarplusStrong_noteOff
void tKarplusStrong_noteOff(tKarplusStrong *const, float amplitude)
Stop a note with the given amplitude (speed of decay).
Definition: leaf-physical.c:243
tPluck_init
void tPluck_init(tPluck *const, float lowestFrequency, LEAF *const leaf)
Initialize a tPluck to the default mempool of a LEAF instance.
Definition: leaf-physical.c:20
tSimpleLivingString_setLevStrength
void tSimpleLivingString_setLevStrength(tSimpleLivingString *const, float levStrength)
Definition: leaf-physical.c:438
tLivingString_init
void tLivingString_init(tLivingString *const, float freq, float pickPos, float prepIndex, float dampFreq, float decay, float targetLev, float levSmoothFactor, float levStrength, int levMode, LEAF *const leaf)
Initialize a tLivingString to the default mempool of a LEAF instance.
Definition: leaf-physical.c:471
tPluck_pluck
void tPluck_pluck(tPluck *const, float amplitude)
Pluck the string.
Definition: leaf-physical.c:70
tSimpleLivingString_tick
float tSimpleLivingString_tick(tSimpleLivingString *const, float input)
Definition: leaf-physical.c:451
tLivingString_setLevStrength
void tLivingString_setLevStrength(tLivingString *const, float levStrength)
Definition: leaf-physical.c:604
tReedTable_free
void tReedTable_free(tReedTable *const)
Free a tReedTable from its mempool.
Definition: leaf-physical.c:923
tSimpleLivingString_sample
float tSimpleLivingString_sample(tSimpleLivingString *const)
Definition: leaf-physical.c:463
tComplexLivingString_setLevMode
void tComplexLivingString_setLevMode(tComplexLivingString *const, int levMode)
Definition: leaf-physical.c:827
tSimpleLivingString_setLevMode
void tSimpleLivingString_setLevMode(tSimpleLivingString *const, int levMode)
Definition: leaf-physical.c:444
tPluck_getLastOut
float tPluck_getLastOut(tPluck *const)
Definition: leaf-physical.c:58
tComplexLivingString_setPrepPos
void tComplexLivingString_setPrepPos(tComplexLivingString *const, float prepPos)
Definition: leaf-physical.c:774
tKarplusStrong_free
void tKarplusStrong_free(tKarplusStrong *const)
Free a tKarplusStrong from its mempool.
Definition: leaf-physical.c:176
tSimpleLivingString_initToPool
void tSimpleLivingString_initToPool(tSimpleLivingString *const, float freq, float dampFreq, float decay, float targetLev, float levSmoothFactor, float levStrength, int levMode, tMempool *const)
Initialize a tSimpleLivingString to a specified mempool.
Definition: leaf-physical.c:359
tSimpleLivingString_free
void tSimpleLivingString_free(tSimpleLivingString *const)
Free a tSimpleLivingString from its mempool.
Definition: leaf-physical.c:380
tLivingString_tick
float tLivingString_tick(tLivingString *const, float input)
Definition: leaf-physical.c:619
tReedTable_initToPool
void tReedTable_initToPool(tReedTable *const, float offset, float slope, tMempool *const)
Initialize a tReedTable to a specified mempool.
Definition: leaf-physical.c:913
tPluck_controlChange
void tPluck_controlChange(tPluck *const, int number, float value)
Perform the control change specified by number and value (0.0 - 128.0).
Definition: leaf-physical.c:125
tKarplusStrong_noteOn
void tKarplusStrong_noteOn(tKarplusStrong *const, float frequency, float amplitude)
Start a note with the given frequency and amplitude.
Definition: leaf-physical.c:236
tSimpleLivingString_setWaveLength
void tSimpleLivingString_setWaveLength(tSimpleLivingString *const, float waveLength)
Definition: leaf-physical.c:404
tKarplusStrong_getLastOut
float tKarplusStrong_getLastOut(tKarplusStrong *const)
Definition: leaf-physical.c:193
tKarplusStrong_initToPool
void tKarplusStrong_initToPool(tKarplusStrong *const, float lowestFrequency, tMempool *const)
Initialize a tKarplusStrong to a specified mempool.
Definition: leaf-physical.c:142
tReedTable_tick
float tReedTable_tick(tReedTable *const, float input)
Definition: leaf-physical.c:930
tComplexLivingString_setDecay
void tComplexLivingString_setDecay(tComplexLivingString *const, float decay)
Definition: leaf-physical.c:800
tPluck_setFrequency
void tPluck_setFrequency(tPluck *const, float frequency)
Set instrument parameters for a particular frequency.
Definition: leaf-physical.c:106
tComplexLivingString_tick
float tComplexLivingString_tick(tComplexLivingString *const, float input)
Definition: leaf-physical.c:835
tLivingString_setPickPos
void tLivingString_setPickPos(tLivingString *const, float pickPos)
Definition: leaf-physical.c:558
tComplexLivingString_setFreq
void tComplexLivingString_setFreq(tComplexLivingString *const, float freq)
Definition: leaf-physical.c:745
tLivingString_sample
float tLivingString_sample(tLivingString *const)
Definition: leaf-physical.c:655
tComplexLivingString_init
void tComplexLivingString_init(tComplexLivingString *const, float freq, float pickPos, float prepPos, float prepIndex, float dampFreq, float decay, float targetLev, float levSmoothFactor, float levStrength, int levMode, LEAF *const leaf)
Initialize a tComplexLivingString to the default mempool of a LEAF instance.
Definition: leaf-physical.c:666
tLivingString_setDampFreq
void tLivingString_setDampFreq(tLivingString *const, float dampFreq)
Definition: leaf-physical.c:575
tComplexLivingString_setLevSmoothFactor
void tComplexLivingString_setLevSmoothFactor(tComplexLivingString *const, float levSmoothFactor)
Definition: leaf-physical.c:813
tSimpleLivingString_setDecay
void tSimpleLivingString_setDecay(tSimpleLivingString *const, float decay)
Definition: leaf-physical.c:420
tLivingString_setWaveLength
void tLivingString_setWaveLength(tLivingString *const, float waveLength)
Definition: leaf-physical.c:549
tLivingString_setPrepIndex
void tLivingString_setPrepIndex(tLivingString *const, float prepIndex)
Definition: leaf-physical.c:567
tComplexLivingString_setDampFreq
void tComplexLivingString_setDampFreq(tComplexLivingString *const, float dampFreq)
Definition: leaf-physical.c:791
LEAF
Struct for an instance of LEAF.
Definition: leaf-global.h:31
tComplexLivingString_sample
float tComplexLivingString_sample(tComplexLivingString *const)
Definition: leaf-physical.c:897
tLivingString_setDecay
void tLivingString_setDecay(tLivingString *const, float decay)
Definition: leaf-physical.c:584
tPluck_noteOn
void tPluck_noteOn(tPluck *const, float frequency, float amplitude)
Start a note with the given frequency and amplitude.
Definition: leaf-physical.c:86
tKarplusStrong_setPickupPosition
void tKarplusStrong_setPickupPosition(tKarplusStrong *const, float position)
Set the pluck or "excitation" position along the string (0.0 - 1.0).
Definition: leaf-physical.c:305
tSimpleLivingString_setFreq
void tSimpleLivingString_setFreq(tSimpleLivingString *const, float freq)
Definition: leaf-physical.c:393
tKarplusStrong_pluck
void tKarplusStrong_pluck(tKarplusStrong *const, float amplitude)
Pluck the string.
Definition: leaf-physical.c:218
tSimpleLivingString_init
void tSimpleLivingString_init(tSimpleLivingString *const, float freq, float dampFreq, float decay, float targetLev, float levSmoothFactor, float levStrength, int levMode, LEAF *const leaf)
Initialize a tSimpleLivingString to the default mempool of a LEAF instance.
Definition: leaf-physical.c:352
tPluck_initToPool
void tPluck_initToPool(tPluck *const, float lowestFrequency, tMempool *const)
Initialize a tPluck to a specified mempool.
Definition: leaf-physical.c:25