ref: 654405de9bc9c636558211aadd707cba8a05f541
parent: e3e22cb2750b7f17d360eba55c4a5ec6d16f2d6c
author: Matthew Wang <mjw7@princeton.edu>
date: Thu Jul 2 12:40:48 EDT 2020
more doc comments
--- a/doxygen/customdoxygen.css
+++ b/doxygen/customdoxygen.css
@@ -1329,7 +1329,7 @@
padding: 0px;
margin: 0px;
width: 100%;
- border-bottom: 1px solid #5373B4;
+ border-bottom: 0px solid #5373B4;
}
.image
@@ -1908,7 +1908,7 @@
.tabs, .tabs2, .tabs3 {
background-image: none;
- background-color: #096e48;
+ background-color: transparent;
width: 100%;
z-index: 101;
font-size: 14px;
@@ -1924,6 +1924,7 @@
}
.tablist {
+ background-color: #096e48;
width: 100%;
margin: 0;
padding: 0;
--- a/doxygen/header.html
+++ b/doxygen/header.html
@@ -22,7 +22,7 @@
<body class="bg-washed-green black-70 ph0 sans-serif">
-<header class="fl bg-black-70 w-100 pt4-ns pb3-ns pl5">
+<header class="fl bg-deep-green w-100 pt4-ns pb3-ns pl5">
<div class="bg-dark-green pv0">
<h1 class="black-70 pv3 ph4 f-headline-m">
--- a/leaf/Inc/leaf-analysis.h
+++ b/leaf/Inc/leaf-analysis.h
@@ -31,7 +31,51 @@
//==============================================================================
- /* Envelope Follower */
+ /*!
+ @defgroup tenvelopefollower tEnvelopeFollower
+ @ingroup analysis
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tEnvelopeFollower_init (tEnvelopeFollower* const, float attackThreshold, float decayCoeff)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tEnvelopeFollower_initToPool (tEnvelopeFollower* const, float attackThreshold, float decayCoeff, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tEnvelopeFollower_free (tEnvelopeFollower* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tEnvelopeFollower_tick (tEnvelopeFollower* const, float x)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tEnvelopeFollower_decayCoeff (tEnvelopeFollower* const, float decayCoeff)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tEnvelopeFollower_attackThresh (tEnvelopeFollower* const, float attackThresh)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tEnvelopeFollower
{
tMempool mempool;
@@ -46,13 +90,52 @@
void tEnvelopeFollower_init (tEnvelopeFollower* const, float attackThreshold, float decayCoeff);
void tEnvelopeFollower_initToPool (tEnvelopeFollower* const, float attackThreshold, float decayCoeff, tMempool* const);
void tEnvelopeFollower_free (tEnvelopeFollower* const);
-
+
float tEnvelopeFollower_tick (tEnvelopeFollower* const, float x);
int tEnvelopeFollower_decayCoeff (tEnvelopeFollower* const, float decayCoeff);
int tEnvelopeFollower_attackThresh (tEnvelopeFollower* const, float attackThresh);
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
-
+
+ /*!
+ @defgroup tzerocrossing tZeroCrossing
+ @ingroup analysis
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tZeroCrossing_init (tZeroCrossing* const, int maxWindowSize)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tZeroCrossing_initToPool (tZeroCrossing* const, int maxWindowSize, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tZeroCrossing_free (tZeroCrossing* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tZeroCrossing_tick (tZeroCrossing* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tZeroCrossing_setWindow (tZeroCrossing* const, float windowSize)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
/* Zero Crossing Detector */
typedef struct _tZeroCrossing {
tMempool mempool;
@@ -65,18 +148,63 @@
int prevPosition;
int position;
} _tZeroCrossing;
-
+
typedef _tZeroCrossing* tZeroCrossing;
-
+
void tZeroCrossing_init (tZeroCrossing* const, int maxWindowSize);
void tZeroCrossing_initToPool (tZeroCrossing* const, int maxWindowSize, tMempool* const);
void tZeroCrossing_free (tZeroCrossing* const);
-
+
float tZeroCrossing_tick (tZeroCrossing* const, float input);
void tZeroCrossing_setWindow (tZeroCrossing* const, float windowSize);
-
+
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+ /*!
+ @defgroup tpowerfollower tPowerFollower
+ @ingroup analysis
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tPowerFollower_init (tPowerFollower* const, float factor)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPowerFollower_initToPool (tPowerFollower* const, float factor, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPowerFollower_free (tPowerFollower* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tPowerFollower_tick (tPowerFollower* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tPowerFollower_sample (tPowerFollower* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tPowerFollower_setFactor (tPowerFollower* const, float factor)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
/* PowerEnvelopeFollower */
typedef struct _tPowerFollower
{
@@ -98,6 +226,46 @@
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+ /*!
+ @defgroup tenvpd tEnvPD
+ @ingroup analysis
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tEnvPD_init (tEnvPD* const, int windowSize, int hopSize, int blockSize)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tEnvPD_initToPool (tEnvPD* const, int windowSize, int hopSize, int blockSize, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tEnvPD_free (tEnvPD* const)
+ @brief
+ @param
+ */
+
+
+ /*!
+ @fn float tEnvPD_tick (tEnvPD* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tEnvPD_processBlock (tEnvPD* const, float* in)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
// ENV~ from PD, modified for LEAF
#define MAXOVERLAP 32
#define INITVSTAKEN 64
@@ -130,7 +298,69 @@
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- /* tAttackDetection */
+ /*!
+ @defgroup tattackdetection tAttackDetection
+ @ingroup analysis
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tAttackDetection_init (tAttackDetection* const, int blocksize, int atk, int rel)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_initToPool (tAttackDetection* const, int blocksize, int atk, int rel, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_free (tAttackDetection* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_setBlocksize (tAttackDetection* const, int size)
+ @brief Set expected input blocksize
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_setSamplerate (tAttackDetection* const, int inRate)
+ @brief Set attack detection sample rate
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_setAttack (tAttackDetection* const, int inAtk)
+ @brief Set attack time and coeff
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_setRelease (tAttackDetection* const, int inRel)
+ @brief Set release time and coeff
+ @param
+ */
+
+ /*!
+ @fn void tAttackDetection_setThreshold (tAttackDetection* const, float thres)
+ @brief Set level above which values are identified as attacks
+ @param
+ */
+
+ /*!
+ @fn int tAttackDetection_detect (tAttackDetection* const, float *in)
+ @brief Find the largest transient in input block, return index of attack
+ @param
+ */
+
+ /*! @} */
+
#define DEFBLOCKSIZE 1024
#define DEFTHRESHOLD 6
#define DEFATTACK 10
@@ -165,28 +395,78 @@
void tAttackDetection_initToPool (tAttackDetection* const, int blocksize, int atk, int rel, tMempool* const);
void tAttackDetection_free (tAttackDetection* const);
- // set expected input blocksize
void tAttackDetection_setBlocksize (tAttackDetection* const, int size);
-
- // change atkDetector sample rate
void tAttackDetection_setSamplerate (tAttackDetection* const, int inRate);
-
- // set attack time and coeff
void tAttackDetection_setAttack (tAttackDetection* const, int inAtk);
-
- // set release time and coeff
void tAttackDetection_setRelease (tAttackDetection* const, int inRel);
-
- // set level above which values are identified as attacks
void tAttackDetection_setThreshold (tAttackDetection* const, float thres);
-
- // find largest transient in input block, return index of attack
int tAttackDetection_detect (tAttackDetection* const, float *in);
//==============================================================================
- // tSNAC: period detector
- // from Katja Vetters http://www.katjaas.nl/helmholtz/helmholtz.html
+ /*!
+ @defgroup tsnac tSNAC
+ @ingroup analysis
+ @brief Period detection algorithm from Katja Vetters http://www.katjaas.nl/helmholtz/helmholtz.html
+ @{
+ */
+
+ /*!
+ @fn void tSNAC_init (tSNAC* const, int overlaparg)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSNAC_initToPool (tSNAC* const, int overlaparg, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSNAC_free (tSNAC* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSNAC_ioSamples (tSNAC *s, float *in, float *out, int size)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSNAC_setOverlap (tSNAC *s, int lap)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSNAC_setBias (tSNAC *s, float bias)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSNAC_setMinRMS (tSNAC *s, float rms)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tSNAC_getPeriod (tSNAC *s)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tSNAC_getFidelity (tSNAC *s)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
#define SNAC_FRAME_SIZE 1024 // default analysis framesize // should be the same as (or smaller than?) PS_FRAME_SIZE
#define DEFOVERLAP 1 // default overlap
#define DEFBIAS 0.2f // default bias
@@ -228,6 +508,77 @@
float tSNAC_getPeriod (tSNAC *s);
float tSNAC_getFidelity (tSNAC *s);
+
+ /*!
+ @defgroup tperioddetection tPeriodDetection
+ @ingroup analysis
+ @brief
+ @{
+ */
+
+
+ /*!
+ @fn void tPeriodDetection_init (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_initToPool (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_free (tPeriodDetection* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tPeriodDetection_tick (tPeriodDetection* const, float sample)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tPeriodDetection_getPeriod (tPeriodDetection* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_setHopSize (tPeriodDetection* const, int hs)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_setWindowSize (tPeriodDetection* const, int ws)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_setFidelityThreshold(tPeriodDetection* const, float threshold)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_setAlpha (tPeriodDetection* const, float alpha)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tPeriodDetection_setTolerance (tPeriodDetection* const, float tolerance)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
#define DEFPITCHRATIO 2.0f
#define DEFTIMECONSTANT 100.0f
#define DEFHOPSIZE 64
@@ -235,8 +586,6 @@
#define FBA 20
#define HPFREQ 40.0f
- // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- // Period detection
typedef struct _tPeriodDetection
{
tMempool mempool;
@@ -297,4 +646,6 @@
#endif // LEAF_ANALYSIS_H_INCLUDED
//==============================================================================
+
+
--- a/leaf/Inc/leaf-delay.h
+++ b/leaf/Inc/leaf-delay.h
@@ -28,7 +28,87 @@
//==============================================================================
- /* Non-interpolating delay, reimplemented from STK (Cook and Scavone). */
+ /*!
+ @defgroup tdelay tDelay
+ @ingroup delay
+ @brief Non-interpolating delay, reimplemented from STK (Cook and Scavone).
+ @{
+ */
+
+ /*!
+ @fn void tDelay_init (tDelay* const, uint32_t delay, uint32_t maxDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tDelay_initToPool (tDelay* const, uint32_t delay, uint32_t maxDelay, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tDelay_free (tDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tDelay_clear (tDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tDelay_setDelay (tDelay* const, uint32_t delay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn uint32_t tDelay_getDelay (tDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tDelay_tapIn (tDelay* const, float in, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tDelay_tapOut (tDelay* const, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tDelay_addTo (tDelay* const, float value, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tDelay_tick (tDelay* const, float sample)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tDelay_getLastOut (tDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tDelay_getLastIn (tDelay* const)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tDelay
{
tMempool mempool;
@@ -62,7 +142,99 @@
//==============================================================================
- /* Linearly-interpolating delay, reimplemented from STK (Cook and Scavone). */
+ /*!
+ @defgroup tlineardelay tLinearDelay
+ @ingroup delay
+ @brief Linearly-interpolating delay, reimplemented from STK (Cook and Scavone).
+ @{
+ */
+
+ /*!
+ @fn void tLinearDelay_init (tLinearDelay* const, float delay, uint32_t maxDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLinearDelay_initToPool (tLinearDelay* const, float delay, uint32_t maxDelay, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLinearDelay_free (tLinearDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLinearDelay_clear (tLinearDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tLinearDelay_setDelay (tLinearDelay* const, float delay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_getDelay (tLinearDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLinearDelay_tapIn (tLinearDelay* const, float in, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_tapOut (tLinearDelay* const, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_addTo (tLinearDelay* const, float value, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_tick (tLinearDelay* const, float sample)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLinearDelay_tickIn (tLinearDelay* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_tickOut (tLinearDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_getLastOut (tLinearDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLinearDelay_getLastIn (tLinearDelay* const)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tLinearDelay
{
tMempool mempool;
@@ -88,11 +260,11 @@
void tLinearDelay_initToPool (tLinearDelay* const, float delay, uint32_t maxDelay, tMempool* const);
void tLinearDelay_free (tLinearDelay* const);
- void tLinearDelay_clear (tLinearDelay* const dl);
+ void tLinearDelay_clear (tLinearDelay* const dl);
int tLinearDelay_setDelay (tLinearDelay* const, float delay);
float tLinearDelay_getDelay (tLinearDelay* const);
void tLinearDelay_tapIn (tLinearDelay* const, float in, uint32_t tapDelay);
- float tLinearDelay_tapOut (tLinearDelay* const, uint32_t tapDelay);
+ float tLinearDelay_tapOut (tLinearDelay* const, uint32_t tapDelay);
float tLinearDelay_addTo (tLinearDelay* const, float value, uint32_t tapDelay);
float tLinearDelay_tick (tLinearDelay* const, float sample);
void tLinearDelay_tickIn (tLinearDelay* const, float input);
@@ -100,11 +272,115 @@
float tLinearDelay_getLastOut (tLinearDelay* const);
float tLinearDelay_getLastIn (tLinearDelay* const);
-
-
+
+
//==============================================================================
-
- /* Hermite-interpolating delay, created by adapting STK linear delay with Hermite interpolation */
+
+ /*!
+ @defgroup thermitedelay tHermiteDelay
+ @ingroup delay
+ @brief Hermite-interpolating delay, created by adapting STK linear delay with Hermite interpolation.
+ @{
+ */
+
+ /*!
+ @fn void tHermiteDelay_init (tHermiteDelay* const dl, float delay, uint32_t maxDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tHermiteDelay_initToPool (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tHermiteDelay_free (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tHermiteDelay_clear (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_tick (tHermiteDelay* const dl, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tHermiteDelay_tickIn (tHermiteDelay* const dl, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_tickOut (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_tapOut (tHermiteDelay* const dl, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tHermiteDelay_tapIn (tHermiteDelay* const dl, float value, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_addTo (tHermiteDelay* const dl, float value, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_getDelay (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_getLastOut (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_getLastIn (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tHermiteDelay_setGain (tHermiteDelay* const dl, float gain)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tHermiteDelay_getGain (tHermiteDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tHermiteDelay
{
tMempool mempool;
@@ -111,42 +387,122 @@
float gain;
float* buff;
-
+
float lastOut, lastIn;
-
+
uint32_t inPoint, outPoint;
-
+
uint32_t maxDelay;
-
+
float delay;
-
+
float alpha, omAlpha;
} _tHermiteDelay;
-
+
typedef _tHermiteDelay* tHermiteDelay;
-
- void tHermiteDelay_init (tHermiteDelay* const dl, float delay, uint32_t maxDelay);
- void tHermiteDelay_initToPool (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp);
+
+ void tHermiteDelay_init (tHermiteDelay* const dl, float delay, uint32_t maxDelay);
+ void tHermiteDelay_initToPool (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp);
void tHermiteDelay_free (tHermiteDelay* const dl);
- void tHermiteDelay_clear (tHermiteDelay* const dl);
- float tHermiteDelay_tick (tHermiteDelay* const dl, float input);
- void tHermiteDelay_tickIn (tHermiteDelay* const dl, float input);
- float tHermiteDelay_tickOut (tHermiteDelay* const dl);
- int tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay);
- float tHermiteDelay_tapOut (tHermiteDelay* const dl, uint32_t tapDelay);
- void tHermiteDelay_tapIn (tHermiteDelay* const dl, float value, uint32_t tapDelay);
- float tHermiteDelay_addTo (tHermiteDelay* const dl, float value, uint32_t tapDelay);
- float tHermiteDelay_getDelay (tHermiteDelay* const dl);
- float tHermiteDelay_getLastOut (tHermiteDelay* const dl);
- float tHermiteDelay_getLastIn (tHermiteDelay* const dl);
- void tHermiteDelay_setGain (tHermiteDelay* const dl, float gain);
- float tHermiteDelay_getGain (tHermiteDelay* const dl);
-
-
+ void tHermiteDelay_clear (tHermiteDelay* const dl);
+ float tHermiteDelay_tick (tHermiteDelay* const dl, float input);
+ void tHermiteDelay_tickIn (tHermiteDelay* const dl, float input);
+ float tHermiteDelay_tickOut (tHermiteDelay* const dl);
+ int tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay);
+ float tHermiteDelay_tapOut (tHermiteDelay* const dl, uint32_t tapDelay);
+ void tHermiteDelay_tapIn (tHermiteDelay* const dl, float value, uint32_t tapDelay);
+ float tHermiteDelay_addTo (tHermiteDelay* const dl, float value, uint32_t tapDelay);
+ float tHermiteDelay_getDelay (tHermiteDelay* const dl);
+ float tHermiteDelay_getLastOut (tHermiteDelay* const dl);
+ float tHermiteDelay_getLastIn (tHermiteDelay* const dl);
+ void tHermiteDelay_setGain (tHermiteDelay* const dl, float gain);
+ float tHermiteDelay_getGain (tHermiteDelay* const dl);
+
+
//==============================================================================
- /* Allpass-interpolating delay, reimplemented from STK (Cook and Scavone). */
+ /*!
+ @defgroup tallpassdelay tAllpassDelay
+ @ingroup delay
+ @brief Allpass-interpolating delay, reimplemented from STK (Cook and Scavone).
+ @{
+ */
+
+ /*!
+ @fn void tAllpassDelay_init (tAllpassDelay* const, float delay, uint32_t maxDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAllpassDelay_initToPool (tAllpassDelay* const, float delay, uint32_t maxDelay, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAllpassDelay_free (tAllpassDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAllpassDelay_clear (tAllpassDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tAllpassDelay_setDelay (tAllpassDelay* const, float delay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tAllpassDelay_getDelay (tAllpassDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tAllpassDelay_tapIn (tAllpassDelay* const, float in, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tAllpassDelay_tapOut (tAllpassDelay* const, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tAllpassDelay_addTo (tAllpassDelay* const, float value, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tAllpassDelay_tick (tAllpassDelay* const, float sample)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tAllpassDelay_getLastOut (tAllpassDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tAllpassDelay_getLastIn (tAllpassDelay* const)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tAllpassDelay
{
tMempool mempool;
@@ -186,7 +542,93 @@
//==============================================================================
- /* Linear interpolating delay with fixed read and write pointers, variable rate. */
+ /*!
+ @defgroup ttapedelay tTapeDelay
+ @ingroup delay
+ @brief Linear interpolating delay with fixed read and write pointers, variable rate.
+ @{
+ */
+
+ /*!
+ @fn void tTapeDelay_init (tTapeDelay* const, float delay, uint32_t maxDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tTapeDelay_initToPool (tTapeDelay* const, float delay, uint32_t maxDelay, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tTapeDelay_free (tTapeDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tTapeDelay_clear (tTapeDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tTapeDelay_setDelay (tTapeDelay* const, float delay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tTapeDelay_getDelay (tTapeDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tTapeDelay_tapIn (tTapeDelay* const, float in, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tTapeDelay_tapOut (tTapeDelay* const d, float tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tTapeDelay_addTo (tTapeDelay* const, float value, uint32_t tapDelay)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tTapeDelay_tick (tTapeDelay* const, float sample)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tTapeDelay_incrementInPoint(tTapeDelay* const dl)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tTapeDelay_getLastOut (tTapeDelay* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tTapeDelay_getLastIn (tTapeDelay* const)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tTapeDelay
{
tMempool mempool;
@@ -232,4 +674,5 @@
#endif // LEAF_DELAY_H_INCLUDED
//==============================================================================
+
--- a/leaf/Inc/leaf-distortion.h
+++ b/leaf/Inc/leaf-distortion.h
@@ -29,6 +29,45 @@
//==============================================================================
+ /*!
+ @defgroup tsamplereducer tSampleReducer
+ @ingroup distortion
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tSampleReducer_init (tSampleReducer* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSampleReducer_initToPool (tSampleReducer* const, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSampleReducer_free (tSampleReducer* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tSampleReducer_tick (tSampleReducer* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tSampleReducer_setRatio (tSampleReducer* const, float ratio)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tSampleReducer
{
tMempool mempool;
@@ -44,12 +83,61 @@
void tSampleReducer_free (tSampleReducer* const);
float tSampleReducer_tick (tSampleReducer* const, float input);
-
- // sampling ratio
void tSampleReducer_setRatio (tSampleReducer* const, float ratio);
//==============================================================================
+ /*!
+ @defgroup toversampler tOversampler
+ @ingroup distortion
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tOversampler_init (tOversampler* const, int order, oBool extraQuality)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tOversampler_initToPool (tOversampler* const, int order, oBool extraQuality, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tOversampler_free (tOversampler* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tOversampler_upsample (tOversampler* const, float input, float* output)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tOversampler_downsample (tOversampler* const os, float* input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tOversampler_tick (tOversampler* const, float input, float* oversample, float (*effectTick)(float))
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tOversampler_getLatency (tOversampler* const os)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tOversampler
{
tMempool mempool;
@@ -74,8 +162,39 @@
//==============================================================================
- /* tLockhartWavefolder */
+ /*!
+ @defgroup tlockhartwavefolder tLockhartWavefolder
+ @ingroup distortion
+ @brief
+ @{
+ */
+ /*!
+ @fn void tLockhartWavefolder_init (tLockhartWavefolder* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLockhartWavefolder_initToPool (tLockhartWavefolder* const, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tLockhartWavefolder_free (tLockhartWavefolder* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tLockhartWavefolder_tick (tLockhartWavefolder* const, float samp)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tLockhartWavefolder
{
tMempool mempool;
@@ -117,6 +236,63 @@
//==============================================================================
+ /*!
+ @defgroup tcrusher tCrusher
+ @ingroup distortion
+ @brief
+ @{
+ */
+
+ /*!
+ @fn void tCrusher_init (tCrusher* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tCrusher_initToPool (tCrusher* const, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tCrusher_free (tCrusher* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tCrusher_tick (tCrusher* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tCrusher_setOperation (tCrusher* const, float op)
+ @brief
+ @param 0.0 - 1.0
+ */
+
+ /*!
+ @fn void tCrusher_setQuality (tCrusher* const, float val)
+ @brief
+ @param 0.0 - 1.0
+ */
+
+ /*!
+ @fn void tCrusher_setRound (tCrusher* const, float rnd)
+ @brief
+ @param what division to round to
+ */
+
+ /*!
+ @fn void tCrusher_setSamplingRatio (tCrusher* const, float ratio)
+ @brief
+ @param sampling ratio
+ */
+
+ /*! @} */
+
typedef struct _tCrusher
{
tMempool mempool;
@@ -139,21 +315,12 @@
void tCrusher_free (tCrusher* const);
float tCrusher_tick (tCrusher* const, float input);
-
- // 0.0 - 1.0
void tCrusher_setOperation (tCrusher* const, float op);
-
- // 0.0 - 1.0
void tCrusher_setQuality (tCrusher* const, float val);
-
- // what division to round to
void tCrusher_setRound (tCrusher* const, float rnd);
-
- // sampling ratio
void tCrusher_setSamplingRatio (tCrusher* const, float ratio);
//==============================================================================
-
#ifdef __cplusplus
}
--- a/leaf/Inc/leaf-dynamics.h
+++ b/leaf/Inc/leaf-dynamics.h
@@ -31,9 +31,39 @@
//==============================================================================
- // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+ /*!
+ @defgroup tcompressor tCompressor
+ @ingroup dynamics
+ @brief
+ @{
+ */
- /* Compressor */
+ /*!
+ @fn void tCompressor_init (tCompressor* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tCompressor_initToPool (tCompressor* const, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tCompressor_free (tCompressor* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tCompressor_tick (tCompressor* const, float input)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tCompressor
{
tMempool mempool;
@@ -55,14 +85,71 @@
float tCompressor_tick (tCompressor* const, float input);
- ///
- /* Feedback leveller */
- // An auto VCA that you put into a feedback circuit to make it stay at the same level.
- // It can enforce level bidirectionally (amplifying and attenuating as needed) or
- // just attenutating. The former option allows for infinite sustain strings, for example, while
- // The latter option allows for decaying strings, which can never exceed
- // a specific level.
+ /*!
+ @defgroup tfeedbackleveler tFeedbackLeveler
+ @ingroup dynamics
+ @brief
+ @detail An auto VCA that you put into a feedback circuit to make it stay at the same level. It can enforce level bidirectionally (amplifying and attenuating as needed) or just attenutating. The former option allows for infinite sustain strings, for example, while The latter option allows for decaying strings, which can never exceed a specific level.
+ @{
+ */
+
+ /*!
+ @fn void tFeedbackLeveler_init (tFeedbackLeveler* const, float targetLevel, float factor, float strength, int mode)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tFeedbackLeveler_initToPool (tFeedbackLeveler* const, float targetLevel, float factor, float strength, int mode, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tFeedbackLeveler_free (tFeedbackLeveler* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tFeedbackLeveler_tick (tFeedbackLeveler* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn float tFeedbackLeveler_sample (tFeedbackLeveler* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tFeedbackLeveler_setTargetLevel (tFeedbackLeveler* const, float TargetLevel)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tFeedbackLeveler_setFactor (tFeedbackLeveler* const, float factor)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tFeedbackLeveler_setMode (tFeedbackLeveler* const, int mode)
+ @brief
+ @param
+ */ // 0 for upwards limiting only, 1 for biderctional limiting
+
+ /*!
+ @fn void tFeedbackLeveler_setStrength (tFeedbackLeveler* const, float strength)
+ @brief
+ @param
+ */
+
+ /*! @} */
+
typedef struct _tFeedbackLeveler
{
tMempool mempool;
@@ -91,7 +178,50 @@
//==============================================================================
- //Threshold with hysteresis (like Max/MSP thresh~ object)
+ /*!
+ @defgroup tthreshold tThreshold
+ @ingroup dynamics
+ @brief Threshold with hysteresis (like Max/MSP thresh~ object)
+ @{
+ */
+
+ /*!
+ @fn void tThreshold_init (tThreshold* const, float low, float high)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tThreshold_initToPool (tThreshold* const, float low, float high, tMempool* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tThreshold_free (tThreshold* const)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn int tThreshold_tick (tThreshold* const, float input)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tThreshold_setLow (tThreshold* const, float low)
+ @brief
+ @param
+ */
+
+ /*!
+ @fn void tThreshold_setHigh (tThreshold* const, float high)
+ @brief
+ @param
+ */
+
+ /*! @} */
typedef struct _tThreshold
{