leaf-oscillators.h
1 /*==============================================================================
2  leaf-oscillators.h
3  Created: 20 Jan 2017 12:00:58pm
4  Author: Michael R Mulshine
5  ==============================================================================*/
6 
7 #ifndef LEAF_OSCILLATORS_H_INCLUDED
8 #define LEAF_OSCILLATORS_H_INCLUDED
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14  //==============================================================================
15 
16 #include "leaf-math.h"
17 #include "leaf-mempool.h"
18 #include "leaf-tables.h"
19 #include "leaf-filters.h"
20 #include "leaf-distortion.h"
21 
29  //==============================================================================
30 
67  typedef struct _tTable
68  {
69  tMempool mempool;
70 
71  float* waveTable;
72  int size;
73  float inc, freq;
74  float phase;
75  } _tTable;
76 
77  typedef _tTable* tTable;
78 
79  void tTable_init(tTable* const osc, float* table, int size, LEAF* const leaf);
80  void tTable_initToPool(tTable* const osc, float* table, int size, tMempool* const mempool);
81  void tTable_free(tTable* const osc);
82 
83  float tTable_tick(tTable* const osc);
84  void tTable_setFreq(tTable* const osc, float freq);
85 
86  //==============================================================================
87 
126  typedef struct _tWavetable
127  {
128  tMempool mempool;
129 
130  float** tables;
131  int size;
132  int numTables;
133  float baseFreq, invBaseFreq;
134  float inc, freq;
135  float phase;
136 
137  int oct;
138  float w;
139  float aa;
140 
141  tButterworth bl;
142  } _tWavetable;
143 
144  typedef _tWavetable* tWavetable;
145 
146  void tWavetable_init(tWavetable* const osc, const float* table, int size, float maxFreq, LEAF* const leaf);
147  void tWavetable_initToPool(tWavetable* const osc, const float* table, int size, float maxFreq, tMempool* const mempool);
148  void tWavetable_free(tWavetable* const osc);
149 
150  float tWavetable_tick(tWavetable* const osc);
151  void tWavetable_setFreq(tWavetable* const osc, float freq);
152  void tWavetable_setAntiAliasing(tWavetable* const osc, float aa);
153 
154  //==============================================================================
155 
194  typedef struct _tCompactWavetable
195  {
196  tMempool mempool;
197 
198  float** tables;
199  int numTables;
200  int* sizes;
201  float baseFreq, invBaseFreq;
202  float inc, freq;
203  float phase;
204 
205  int oct;
206  float w;
207  float aa;
208 
209  tButterworth bl;
210 
211  float dsBuffer[2];
212  tOversampler ds;
213  } _tCompactWavetable;
214 
215  typedef _tCompactWavetable* tCompactWavetable;
216 
217  void tCompactWavetable_init(tCompactWavetable* const osc, const float* table, int size, float maxFreq, LEAF* const leaf);
218  void tCompactWavetable_initToPool(tCompactWavetable* const osc, const float* table, int size, float maxFreq, tMempool* const mempool);
219  void tCompactWavetable_free(tCompactWavetable* const osc);
220 
221  float tCompactWavetable_tick(tCompactWavetable* const osc);
222  void tCompactWavetable_setFreq(tCompactWavetable* const osc, float freq);
223  void tCompactWavetable_setAntiAliasing(tCompactWavetable* const osc, float aa);
224 
225  //==============================================================================
226 
260  typedef struct _tCycle
261  {
262 
263  tMempool mempool;
264  // Underlying phasor
265  float phase;
266  float inc,freq;
267  } _tCycle;
268 
269  typedef _tCycle* tCycle;
270 
271  void tCycle_init (tCycle* const osc, LEAF* const leaf);
272  void tCycle_initToPool (tCycle* const osc, tMempool* const mempool);
273  void tCycle_free (tCycle* const osc);
274 
275  float tCycle_tick (tCycle* const osc);
276  void tCycle_setFreq (tCycle* const osc, float freq);
277 
278  //==============================================================================
279 
312  typedef struct _tTriangle
313  {
314 
315  tMempool mempool;
316  // Underlying phasor
317  float phase;
318  float inc,freq;
319  int oct;
320  float w;
321  } _tTriangle;
322 
323  typedef _tTriangle* tTriangle;
324 
325  void tTriangle_init (tTriangle* const osc, LEAF* const leaf);
326  void tTriangle_initToPool (tTriangle* const osc, tMempool* const mempool);
327  void tTriangle_free (tTriangle* const osc);
328 
329  float tTriangle_tick (tTriangle* const osc);
330  void tTriangle_setFreq (tTriangle* const osc, float freq);
331 
332 
333  //==============================================================================
334 
367  typedef struct _tSquare
368  {
369 
370  tMempool mempool;
371  // Underlying phasor
372  float phase;
373  float inc,freq;
374  int oct;
375  float w;
376  } _tSquare;
377 
378  typedef _tSquare* tSquare;
379 
380  void tSquare_init (tSquare* const osc, LEAF* const leaf);
381  void tSquare_initToPool (tSquare* const osc, tMempool* const);
382  void tSquare_free (tSquare* const osc);
383 
384  float tSquare_tick (tSquare* const osc);
385  void tSquare_setFreq (tSquare* const osc, float freq);
386 
390  //==============================================================================
391 
424  typedef struct _tSawtooth
425  {
426 
427  tMempool mempool;
428  // Underlying phasor
429  float phase;
430  float inc,freq;
431  int oct;
432  float w;
433  } _tSawtooth;
434 
435  typedef _tSawtooth* tSawtooth;
436 
437  void tSawtooth_init (tSawtooth* const osc, LEAF* const leaf);
438  void tSawtooth_initToPool (tSawtooth* const osc, tMempool* const mempool);
439  void tSawtooth_free (tSawtooth* const osc);
440 
441  float tSawtooth_tick (tSawtooth* const osc);
442  void tSawtooth_setFreq (tSawtooth* const osc, float freq);
443 
444  //==============================================================================
445 
480  typedef struct _tPBTriangle
481  {
482  tMempool mempool;
483  float phase;
484  float inc,freq;
485  float skew;
486  float lastOut;
487  } _tPBTriangle;
488 
489  typedef _tPBTriangle* tPBTriangle;
490 
491  void tPBTriangle_init (tPBTriangle* const osc, LEAF* const leaf);
492  void tPBTriangle_initToPool (tPBTriangle* const osc, tMempool* const mempool);
493  void tPBTriangle_free (tPBTriangle* const osc);
494 
495  float tPBTriangle_tick (tPBTriangle* const osc);
496  void tPBTriangle_setFreq (tPBTriangle* const osc, float freq);
497  void tPBTriangle_setSkew (tPBTriangle* const osc, float skew);
498 
499  //==============================================================================
500 
535  typedef struct _tPBPulse
536  {
537  tMempool mempool;
538  float phase;
539  float inc,freq;
540  float width;
541  } _tPBPulse;
542 
543  typedef _tPBPulse* tPBPulse;
544 
545  void tPBPulse_init (tPBPulse* const osc, LEAF* const leaf);
546  void tPBPulse_initToPool (tPBPulse* const osc, tMempool* const);
547  void tPBPulse_free (tPBPulse* const osc);
548 
549  float tPBPulse_tick (tPBPulse* const osc);
550  void tPBPulse_setFreq (tPBPulse* const osc, float freq);
551  void tPBPulse_setWidth (tPBPulse* const osc, float width);
552 
553  //==============================================================================
554 
585  typedef struct _tPBSaw
586  {
587  tMempool mempool;
588  float phase;
589  float inc,freq;
590  } _tPBSaw;
591 
592  typedef _tPBSaw* tPBSaw;
593 
594  void tPBSaw_init (tPBSaw* const osc, LEAF* const leaf);
595  void tPBSaw_initToPool (tPBSaw* const osc, tMempool* const mempool);
596  void tPBSaw_free (tPBSaw* const osc);
597 
598  float tPBSaw_tick (tPBSaw* const osc);
599  void tPBSaw_setFreq (tPBSaw* const osc, float freq);
600 
601  //==============================================================================
602 
633  typedef struct _tPhasor
634  {
635 
636  tMempool mempool;
637  float phase;
638  float inc,freq;
639  uint8_t phaseDidReset;
640  } _tPhasor;
641 
642  typedef _tPhasor* tPhasor;
643 
644  void tPhasor_init (tPhasor* const osc, LEAF* const leaf);
645  void tPhasor_initToPool (tPhasor* const osc, tMempool* const);
646  void tPhasor_free (tPhasor* const osc);
647 
648  float tPhasor_tick (tPhasor* const osc);
649  void tPhasor_setFreq (tPhasor* const osc, float freq);
650 
651  //==============================================================================
652 
678  /* tNoise. WhiteNoise, PinkNoise. */
683  {
686  NoiseTypeNil,
687  };
688 
691  typedef enum NoiseType NoiseType;
692 
693  typedef struct _tNoise
694  {
695 
696  tMempool mempool;
697  NoiseType type;
698  float pinkb0, pinkb1, pinkb2;
699  float(*rand)(void);
700  } _tNoise;
701 
702  typedef _tNoise* tNoise;
703 
704  void tNoise_init (tNoise* const noise, NoiseType type, LEAF* const leaf);
705  void tNoise_initToPool (tNoise* const noise, NoiseType type, tMempool* const);
706  void tNoise_free (tNoise* const noise);
707 
708  float tNoise_tick (tNoise* const noise);
709 
710  //==============================================================================
711 
794  {
798  NeuronModeNil
799  };
800 
803  typedef enum NeuronMode NeuronMode;
804 
805  typedef struct _tNeuron
806  {
807  tMempool mempool;
808 
809  tPoleZero f;
810 
811  NeuronMode mode;
812 
813  float voltage, current;
814  float timeStep;
815 
816  float alpha[3];
817  float beta[3];
818  float rate[3];
819  float V[3];
820  float P[3];
821  float gK, gN, gL, C;
822  } _tNeuron;
823 
824  typedef _tNeuron* tNeuron;
825 
826  void tNeuron_init (tNeuron* const neuron, LEAF* const leaf);
827  void tNeuron_initToPool (tNeuron* const neuron, tMempool* const mempool);
828  void tNeuron_free (tNeuron* const neuron);
829 
830  void tNeuron_reset (tNeuron* const neuron);
831  float tNeuron_tick (tNeuron* const neuron);
832  void tNeuron_setMode (tNeuron* const neuron, NeuronMode mode);
833  void tNeuron_setCurrent (tNeuron* const neuron, float current);
834  void tNeuron_setK (tNeuron* const neuron, float K);
835  void tNeuron_setL (tNeuron* const neuron, float L);
836  void tNeuron_setN (tNeuron* const neuron, float N);
837  void tNeuron_setC (tNeuron* const neuron, float C);
838  void tNeuron_setV1 (tNeuron* const neuron, float V1);
839  void tNeuron_setV2 (tNeuron* const neuron, float V2);
840  void tNeuron_setV3 (tNeuron* const neuron, float V3);
841  void tNeuron_setTimeStep (tNeuron* const neuron, float timestep);
842 
843 
844 
845  //==============================================================================
846 
847 
848 #define FILLEN 256
849 
890  typedef struct _tMBPulse
891  {
892 
893  tMempool mempool;
894  float out;
895  float amp;
896  float last_amp;
897  float freq;
898  float waveform; // duty cycle, must be in [-1, 1]
899  float lastsyncin;
900  float sync;
901  float syncdir;
902  int softsync;
903  float _p, _w, _b, _x, _z;
904  float _f [FILLEN + STEP_DD_PULSE_LENGTH];
905  int _j, _k;
906  bool _init;
907  } _tMBPulse;
908 
909  typedef _tMBPulse* tMBPulse;
910 
911  void tMBPulse_init(tMBPulse* const osc, LEAF* const leaf);
912  void tMBPulse_initToPool(tMBPulse* const osc, tMempool* const mempool);
913  void tMBPulse_free(tMBPulse* const osc);
914 
915  float tMBPulse_tick(tMBPulse* const osc);
916  void tMBPulse_setFreq(tMBPulse* const osc, float f);
917  void tMBPulse_setWidth(tMBPulse* const osc, float w);
918  float tMBPulse_sync(tMBPulse* const osc, float sync);
919  void tMBPulse_setSyncMode(tMBPulse* const osc, int hardOrSoft);
920 
961  typedef struct _tMBTriangle
962  {
963 
964  tMempool mempool;
965  float out;
966  float amp;
967  float last_amp;
968  float freq;
969  float waveform; // duty cycle, must be in [-1, 1]
970  float lastsyncin;
971  float sync;
972  float syncdir;
973  int softsync;
974  float _p, _w, _b, _z;
975  float _f [FILLEN + LONGEST_DD_PULSE_LENGTH];
976  int _j, _k;
977  bool _init;
978  } _tMBTriangle;
979 
980  typedef _tMBTriangle* tMBTriangle;
981 
982  void tMBTriangle_init(tMBTriangle* const osc, LEAF* const leaf);
983  void tMBTriangle_initToPool(tMBTriangle* const osc, tMempool* const mempool);
984  void tMBTriangle_free(tMBTriangle* const osc);
985 
986  float tMBTriangle_tick(tMBTriangle* const osc);
987  void tMBTriangle_setFreq(tMBTriangle* const osc, float f);
988  void tMBTriangle_setWidth(tMBTriangle* const osc, float w);
989  float tMBTriangle_sync(tMBTriangle* const osc, float sync);
990  void tMBTriangle_setSyncMode(tMBTriangle* const osc, int hardOrSoft);
991 
992 
1033  typedef struct _tMBSaw
1034  {
1035  tMempool mempool;
1036  float out;
1037  float amp;
1038  float last_amp;
1039  float freq;
1040  float lastsyncin;
1041  float sync;
1042  float syncdir;
1043  int softsync;
1044  float _p, _w, _z;
1045  float _f [FILLEN + STEP_DD_PULSE_LENGTH];
1046  int _j;
1047  bool _init;
1048  } _tMBSaw;
1049 
1050  typedef _tMBSaw* tMBSaw;
1051 
1052  void tMBSaw_init(tMBSaw* const osc, LEAF* const leaf);
1053  void tMBSaw_initToPool(tMBSaw* const osc, tMempool* const mempool);
1054  void tMBSaw_free(tMBSaw* const osc);
1055 
1056  float tMBSaw_tick(tMBSaw* const osc);
1057  void tMBSaw_setFreq(tMBSaw* const osc, float f);
1058  float tMBSaw_sync(tMBSaw* const osc, float sync);
1059  void tMBSaw_setSyncMode(tMBSaw* const osc, int hardOrSoft);
1060 
1061 
1062 #ifdef __cplusplus
1063 }
1064 #endif
1065 
1066 #endif // LEAF_OSCILLATORS_H_INCLUDED
1067 
1068 //==============================================================================
1069 
1070 
1071 
tNeuron_setN
void tNeuron_setN(tNeuron *const neuron, float N)
Set the sodium value.
Definition: leaf-oscillators.c:1153
tTriangle_initToPool
void tTriangle_initToPool(tTriangle *const osc, tMempool *const mempool)
Initialize a tTriangle to a specified mempool.
Definition: leaf-oscillators.c:471
NeuronMode
NeuronMode
Definition: leaf-oscillators.h:793
tMBSaw_initToPool
void tMBSaw_initToPool(tMBSaw *const osc, tMempool *const mempool)
Initialize a tMBSaw to a specified mempool.
Definition: leaf-oscillators.c:1853
tNoise_init
void tNoise_init(tNoise *const noise, NoiseType type, LEAF *const leaf)
Initialize a tNoise to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:988
tNoise_initToPool
void tNoise_initToPool(tNoise *const noise, NoiseType type, tMempool *const)
Initialize a tNoise to a specified mempool.
Definition: leaf-oscillators.c:993
tSawtooth_free
void tSawtooth_free(tSawtooth *const osc)
Free a tSawtooth from its mempool.
Definition: leaf-oscillators.c:667
tTable_init
void tTable_init(tTable *const osc, float *table, int size, LEAF *const leaf)
Initialize a tTable to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:20
tPBPulse_free
void tPBPulse_free(tPBPulse *const osc)
Free a tPBPulse from its mempool.
Definition: leaf-oscillators.c:833
tSquare_init
void tSquare_init(tSquare *const osc, LEAF *const leaf)
Initialize a tSquare to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:559
tMBPulse_sync
float tMBPulse_sync(tMBPulse *const osc, float sync)
Definition: leaf-oscillators.c:1528
tTriangle_tick
float tTriangle_tick(tTriangle *const osc)
Tick a tTriangle oscillator.
Definition: leaf-oscillators.c:510
tNeuron_initToPool
void tNeuron_initToPool(tNeuron *const neuron, tMempool *const mempool)
Initialize a tNeuron to a specified mempool.
Definition: leaf-oscillators.c:1045
tNeuron_setC
void tNeuron_setC(tNeuron *const neuron, float C)
Set the calcium value.
Definition: leaf-oscillators.c:1159
tNeuron_setV2
void tNeuron_setV2(tNeuron *const neuron, float V2)
Set the V2 value.
Definition: leaf-oscillators.c:1122
tNeuron_reset
void tNeuron_reset(tNeuron *const neuron)
Reset the neuron model.
Definition: leaf-oscillators.c:1086
tNeuron_setCurrent
void tNeuron_setCurrent(tNeuron *const neuron, float current)
Set the current.
Definition: leaf-oscillators.c:1248
tPBTriangle_setSkew
void tPBTriangle_setSkew(tPBTriangle *const osc, float skew)
Definition: leaf-oscillators.c:807
tMBSaw_sync
float tMBSaw_sync(tMBSaw *const osc, float sync)
Sync this oscillator to another signal.
Definition: leaf-oscillators.c:1982
tPhasor_initToPool
void tPhasor_initToPool(tPhasor *const osc, tMempool *const)
Initialize a tPhasor to a specified mempool.
Definition: leaf-oscillators.c:937
tNeuron_setV1
void tNeuron_setV1(tNeuron *const neuron, float V1)
Set the V1 value.
Definition: leaf-oscillators.c:1115
tPhasor_tick
float tPhasor_tick(tPhasor *const osc)
Definition: leaf-oscillators.c:966
tCycle_init
void tCycle_init(tCycle *const osc, LEAF *const leaf)
Initialize a tCycle to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:391
tSquare_setFreq
void tSquare_setFreq(tSquare *const osc, float freq)
Set the frequency of a tSquare oscillator.
Definition: leaf-oscillators.c:582
tCompactWavetable_setFreq
void tCompactWavetable_setFreq(tCompactWavetable *const osc, float freq)
Set the frequency of a tCompactWavetable oscillator.
Definition: leaf-oscillators.c:359
tMBTriangle_setFreq
void tMBTriangle_setFreq(tMBTriangle *const osc, float f)
Definition: leaf-oscillators.c:1811
tMBPulse_initToPool
void tMBPulse_initToPool(tMBPulse *const osc, tMempool *const mempool)
Initialize a tMBPulse to a specified mempool.
Definition: leaf-oscillators.c:1263
tWavetable_tick
float tWavetable_tick(tWavetable *const osc)
Tick a tWavetable oscillator.
Definition: leaf-oscillators.c:172
tPBPulse_setFreq
void tPBPulse_setFreq(tPBPulse *const osc, float freq)
Definition: leaf-oscillators.c:857
tTable_initToPool
void tTable_initToPool(tTable *const osc, float *table, int size, tMempool *const mempool)
Initialize a tTable to a specified mempool.
Definition: leaf-oscillators.c:25
tMBSaw_free
void tMBSaw_free(tMBSaw *const osc)
Free a tMBSaw from its mempool.
Definition: leaf-oscillators.c:1871
tMBTriangle_setWidth
void tMBTriangle_setWidth(tMBTriangle *const osc, float w)
Definition: leaf-oscillators.c:1817
tSawtooth_setFreq
void tSawtooth_setFreq(tSawtooth *const osc, float freq)
Set the frequency of a tSawtooth oscillator.
Definition: leaf-oscillators.c:674
tSawtooth_initToPool
void tSawtooth_initToPool(tSawtooth *const osc, tMempool *const mempool)
Initialize a tSawtooth to a specified mempool.
Definition: leaf-oscillators.c:656
tNeuron_free
void tNeuron_free(tNeuron *const neuron)
Free a tNeuron from its mempool.
Definition: leaf-oscillators.c:1078
tCycle_setFreq
void tCycle_setFreq(tCycle *const osc, float freq)
Set the frequency of a tCycle oscillator.
Definition: leaf-oscillators.c:413
tPBPulse_init
void tPBPulse_init(tPBPulse *const osc, LEAF *const leaf)
Initialize a tPBPulse to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:817
tPBTriangle_init
void tPBTriangle_init(tPBTriangle *const osc, LEAF *const leaf)
Initialize a tPBTriangle to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:743
tPBTriangle_free
void tPBTriangle_free(tPBTriangle *const osc)
Free a tTri from its mempool.
Definition: leaf-oscillators.c:760
tTriangle_init
void tTriangle_init(tTriangle *const osc, LEAF *const leaf)
Initialize a tTriangle to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:466
tNeuron_init
void tNeuron_init(tNeuron *const neuron, LEAF *const leaf)
Initialize a tNeuron to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:1040
tMBTriangle_free
void tMBTriangle_free(tMBTriangle *const osc)
Free a tMBTriangle from its mempool.
Definition: leaf-oscillators.c:1577
tSawtooth_init
void tSawtooth_init(tSawtooth *const osc, LEAF *const leaf)
Initialize a tSawtooth to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:651
tNeuron_setL
void tNeuron_setL(tNeuron *const neuron, float L)
Set the chloride value.
Definition: leaf-oscillators.c:1146
tMBSaw_setSyncMode
void tMBSaw_setSyncMode(tMBSaw *const osc, int hardOrSoft)
Set the sync behavior of the oscillator.
Definition: leaf-oscillators.c:1998
tMBSaw_tick
float tMBSaw_tick(tMBSaw *const osc)
Tick the oscillator.
Definition: leaf-oscillators.c:1877
tCycle_initToPool
void tCycle_initToPool(tCycle *const osc, tMempool *const mempool)
Initialize a tCycle to a specified mempool.
Definition: leaf-oscillators.c:396
tTable_setFreq
void tTable_setFreq(tTable *const osc, float freq)
Set the frequency of a tTable oscillator.
Definition: leaf-oscillators.c:44
tCompactWavetable_free
void tCompactWavetable_free(tCompactWavetable *const osc)
Free a tCompactWavetable from its mempool.
Definition: leaf-oscillators.c:309
tMBTriangle_sync
float tMBTriangle_sync(tMBTriangle *const osc, float sync)
Definition: leaf-oscillators.c:1823
tWavetable_setFreq
void tWavetable_setFreq(tWavetable *const osc, float freq)
Set the frequency of a tWavetable oscillator.
Definition: leaf-oscillators.c:208
tCycle_tick
float tCycle_tick(tCycle *const osc)
Tick a tCycle oscillator.
Definition: leaf-oscillators.c:427
tWavetable_free
void tWavetable_free(tWavetable *const osc)
Free a tWavetable from its mempool.
Definition: leaf-oscillators.c:160
tNeuron_tick
float tNeuron_tick(tNeuron *const neuron)
Tick a tNeuron oscillator.
Definition: leaf-oscillators.c:1166
PinkNoise
Pink noise. Inverse frequency-proportional spectrum.
Definition: leaf-oscillators.h:685
tPBTriangle_initToPool
void tPBTriangle_initToPool(tPBTriangle *const osc, tMempool *const mempool)
Initialize a tPBTriangle to a specified mempool.
Definition: leaf-oscillators.c:748
tSquare_initToPool
void tSquare_initToPool(tSquare *const osc, tMempool *const)
Initialize a tSquare to a specified mempool.
Definition: leaf-oscillators.c:564
tMBPulse_init
void tMBPulse_init(tMBPulse *const osc, LEAF *const leaf)
Initialize a tMBPulse to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:1258
NeuronAaltoShaper
Aalto voltage shaping.
Definition: leaf-oscillators.h:797
tPBPulse_setWidth
void tPBPulse_setWidth(tPBPulse *const osc, float width)
Definition: leaf-oscillators.c:866
tMBPulse_setWidth
void tMBPulse_setWidth(tMBPulse *const osc, float w)
Definition: leaf-oscillators.c:1522
tPBPulse_tick
float tPBPulse_tick(tPBPulse *const osc)
Definition: leaf-oscillators.c:840
tNoise_free
void tNoise_free(tNoise *const noise)
Free a tNoise from its mempool.
Definition: leaf-oscillators.c:1004
tNeuron_setK
void tNeuron_setK(tNeuron *const neuron, float K)
Set the potassium value.
Definition: leaf-oscillators.c:1140
tTriangle_setFreq
void tTriangle_setFreq(tTriangle *const osc, float freq)
Set the frequency of a tTriangle oscillator.
Definition: leaf-oscillators.c:489
tNeuron_setMode
void tNeuron_setMode(tNeuron *const neuron, NeuronMode mode)
Set the tNeuron shaping mode.
Definition: leaf-oscillators.c:1242
NeuronTanh
Tanh voltage shaping.
Definition: leaf-oscillators.h:796
tPBSaw_setFreq
void tPBSaw_setFreq(tPBSaw *const osc, float freq)
Definition: leaf-oscillators.c:912
tMBTriangle_init
void tMBTriangle_init(tMBTriangle *const osc, LEAF *const leaf)
Initialize a tMBTriangle to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:1553
tMBPulse_tick
float tMBPulse_tick(tMBPulse *const osc)
Definition: leaf-oscillators.c:1288
tCompactWavetable_tick
float tCompactWavetable_tick(tCompactWavetable *const osc)
Tick a tCompactWavetable oscillator.
Definition: leaf-oscillators.c:322
tPhasor_free
void tPhasor_free(tPhasor *const osc)
Free a tPhasor from its mempool.
Definition: leaf-oscillators.c:948
tPBTriangle_setFreq
void tPBTriangle_setFreq(tPBTriangle *const osc, float freq)
Definition: leaf-oscillators.c:798
tPBSaw_tick
float tPBSaw_tick(tPBSaw *const osc)
Definition: leaf-oscillators.c:898
tSquare_tick
float tSquare_tick(tSquare *const osc)
Tick a tSquare oscillator.
Definition: leaf-oscillators.c:602
tMBTriangle_tick
float tMBTriangle_tick(tMBTriangle *const osc)
Definition: leaf-oscillators.c:1583
tMBPulse_setSyncMode
void tMBPulse_setSyncMode(tMBPulse *const osc, int hardOrSoft)
Set the sync behavior of the oscillator.
Definition: leaf-oscillators.c:1544
tMBTriangle_initToPool
void tMBTriangle_initToPool(tMBTriangle *const osc, tMempool *const mempool)
Initialize a tMBTriangle to a specified mempool.
Definition: leaf-oscillators.c:1558
tPBTriangle_tick
float tPBTriangle_tick(tPBTriangle *const osc)
Definition: leaf-oscillators.c:767
tMBPulse_setFreq
void tMBPulse_setFreq(tMBPulse *const osc, float f)
Definition: leaf-oscillators.c:1516
tMBSaw_init
void tMBSaw_init(tMBSaw *const osc, LEAF *const leaf)
Initialize a tMBSaw to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:1848
tCycle_free
void tCycle_free(tCycle *const osc)
Free a tCycle from its mempool.
Definition: leaf-oscillators.c:406
NeuronNormal
Normal operation.
Definition: leaf-oscillators.h:795
tPBSaw_init
void tPBSaw_init(tPBSaw *const osc, LEAF *const leaf)
Initialize a tPBSaw to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:876
tTable_tick
float tTable_tick(tTable *const osc)
Tick a tTable oscillator.
Definition: leaf-oscillators.c:56
tSquare_free
void tSquare_free(tSquare *const osc)
Free a tSquare from its mempool.
Definition: leaf-oscillators.c:575
tNeuron_setV3
void tNeuron_setV3(tNeuron *const neuron, float V3)
Set the V3 value.
Definition: leaf-oscillators.c:1128
tMBSaw_setFreq
void tMBSaw_setFreq(tMBSaw *const osc, float f)
Set the frequency of the oscillator.
Definition: leaf-oscillators.c:1976
tNeuron_setTimeStep
void tNeuron_setTimeStep(tNeuron *const neuron, float timestep)
Set the time step of the model.
Definition: leaf-oscillators.c:1134
tPhasor_init
void tPhasor_init(tPhasor *const osc, LEAF *const leaf)
Initialize a tPhasor to the default mempool of a LEAF instance.
Definition: leaf-oscillators.c:932
tPBPulse_initToPool
void tPBPulse_initToPool(tPBPulse *const osc, tMempool *const)
Initialize a tPBPulse to a specified mempool.
Definition: leaf-oscillators.c:822
tTriangle_free
void tTriangle_free(tTriangle *const osc)
Free a tTriangle from its mempool.
Definition: leaf-oscillators.c:482
tMBTriangle_setSyncMode
void tMBTriangle_setSyncMode(tMBTriangle *const osc, int hardOrSoft)
Set the sync behavior of the oscillator.
Definition: leaf-oscillators.c:1839
LEAF
Struct for an instance of LEAF.
Definition: leaf-global.h:31
tTable_free
void tTable_free(tTable *const osc)
Free a tTable from its mempool.
Definition: leaf-oscillators.c:37
tNoise_tick
float tNoise_tick(tNoise *const noise)
Definition: leaf-oscillators.c:1011
tSawtooth_tick
float tSawtooth_tick(tSawtooth *const osc)
Tick a tSawtooth oscillator.
Definition: leaf-oscillators.c:694
tMBPulse_free
void tMBPulse_free(tMBPulse *const osc)
Free a tMBPulse from its mempool.
Definition: leaf-oscillators.c:1282
tPhasor_setFreq
void tPhasor_setFreq(tPhasor *const osc, float freq)
Definition: leaf-oscillators.c:955
WhiteNoise
White noise. Full spectrum.
Definition: leaf-oscillators.h:684
tPBSaw_free
void tPBSaw_free(tPBSaw *const osc)
Free a tPBSaw from its mempool.
Definition: leaf-oscillators.c:891
NoiseType
NoiseType
Definition: leaf-oscillators.h:682
tPBSaw_initToPool
void tPBSaw_initToPool(tPBSaw *const osc, tMempool *const mempool)
Initialize a tPBSaw to a specified mempool.
Definition: leaf-oscillators.c:881