Unified · Split
| @@ -37,7 +37,7 @@ tPitchDetector detector; · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | tPeriodDetection pd; |
| 39 | 39 | |
| 40 | −tZeroCrossing zc; | |
| 40 | +tZeroCrossingCounter zc; | |
| 41 | 41 | tEnvelopeFollower ef; |
| 42 | 42 | |
| 43 | 43 | float gain; |
| @@ -69,7 +69,7 @@ void LEAFTest_init (float sampleRate, int blockSize) · 25 unmodified lines | ||
| 69 | 69 | |
| 70 | 70 | tPeriodDetection_init(&pd, bufIn, bufOut, 4096, 1024); |
| 71 | 71 | |
| 72 | − tZeroCrossing_init(&zc, 128); | |
| 72 | + tZeroCrossingCounter_init(&zc, 128); | |
| 73 | 73 | tEnvelopeFollower_init(&ef, 0.02f, 0.9999f); |
| 74 | 74 | } |
| 75 | 75 | |
| @@ -107,7 +107,7 @@ float LEAFTest_tick (float input) · 31 unmodified lines | ||
| 107 | 107 | freq = altFreq; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | − if (tZeroCrossing_tick(&zc, input) < 0.05 && freq > 0.0f) | |
| 110 | + if (tZeroCrossingCounter_tick(&zc, input) < 0.05 && freq > 0.0f) | |
| 111 | 111 | { |
| 112 | 112 | tMBTriangle_setFreq(&btri, freq); |
| 113 | 113 | } |
| @@ -35,32 +35,40 @@ extern "C" { · 34 unmodified lines | ||
| 35 | 35 | /*! |
| 36 | 36 | @defgroup tenvelopefollower tEnvelopeFollower |
| 37 | 37 | @ingroup analysis |
| 38 | − @brief | |
| 38 | + @brief Detects and returns the basic envelope of incoming audio data. | |
| 39 | 39 | @{ |
| 40 | 40 | |
| 41 | − @fn void tEnvelopeFollower_init (tEnvelopeFollower* const, float attackThreshold, float decayCoeff) | |
| 42 | − @brief | |
| 43 | − @param | |
| 44 | − | |
| 45 | − @fn void tEnvelopeFollower_initToPool (tEnvelopeFollower* const, float attackThreshold, float decayCoeff, tMempool* const) | |
| 46 | − @brief | |
| 47 | − @param | |
| 48 | − | |
| 49 | − @fn void tEnvelopeFollower_free (tEnvelopeFollower* const) | |
| 50 | − @brief | |
| 51 | − @param | |
| 52 | − | |
| 53 | − @fn float tEnvelopeFollower_tick (tEnvelopeFollower* const, float x) | |
| 54 | − @brief | |
| 55 | − @param | |
| 56 | − | |
| 57 | − @fn int tEnvelopeFollower_decayCoeff (tEnvelopeFollower* const, float decayCoeff) | |
| 58 | − @brief | |
| 59 | − @param | |
| 60 | − | |
| 61 | − @fn int tEnvelopeFollower_attackThresh (tEnvelopeFollower* const, float attackThresh) | |
| 62 | − @brief | |
| 63 | − @param | |
| 41 | + @fn void tEnvelopeFollower_init (tEnvelopeFollower* const follower, float attackThreshold, float decayCoeff) | |
| 42 | + @brief Initialize a tEnvelopeFollower to the default LEAF mempool. | |
| 43 | + @param follower A pointer to the tEnvelopeFollower to be initialized. | |
| 44 | + @param attackThreshold Amplitude threshold for determining an envelope onset. 0.0 to 1.0 | |
| 45 | + @param decayCoefficient Multiplier to determine the envelope rate of decay. 0.0 to 1.0, above 0.95 recommended. | |
| 46 | + | |
| 47 | + @fn void tEnvelopeFollower_initToPool (tEnvelopeFollower* const follower, float attackThreshold, float decayCoeff, tMempool* const mempool) | |
| 48 | + @brief Initialize a tEnvelopeFollower to a specified mempool. | |
| 49 | + @param follower A pointer to the tEnvelopeFollower to be initialized. | |
| 50 | + @param attackThreshold Amplitude threshold for determining an envelope onset. 0.0 to 1.0 | |
| 51 | + @param decayCoefficient Multiplier to determine the envelope rate of decay. 0.0 to 1.0, above 0.95 recommended. | |
| 52 | + @param mempool A pointer to the tMempool to which the tEnvelopeFollower should be initialized. | |
| 53 | + | |
| 54 | + @fn void tEnvelopeFollower_free (tEnvelopeFollower* const follower) | |
| 55 | + @brief Free a tEnvelopeFollower from its mempool. | |
| 56 | + @param follower A pointer to the tEnvelopeFollower to be freed. | |
| 57 | + | |
| 58 | + @fn float tEnvelopeFollower_tick (tEnvelopeFollower* const follower, float input) | |
| 59 | + @brief Tick the tEnvelopeFollower. | |
| 60 | + @param follower A pointer to the relevant tEnvelopeFollower. | |
| 61 | + @param input The input sample. | |
| 62 | + @return The envelope value. | |
| 63 | + | |
| 64 | + @fn void tEnvelopeFollower_setDecayCoefficient (tEnvelopeFollower* const follower, float decayCoeff) | |
| 65 | + @brief Set the envelope decay coefficient. | |
| 66 | + @param follower A pointer to the relevant tEnvelopeFollower. | |
| 67 | + @param decayCoefficient Multiplier to determine the envelope rate of decay. 0.0 to 1.0, above 0.95 recommended. | |
| 68 | + | |
| 69 | + @fn void tEnvelopeFollower_setAttackThreshold (tEnvelopeFollower* const follower, float attackThresh) | |
| 70 | + @brief Set the envelope attack threshold. | |
| 71 | + @param follower A pointer to the relevant tEnvelopeFollower. | |
| 64 | 72 |  |
| 65 | 73 | @} */ |
| 66 | 74 | |
| @@ -75,46 +83,50 @@ extern "C" { · 8 unmodified lines | ||
| 75 | 83 | |
| 76 | 84 | typedef _tEnvelopeFollower* tEnvelopeFollower; |
| 77 | 85 | |
| 78 | − void tEnvelopeFollower_init (tEnvelopeFollower* const, float attackThreshold, float decayCoeff); | |
| 79 | − void tEnvelopeFollower_initToPool (tEnvelopeFollower* const, float attackThreshold, float decayCoeff, tMempool* const); | |
| 80 | − void tEnvelopeFollower_free (tEnvelopeFollower* const); | |
| 81 | − | |
| 82 | − float tEnvelopeFollower_tick (tEnvelopeFollower* const, float x); | |
| 83 | − int tEnvelopeFollower_decayCoeff (tEnvelopeFollower* const, float decayCoeff); | |
| 84 | − int tEnvelopeFollower_attackThresh (tEnvelopeFollower* const, float attackThresh); | |
| 86 | + void tEnvelopeFollower_init (tEnvelopeFollower* const follower, float attackThreshold, float decayCoefficient); | |
| 87 | + void tEnvelopeFollower_initToPool (tEnvelopeFollower* const follower, float attackThreshold, float decayCoefficient, tMempool* const mempool); | |
| 88 | + void tEnvelopeFollower_free (tEnvelopeFollower* const follower); | |
| 85 | 89 | |
| 86 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 90 | + float tEnvelopeFollower_tick (tEnvelopeFollower* const follower, float sample); | |
| 91 | + void tEnvelopeFollower_setDecayCoefficient (tEnvelopeFollower* const follower, float decayCoefficient); | |
| 92 | + void tEnvelopeFollower_setAttackThreshold (tEnvelopeFollower* const follower, float attackThreshold); | |
| 87 | 93 | |
| 88 | 94 | /*! |
| 89 | − @defgroup tzerocrossing tZeroCrossing | |
| 95 | + @defgroup tzerocrossingcounter tZeroCrossingCounter | |
| 90 | 96 | @ingroup analysis |
| 91 | − @brief | |
| 97 | + @brief Counts the amount of zero crossings within a window of the input audio data | |
| 92 | 98 | @{ |
| 93 | 99 | |
| 94 | − @fn void tZeroCrossing_init (tZeroCrossing* const, int maxWindowSize) | |
| 95 | − @brief | |
| 96 | − @param | |
| 97 | − | |
| 98 | − @fn void tZeroCrossing_initToPool (tZeroCrossing* const, int maxWindowSize, tMempool* const) | |
| 99 | − @brief | |
| 100 | − @param | |
| 101 | − | |
| 102 | − @fn void tZeroCrossing_free (tZeroCrossing* const) | |
| 103 | − @brief | |
| 104 | − @param | |
| 105 | − | |
| 106 | − @fn float tZeroCrossing_tick (tZeroCrossing* const, float input) | |
| 107 | − @brief | |
| 108 | − @param | |
| 109 | − | |
| 110 | − @fn void tZeroCrossing_setWindow (tZeroCrossing* const, float windowSize) | |
| 111 | − @brief | |
| 112 | − @param | |
| 100 | + @fn void tZeroCrossingCounter_init (tZeroCrossingCounter* const counter, int maxWindowSize) | |
| 101 | + @brief Initialize a tZeroCrossingCounter to the default LEAF mempool. | |
| 102 | + @param counter A pointer to the tZeroCrossingCounter to be initialized. | |
| 103 | + @param maxWindowSize The max and initial size of the window. | |
| 104 | + | |
| 105 | + @fn void tZeroCrossingCounter_initToPool (tZeroCrossingCounter* const counter, int maxWindowSize, tMempool* const mempool) | |
| 106 | + @brief Initialize a tZeroCrossingCounter to a specified mempool. | |
| 107 | + @param counter A pointer to the tZeroCrossingCounter to be initialized. | |
| 108 | + @param maxWindowSize The max and initial size of the window. | |
| 109 | + @param mempool A pointer to the tMempool to which the tZeroCrossingCounter should be initialized. | |
| 110 | + | |
| 111 | + @fn void tZeroCrossingCounter_free (tZeroCrossingCounter* const counter) | |
| 112 | + @brief Free a tZeroCrossingCounter from its mempool. | |
| 113 | + @param counter A pointer to the tZeroCrossingCounter to be freed. | |
| 114 | + | |
| 115 | + @fn float tZeroCrossingCounter_tick (tZeroCrossingCounter* const counter, float input) | |
| 116 | + @brief Tick the tZeroCrossingCounter. | |
| 117 | + @param counter A pointer to the relevant tZeroCrossingCounter. | |
| 118 | + @param input The input sample. | |
| 119 | + @return The amount of zero crossings as a proportion of the window. | |
| 120 | + | |
| 121 | + @fn void tZeroCrossingCounter_setWindowSize (tZeroCrossingCounter* const counter, float windowSize) | |
| 122 | + @brief Set the size of the window. Cannot be greater than the max size given on initialization. | |
| 123 | + @param counter A pointer to the relevant tZeroCrossingCounter. | |
| 124 | + @param windowSize The new window size. | |
| 113 | 125 |  |
| 114 | 126 | @} */ |
| 115 | 127 | |
| 116 | 128 | /* Zero Crossing Detector */ |
| 117 | − typedef struct _tZeroCrossing { | |
| 129 | + typedef struct _tZeroCrossingCounter { | |
| 118 | 130 | tMempool mempool; |
| 119 | 131 | int count; |
| 120 | 132 | int maxWindowSize; |
| @@ -124,16 +136,16 @@ extern "C" { · 3 unmodified lines | ||
| 124 | 136 | uint16_t* countBuffer; |
| 125 | 137 | int prevPosition; |
| 126 | 138 | int position; |
| 127 | − } _tZeroCrossing; | |
| 139 | + } _tZeroCrossingCounter; | |
| 128 | 140 | |
| 129 | − typedef _tZeroCrossing* tZeroCrossing; | |
| 141 | + typedef _tZeroCrossingCounter* tZeroCrossingCounter; | |
| 130 | 142 | |
| 131 | − void tZeroCrossing_init (tZeroCrossing* const, int maxWindowSize); | |
| 132 | − void tZeroCrossing_initToPool (tZeroCrossing* const, int maxWindowSize, tMempool* const); | |
| 133 | − void tZeroCrossing_free (tZeroCrossing* const); | |
| 143 | + void tZeroCrossingCounter_init (tZeroCrossingCounter* const, int maxWindowSize); | |
| 144 | + void tZeroCrossingCounter_initToPool (tZeroCrossingCounter* const, int maxWindowSize, tMempool* const mempool); | |
| 145 | + void tZeroCrossingCounter_free (tZeroCrossingCounter* const); | |
| 134 | 146 | |
| 135 | − float tZeroCrossing_tick (tZeroCrossing* const, float input); | |
| 136 | − void tZeroCrossing_setWindow (tZeroCrossing* const, float windowSize); | |
| 147 | + float tZeroCrossingCounter_tick (tZeroCrossingCounter* const, float input); | |
| 148 | + void tZeroCrossingCounter_setWindowSize (tZeroCrossingCounter* const, float windowSize); | |
| 137 | 149 | |
| 138 | 150 | // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ |
| 139 | 151 | |
| @@ -144,11 +156,11 @@ extern "C" { · 4 unmodified lines | ||
| 144 | 156 | @{ |
| 145 | 157 | |
| 146 | 158 | @fn void tPowerFollower_init (tPowerFollower* const, float factor) |
| 147 | − @brief | |
| 159 | + @brief Initialize a tPowerFollower to the default LEAF mempool. | |
| 148 | 160 | @param |
| 149 | 161 | |
| 150 | 162 | @fn void tPowerFollower_initToPool (tPowerFollower* const, float factor, tMempool* const) |
| 151 | − @brief | |
| 163 | + @brief Initialize a tPowerFollower to a specified mempool. | |
| 152 | 164 | @param |
| 153 | 165 | |
| 154 | 166 | @fn void tPowerFollower_free (tPowerFollower* const) |
| @@ -193,15 +205,15 @@ extern "C" { · 38 unmodified lines | ||
| 193 | 205 | /*! |
| 194 | 206 | @defgroup tenvpd tEnvPD |
| 195 | 207 | @ingroup analysis |
| 196 | − @brief | |
| 208 | + @brief ENV~ from PD, modified for LEAF | |
| 197 | 209 | @{ |
| 198 | 210 | |
| 199 | 211 | @fn void tEnvPD_init (tEnvPD* const, int windowSize, int hopSize, int blockSize) |
| 200 | − @brief | |
| 212 | + @brief Initialize a tEnvPD to the default LEAF mempool. | |
| 201 | 213 | @param |
| 202 | 214 | |
| 203 | 215 | @fn void tEnvPD_initToPool (tEnvPD* const, int windowSize, int hopSize, int blockSize, tMempool* const) |
| 204 | − @brief | |
| 216 | + @brief Initialize a tEnvPD to a specified mempool. | |
| 205 | 217 | @param |
| 206 | 218 | |
| 207 | 219 | @fn void tEnvPD_free (tEnvPD* const) |
| @@ -218,7 +230,6 @@ extern "C" { · 10 unmodified lines | ||
| 218 | 230 |  |
| 219 | 231 | @} */ |
| 220 | 232 | |
| 221 | − // ENV~ from PD, modified for LEAF | |
| 222 | 233 | #define MAXOVERLAP 32 |
| 223 | 234 | #define INITVSTAKEN 64 |
| 224 | 235 | #define ENV_WINDOW_SIZE 1024 |
| @@ -257,11 +268,11 @@ extern "C" { · 32 unmodified lines | ||
| 257 | 268 | @{ |
| 258 | 269 | |
| 259 | 270 | @fn void tAttackDetection_init (tAttackDetection* const, int blocksize, int atk, int rel) |
| 260 | − @brief | |
| 271 | + @brief Initialize a tAttackDetection to the default LEAF mempool. | |
| 261 | 272 | @param |
| 262 | 273 | |
| 263 | 274 | @fn void tAttackDetection_initToPool (tAttackDetection* const, int blocksize, int atk, int rel, tMempool* const) |
| 264 | − @brief | |
| 275 | + @brief Initialize a tAttackDetection to a specified mempool. | |
| 265 | 276 | @param |
| 266 | 277 | |
| 267 | 278 | @fn void tAttackDetection_free (tAttackDetection* const) |
| @@ -344,11 +355,11 @@ extern "C" { · 76 unmodified lines | ||
| 344 | 355 | @{ |
| 345 | 356 | |
| 346 | 357 | @fn void tSNAC_init (tSNAC* const, int overlaparg) |
| 347 | − @brief | |
| 358 | + @brief Initialize a tSNAC to the default LEAF mempool. | |
| 348 | 359 | @param |
| 349 | 360 | |
| 350 | 361 | @fn void tSNAC_initToPool (tSNAC* const, int overlaparg, tMempool* const) |
| 351 | − @brief | |
| 362 | + @brief Initialize a tSNAC to a specified mempool. | |
| 352 | 363 | @param |
| 353 | 364 | |
| 354 | 365 | @fn void tSNAC_free (tSNAC* const) |
| @@ -433,11 +444,11 @@ extern "C" { · 78 unmodified lines | ||
| 433 | 444 | |
| 434 | 445 | /*! |
| 435 | 446 | @fn void tPeriodDetection_init (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize) |
| 436 | − @brief | |
| 447 | + @brief Initialize a tPeriodDetection to the default LEAF mempool. | |
| 437 | 448 | @param |
| 438 | 449 | |
| 439 | − @fn void tPeriodDetection_initToPool (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize, tMempool* const) | |
| 440 | − @brief | |
| 450 | + @fn void tPeriodDetection_initToPool (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize, tMempool* const) | |
| 451 | + @brief Initialize a tPeriodDetection to a specified mempool. | |
| 441 | 452 | @param |
| 442 | 453 | |
| 443 | 454 | @fn void tPeriodDetection_free (tPeriodDetection* const) |
| @@ -664,11 +675,11 @@ extern "C" { · 220 unmodified lines | ||
| 664 | 675 | @{ |
| 665 | 676 | |
| 666 | 677 | @fn void tPeriodDetector_init (tPeriodDetector* const detector, float lowestFreq, float highestFreq, float hysteresis) |
| 667 | − @brief | |
| 678 | + @brief Initialize a tPeriodDetector to the default LEAF mempool. | |
| 668 | 679 | @param |
| 669 | 680 | |
| 670 | 681 | @fn void tPeriodDetector_initToPool (tPeriodDetector* const detector, float lowestFreq, float highestFreq, float hysteresis, tMempool* const mempool) |
| 671 | − @brief | |
| 682 | + @brief Initialize a tPeriodDetector to a specified mempool. | |
| 672 | 683 | @param |
| 673 | 684 | |
| 674 | 685 | @fn void tPeriodDetector_free (tPeriodDetector* const detector) |
| @@ -774,11 +785,11 @@ extern "C" { · 99 unmodified lines | ||
| 774 | 785 | @{ |
| 775 | 786 | |
| 776 | 787 | @fn void tPitchDetector_init (tPitchDetector* const detector, float lowestFreq, float highestFreq, float hysteresis) |
| 777 | − @brief | |
| 788 | + @brief Initialize a tPitchDetector to the default LEAF mempool. | |
| 778 | 789 | @param |
| 779 | 790 | |
| 780 | 791 | @fn void tPitchDetector_initToPool (tPitchDetector* const detector, float lowestFreq, float highestFreq, float hysteresis, tMempool* const mempool) |
| 781 | − @brief | |
| 792 | + @brief Initialize a tPitchDetector to a specified mempool. | |
| 782 | 793 | @param |
| 783 | 794 | |
| 784 | 795 | @fn void tPitchDetector_free (tPitchDetector* const detector) |
| @@ -37,7 +37,7 @@ extern "C" { · 36 unmodified lines | ||
| 37 | 37 | /*! |
| 38 | 38 | @defgroup tenvelope tEnvelope |
| 39 | 39 | @ingroup envelopes |
| 40 | − @brief Attack-decay envelope. | |
| 40 | + @brief Basic attack-decay envelope. | |
| 41 | 41 | @{ |
| 42 | 42 | |
| 43 | 43 | @fn void tEnvelope_init (tEnvelope* const, float attack, float decay, int loop) |
| @@ -96,7 +96,7 @@ extern "C" { · 95 unmodified lines | ||
| 96 | 96 | void tMempool_init (tMempool* const pool, char* memory, size_t size); |
| 97 | 97 | |
| 98 | 98 | |
| 99 | − //! Free a tMempool from the default LEAF mempool. | |
| 99 | + //! Free a tMempool from its mempool. | |
| 100 | 100 | /*! |
| 101 | 101 | @param pool A pointer to the tMempool to be freed. |
| 102 | 102 | */ |
| @@ -115,7 +115,7 @@ extern "C" { · 12 unmodified lines | ||
| 115 | 115 | |
| 116 | 116 | //! Free a tMempool from a specified mempool. |
| 117 | 117 | /*! |
| 118 | − @param pool A pointer to the tMempool to be freed from the default LEAF mempool. | |
| 118 | + @param pool A pointer to the tMempool to be freed from its mempool. | |
| 119 | 119 | @param poolFrom A pointer to the tMempool from which a tMempool should be freed. |
| 120 | 120 | */ |
| 121 | 121 | void tMempool_freeFromPool (tMempool* const pool, tMempool* const poolFrom); |
| @@ -48,7 +48,7 @@ extern "C" { · 47 unmodified lines | ||
| 48 | 48 | @param mempool A pointer to the tMempool to which the tStack should be initialized. |
| 49 | 49 | |
| 50 | 50 | @fn void tStack_free (tStack* const stack) |
| 51 | − @brief Free a tStack from the default LEAF mempool. | |
| 51 | + @brief Free a tStack from its mempool. | |
| 52 | 52 | @param stack A pointer to the tStack to be freed. |
| 53 | 53 | |
| 54 | 54 | @fn void tStack_setCapacity (tStack* const stack, uint16_t cap) |
| @@ -149,7 +149,7 @@ extern "C" { · 94 unmodified lines | ||
| 149 | 149 | @param pool A pointer to the tMempool to which the tPoly should be initialized. |
| 150 | 150 | |
| 151 | 151 | @fn void tPoly_free (tPoly* const poly) |
| 152 | − @brief Free a tPoly from the default LEAF mempool. | |
| 152 | + @brief Free a tPoly from its mempool. | |
| 153 | 153 | @param poly A pointer to the tPoly to be freed. |
| 154 | 154 | |
| 155 | 155 | @fn int tPoly_noteOn (tPoly* const poly, int note, uint8_t vel) |
| @@ -315,29 +315,29 @@ extern "C" { · 159 unmodified lines | ||
| 315 | 315 | @{ |
| 316 | 316 | |
| 317 | 317 | @fn void tSimplePoly_init (tSimplePoly* const poly, int maxNumVoices) |
| 318 | − @brief Initialize a tPoly to the default LEAF mempool. | |
| 319 | − @param poly A pointer to the tPoly to be initialized. | |
| 320 | − @param maxNumVoices The maximum number of voices this tPoly can handle at once. | |
| 318 | + @brief Initialize a tSimplePoly to the default LEAF mempool. | |
| 319 | + @param poly A pointer to the tSimplePoly to be initialized. | |
| 320 | + @param maxNumVoices The maximum number of voices this tSimplePoly can handle at once. | |
| 321 | 321 | |
| 322 | 322 | @fn void tSimplePoly_initToPool (tSimplePoly* const poly, int maxNumVoices, tMempool* const pool) |
| 323 | − @brief Initialize a tPoly to a specified mempool. | |
| 324 | − @param poly A pointer to the tPoly to be initialized. | |
| 325 | − @param pool A pointer to the tMempool to which the tPoly should be initialized. | |
| 323 | + @brief Initialize a tSimplePoly to a specified mempool. | |
| 324 | + @param poly A pointer to the tSimplePoly to be initialized. | |
| 325 | + @param pool A pointer to the tMempool to which the tSimplePoly should be initialized. | |
| 326 | 326 | |
| 327 | 327 | @fn void tSimplePoly_free (tSimplePoly* const poly) |
| 328 | − @brief Free a tPoly from the default LEAF mempool. | |
| 329 | − @param poly A pointer to the tPoly to be freed. | |
| 328 | + @brief Free a tSimplePoly from its mempool. | |
| 329 | + @param poly A pointer to the tSimplePoly to be freed. | |
| 330 | 330 | |
| 331 | 331 | @fn int tSimplePoly_noteOn (tSimplePoly* const poly, int note, uint8_t vel) |
| 332 | 332 | @brief Add a note with a given velocity to the poly handler. |
| 333 | − @param poly A pointer to the relevant tPoly. | |
| 333 | + @param poly A pointer to the relevant tSimplePoly. | |
| 334 | 334 | @param note The MIDI note number to add. |
| 335 | 335 | @param vel The MIDI velocity of the note to add. |
| 336 | 336 | @return The voice that will play the note. |
| 337 | 337 | |
| 338 | 338 | @fn int tSimplePoly_noteOff (tSimplePoly* const poly, uint8_t note) |
| 339 | 339 | @brief Remove a note from the poly handler. |
| 340 | − @param poly A pointer to the relevant tPoly. | |
| 340 | + @param poly A pointer to the relevant tSimplePoly. | |
| 341 | 341 | @param note The MIDI note number to remove. |
| 342 | 342 | @return The voice that was playing the removed note. |
| 343 | 343 | |
| @@ -355,22 +355,22 @@ extern "C" { · 11 unmodified lines | ||
| 355 | 355 | |
| 356 | 356 | @fn void tSimplePoly_setNumVoices (tSimplePoly* const poly, uint8_t numVoices) |
| 357 | 357 | @brief Set the number of voices available to play notes. |
| 358 | − @param poly A pointer to the relevant tPoly. | |
| 359 | − @param numVoices The new number of available voices. Cannot be greater than the max number voices given in tPoly_init(). | |
| 358 | + @param poly A pointer to the relevant tSimplePoly. | |
| 359 | + @param numVoices The new number of available voices. Cannot be greater than the max number voices given on initialization. | |
| 360 | 360 | |
| 361 | 361 | @fn int tSimplePoly_getNumVoices (tSimplePoly* const poly) |
| 362 | 362 | @brief Get the current number of voices available to play notes. |
| 363 | − @param poly A pointer to the relevant tPoly. | |
| 363 | + @param poly A pointer to the relevant tSimplePoly. | |
| 364 | 364 | @return The current number of voices available to play notes. |
| 365 | 365 | |
| 366 | 366 | @fn int tSimplePoly_getNumActiveVoices (tSimplePoly* const poly) |
| 367 | 367 | @brief Get the number of voices currently playing notes. |
| 368 | − @param poly A pointer to the relevant tPoly. | |
| 368 | + @param poly A pointer to the relevant tSimplePoly. | |
| 369 | 369 | @return The number of voices currently playing notes. |
| 370 | 370 | |
| 371 | 371 | @fn int tSimplePoly_getPitch (tSimplePoly* const poly, uint8_t voice) |
| 372 | 372 | @brief Get the current MIDI note number of a given voice. |
| 373 | − @param poly A pointer to the relevant tPoly. | |
| 373 | + @param poly A pointer to the relevant tSimplePoly. | |
| 374 | 374 | @param voice The voice to get the MIDI note number of. |
| 375 | 375 | @return The MIDI note number of the given voice. |
| 376 | 376 | |
| @@ -379,13 +379,13 @@ extern "C" { · 2 unmodified lines | ||
| 379 | 379 | |
| 380 | 380 | @fn int tSimplePoly_getVelocity (tSimplePoly* const poly, uint8_t voice) |
| 381 | 381 | @brief Get the current MIDI velocity of a given voice. |
| 382 | − @param poly A pointer to the relevant tPoly. | |
| 382 | + @param poly A pointer to the relevant tSimplePoly. | |
| 383 | 383 | @param voice The voice to get the MIDI velocity of. |
| 384 | 384 | @return The current MIDI velocity of the given voice. |
| 385 | 385 | |
| 386 | 386 | @fn int tSimplePoly_isOn (tSimplePoly* const poly, uint8_t voice) |
| 387 | 387 | @brief Get the current play state of a given voice. |
| 388 | − @param poly A pointer to the relevant tPoly. | |
| 388 | + @param poly A pointer to the relevant tSimplePoly. | |
| 389 | 389 | @param voice The voice to get the state of. |
| 390 | 390 | @return The current play state of the given voice. |
| 391 | 391 | |
| @@ -34,17 +34,21 @@ extern "C" { · 33 unmodified lines | ||
| 34 | 34 | @brief A general wavetable oscillator. |
| 35 | 35 | @{ |
| 36 | 36 | |
| 37 | − @fn void tTable_init (tTable* const osc, float* waveTable, int size) | |
| 37 | + @fn void tTable_init (tTable* const osc, float* table, int size) | |
| 38 | 38 | @brief Initialize a tTable to the default LEAF mempool. |
| 39 | 39 | @param osc A pointer to the tTable to be initialized. |
| 40 | + @param table A pointer to the wave table data. | |
| 41 | + @param size The number of samples in the wave table. | |
| 40 | 42 | |
| 41 | − @fn void tTable_initToPool (tTable* const osc, float* waveTable, int size, tMempool* const mempool) | |
| 43 | + @fn void tTable_initToPool (tTable* const osc, float* table, int size, tMempool* const mempool) | |
| 42 | 44 | @brief Initialize a tTable to a specified mempool. |
| 43 | 45 | @param osc A pointer to the tTable to be initialized. |
| 44 | − @param pool A pointer to the tMempool to which the tTable should be initialized. | |
| 46 | + @param table A pointer to the wave table data. | |
| 47 | + @param size The number of samples in the wave table. | |
| 48 | + @param mempool A pointer to the tMempool to which the tTable should be initialized. | |
| 45 | 49 | |
| 46 | 50 | @fn void tTable_free (tTable* const osc) |
| 47 | − @brief Free a tTable from the default LEAF mempool. | |
| 51 | + @brief Free a tTable from its mempool. | |
| 48 | 52 | @param osc A pointer to the tTable to be freed. |
| 49 | 53 | |
| 50 | 54 | @fn float tTable_tick (tTable* const osc) |
| @@ -71,8 +75,8 @@ extern "C" { · 20 unmodified lines | ||
| 71 | 75 | |
| 72 | 76 | typedef _tTable* tTable; |
| 73 | 77 | |
| 74 | − void tTable_init(tTable* const osc, float* waveTable, int size); | |
| 75 | − void tTable_initToPool(tTable* const osc, float* waveTable, int size, tMempool* const mempool); | |
| 78 | + void tTable_init(tTable* const osc, float* table, int size); | |
| 79 | + void tTable_initToPool(tTable* const osc, float* table, int size, tMempool* const mempool); | |
| 76 | 80 | void tTable_free(tTable* const osc); |
| 77 | 81 | |
| 78 | 82 | float tTable_tick(tTable* const osc); |
| @@ -90,13 +94,13 @@ extern "C" { · 11 unmodified lines | ||
| 90 | 94 | @brief Initialize a tCycle to the default LEAF mempool. |
| 91 | 95 | @param osc A pointer to the tCycle to be initialized. |
| 92 | 96 | |
| 93 | − @fn void tCycle_initToPool (tCycle* const osc, tMempool* const pool) | |
| 97 | + @fn void tCycle_initToPool (tCycle* const osc, tMempool* const mempool) | |
| 94 | 98 | @brief Initialize a tCycle to a specified mempool. |
| 95 | 99 | @param osc A pointer to the tCycle to be initialized. |
| 96 | − @param pool A pointer to the tMempool to which the tCycle should be initialized. | |
| 100 | + @param mempool A pointer to the tMempool to which the tCycle should be initialized. | |
| 97 | 101 | |
| 98 | 102 | @fn void tCycle_free (tCycle* const osc) |
| 99 | − @brief Free a tCycle from the default LEAF mempool. | |
| 103 | + @brief Free a tCycle from its mempool. | |
| 100 | 104 | @param osc A pointer to the tCycle to be freed. |
| 101 | 105 | |
| 102 | 106 | @fn float tCycle_tick (tCycle* const osc) |
| @@ -123,7 +127,7 @@ extern "C" { · 20 unmodified lines | ||
| 123 | 127 | typedef _tCycle* tCycle; |
| 124 | 128 | |
| 125 | 129 | void tCycle_init (tCycle* const osc); |
| 126 | − void tCycle_initToPool (tCycle* const osc, tMempool* const pool); | |
| 130 | + void tCycle_initToPool (tCycle* const osc, tMempool* const mempool); | |
| 127 | 131 | void tCycle_free (tCycle* const osc); |
| 128 | 132 | |
| 129 | 133 | float tCycle_tick (tCycle* const osc); |
| @@ -141,13 +145,13 @@ extern "C" { · 11 unmodified lines | ||
| 141 | 145 | @brief Initialize a tTriangle to the default LEAF mempool. |
| 142 | 146 | @param osc A pointer to the tTriangle to be initialized. |
| 143 | 147 | |
| 144 | − @fn void tTriangle_initToPool (tTriangle* const osc, tMempool* const pool) | |
| 148 | + @fn void tTriangle_initToPool (tTriangle* const osc, tMempool* const mempool) | |
| 145 | 149 | @brief Initialize a tTriangle to a specified mempool. |
| 146 | 150 | @param osc A pointer to the tTriangle to be initialized. |
| 147 | − @param pool A pointer to the tMempool to which the tTriangle should be initialized. | |
| 151 | + @param mempool A pointer to the tMempool to which the tTriangle should be initialized. | |
| 148 | 152 | |
| 149 | 153 | @fn void tTriangle_free (tTriangle* const osc) |
| 150 | − @brief Free a tTriangle from the default LEAF mempool. | |
| 154 | + @brief Free a tTriangle from its mempool. | |
| 151 | 155 | @param osc A pointer to the tTriangle to be freed. |
| 152 | 156 | |
| 153 | 157 | @fn float tTriangle_tick (tTriangle* const osc) |
| @@ -175,7 +179,7 @@ extern "C" { · 21 unmodified lines | ||
| 175 | 179 | typedef _tTriangle* tTriangle; |
| 176 | 180 | |
| 177 | 181 | void tTriangle_init (tTriangle* const osc); |
| 178 | − void tTriangle_initToPool (tTriangle* const osc, tMempool* const pool); | |
| 182 | + void tTriangle_initToPool (tTriangle* const osc, tMempool* const mempool); | |
| 179 | 183 | void tTriangle_free (tTriangle* const osc); |
| 180 | 184 | |
| 181 | 185 | float tTriangle_tick (tTriangle* const osc); |
| @@ -194,13 +198,13 @@ extern "C" { · 12 unmodified lines | ||
| 194 | 198 | @brief Initialize a tSquare to the default LEAF mempool. |
| 195 | 199 | @param osc A pointer to the tSquare to be initialized. |
| 196 | 200 | |
| 197 | − @fn void tSquare_initToPool (tSquare* const osc, tMempool* const pool) | |
| 201 | + @fn void tSquare_initToPool (tSquare* const osc, tMempool* const mempool) | |
| 198 | 202 | @brief Initialize a tSquare to a specified mempool. |
| 199 | 203 | @param osc A pointer to the tSquare to be initialized. |
| 200 | − @param pool A pointer to the tMempool to which the tSquare should be initialized. | |
| 204 | + @param mempool A pointer to the tMempool to which the tSquare should be initialized. | |
| 201 | 205 | |
| 202 | 206 | @fn void tSquare_free (tSquare* const osc) |
| 203 | − @brief Free a tSquare from the default LEAF mempool. | |
| 207 | + @brief Free a tSquare from its mempool. | |
| 204 | 208 | @param osc A pointer to the tSquare to be freed. |
| 205 | 209 | |
| 206 | 210 | @fn float tSquare_tick (tSquare* const osc) |
| @@ -249,13 +253,13 @@ extern "C" { · 42 unmodified lines | ||
| 249 | 253 | @brief Initialize a tSawtooth to the default LEAF mempool. |
| 250 | 254 | @param osc A pointer to the tSawtooth to be initialized. |
| 251 | 255 | |
| 252 | − @fn void tSawtooth_initToPool (tSawtooth* const osc, tMempool* const pool) | |
| 256 | + @fn void tSawtooth_initToPool (tSawtooth* const osc, tMempool* const mempool) | |
| 253 | 257 | @brief Initialize a tSawtooth to a specified mempool. |
| 254 | 258 | @param osc A pointer to the tSawtooth to be initialized. |
| 255 | − @param pool A pointer to the tMempool to which the tSawtooth should be initialized. | |
| 259 | + @param mempool A pointer to the tMempool to which the tSawtooth should be initialized. | |
| 256 | 260 | |
| 257 | 261 | @fn void tSawtooth_free (tSawtooth* const osc) |
| 258 | − @brief Free a tSawtooth from the default LEAF mempool. | |
| 262 | + @brief Free a tSawtooth from its mempool. | |
| 259 | 263 | @param osc A pointer to the tSawtooth to be freed. |
| 260 | 264 | |
| 261 | 265 | @fn float tSawtooth_tick (tSawtooth* const osc) |
| @@ -283,7 +287,7 @@ extern "C" { · 21 unmodified lines | ||
| 283 | 287 | typedef _tSawtooth* tSawtooth; |
| 284 | 288 | |
| 285 | 289 | void tSawtooth_init (tSawtooth* const osc); |
| 286 | − void tSawtooth_initToPool (tSawtooth* const osc, tMempool* const pool); | |
| 290 | + void tSawtooth_initToPool (tSawtooth* const osc, tMempool* const mempool); | |
| 287 | 291 | void tSawtooth_free (tSawtooth* const osc); |
| 288 | 292 | |
| 289 | 293 | float tSawtooth_tick (tSawtooth* const osc); |
| @@ -301,7 +305,7 @@ extern "C" { · 11 unmodified lines | ||
| 301 | 305 | @brief |
| 302 | 306 | @param |
| 303 | 307 | |
| 304 | − @fn void tTri_initToPool (tTri* const osc, tMempool* const pool) | |
| 308 | + @fn void tTri_initToPool (tTri* const osc, tMempool* const mempool) | |
| 305 | 309 | @brief |
| 306 | 310 | @param |
| 307 | 311 | |
| @@ -335,7 +339,7 @@ extern "C" { · 27 unmodified lines | ||
| 335 | 339 | typedef _tTri* tTri; |
| 336 | 340 | |
| 337 | 341 | void tTri_init (tTri* const osc); |
| 338 | − void tTri_initToPool (tTri* const osc, tMempool* const pool); | |
| 342 | + void tTri_initToPool (tTri* const osc, tMempool* const mempool); | |
| 339 | 343 | void tTri_free (tTri* const osc); |
| 340 | 344 | |
| 341 | 345 | float tTri_tick (tTri* const osc); |
| @@ -406,7 +410,7 @@ extern "C" { · 64 unmodified lines | ||
| 406 | 410 | @brief |
| 407 | 411 | @param |
| 408 | 412 | |
| 409 | − @fn void tSaw_initToPool (tSaw* const osc, tMempool* const pool) | |
| 413 | + @fn void tSaw_initToPool (tSaw* const osc, tMempool* const mempool) | |
| 410 | 414 | @brief |
| 411 | 415 | @param |
| 412 | 416 | |
| @@ -434,7 +438,7 @@ extern "C" { · 21 unmodified lines | ||
| 434 | 438 | typedef _tSaw* tSaw; |
| 435 | 439 | |
| 436 | 440 | void tSaw_init (tSaw* const osc); |
| 437 | − void tSaw_initToPool (tSaw* const osc, tMempool* const pool); | |
| 441 | + void tSaw_initToPool (tSaw* const osc, tMempool* const mempool); | |
| 438 | 442 | void tSaw_free (tSaw* const osc); |
| 439 | 443 | |
| 440 | 444 | float tSaw_tick (tSaw* const osc); |
| @@ -555,13 +559,13 @@ extern "C" { · 114 unmodified lines | ||
| 555 | 559 | @brief Initialize a tNeuron to the default LEAF mempool. |
| 556 | 560 | @param neuron A pointer to the tNeuron to be initialized. |
| 557 | 561 | |
| 558 | − @fn void tNeuron_initToPool (tNeuron* const neuron, tMempool* const pool) | |
| 562 | + @fn void tNeuron_initToPool (tNeuron* const neuron, tMempool* const mempool) | |
| 559 | 563 | @brief Initialize a tNeuron to a specified mempool. |
| 560 | 564 | @param neuron A pointer to the tNeuron to be initialized. |
| 561 | − @param pool A pointer to the tMempool to which the tNeuron should be initialized. | |
| 565 | + @param mempool A pointer to the tMempool to which the tNeuron should be initialized. | |
| 562 | 566 | |
| 563 | 567 | @fn void tNeuron_free (tNeuron* const neuron) |
| 564 | − @brief Free a tNeuron from the default LEAF mempool. | |
| 568 | + @brief Free a tNeuron from its mempool. | |
| 565 | 569 | @param neuron A pointer to the tNeuron to be freed. |
| 566 | 570 | |
| 567 | 571 | @fn void tNeuron_reset (tNeuron* const neuron) |
| @@ -659,7 +663,7 @@ extern "C" { · 91 unmodified lines | ||
| 659 | 663 | typedef _tNeuron* tNeuron; |
| 660 | 664 | |
| 661 | 665 | void tNeuron_init (tNeuron* const neuron); |
| 662 | − void tNeuron_initToPool (tNeuron* const neuron, tMempool* const pool); | |
| 666 | + void tNeuron_initToPool (tNeuron* const neuron, tMempool* const mempool); | |
| 663 | 667 | void tNeuron_free (tNeuron* const neuron); |
| 664 | 668 | |
| 665 | 669 | void tNeuron_reset (tNeuron* const neuron); |
| @@ -692,7 +696,7 @@ extern "C" { · 26 unmodified lines | ||
| 692 | 696 | @brief |
| 693 | 697 | @param |
| 694 | 698 | |
| 695 | − @fn void tMBPulse_initToPool(tMBPulse* const osc, tMempool* const pool) | |
| 699 | + @fn void tMBPulse_initToPool(tMBPulse* const osc, tMempool* const mempool) | |
| 696 | 700 | @brief |
| 697 | 701 | @param |
| 698 | 702 | |
| @@ -741,7 +745,7 @@ extern "C" { · 42 unmodified lines | ||
| 741 | 745 | typedef _tMBPulse* tMBPulse; |
| 742 | 746 | |
| 743 | 747 | void tMBPulse_init(tMBPulse* const osc); |
| 744 | − void tMBPulse_initToPool(tMBPulse* const osc, tMempool* const pool); | |
| 748 | + void tMBPulse_initToPool(tMBPulse* const osc, tMempool* const mempool); | |
| 745 | 749 | void tMBPulse_free(tMBPulse* const osc); |
| 746 | 750 | |
| 747 | 751 | float tMBPulse_tick(tMBPulse* const osc); |
| @@ -760,7 +764,7 @@ extern "C" { · 12 unmodified lines | ||
| 760 | 764 | @brief |
| 761 | 765 | @param |
| 762 | 766 | |
| 763 | − @fn void tMBTriangle_initToPool(tMBTriangle* const osc, tMempool* const pool) | |
| 767 | + @fn void tMBTriangle_initToPool(tMBTriangle* const osc, tMempool* const mempool) | |
| 764 | 768 | @brief |
| 765 | 769 | @param |
| 766 | 770 | |
| @@ -809,7 +813,7 @@ extern "C" { · 42 unmodified lines | ||
| 809 | 813 | typedef _tMBTriangle* tMBTriangle; |
| 810 | 814 | |
| 811 | 815 | void tMBTriangle_init(tMBTriangle* const osc); |
| 812 | − void tMBTriangle_initToPool(tMBTriangle* const osc, tMempool* const pool); | |
| 816 | + void tMBTriangle_initToPool(tMBTriangle* const osc, tMempool* const mempool); | |
| 813 | 817 | void tMBTriangle_free(tMBTriangle* const osc); |
| 814 | 818 | |
| 815 | 819 | float tMBTriangle_tick(tMBTriangle* const osc); |
| @@ -829,7 +833,7 @@ extern "C" { · 13 unmodified lines | ||
| 829 | 833 | @brief |
| 830 | 834 | @param |
| 831 | 835 | |
| 832 | − @fn void tMBSaw_initToPool(tMBSaw* const osc, tMempool* const pool) | |
| 836 | + @fn void tMBSaw_initToPool(tMBSaw* const osc, tMempool* const mempool) | |
| 833 | 837 | @brief |
| 834 | 838 | @param |
| 835 | 839 | |
| @@ -873,7 +877,7 @@ extern "C" { · 37 unmodified lines | ||
| 873 | 877 | typedef _tMBSaw* tMBSaw; |
| 874 | 878 | |
| 875 | 879 | void tMBSaw_init(tMBSaw* const osc); |
| 876 | − void tMBSaw_initToPool(tMBSaw* const osc, tMempool* const pool); | |
| 880 | + void tMBSaw_initToPool(tMBSaw* const osc, tMempool* const mempool); | |
| 877 | 881 | void tMBSaw_free(tMBSaw* const osc); |
| 878 | 882 | |
| 879 | 883 | float tMBSaw_tick(tMBSaw* const osc); |
| @@ -64,16 +64,16 @@ float tEnvelopeFollower_tick(tEnvelopeFollower* const ef, float x) · 63 unmodified lines | ||
| 64 | 64 | return e->y; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | −int tEnvelopeFollower_decayCoeff(tEnvelopeFollower* const ef, float decayCoeff) | |
| 67 | +void tEnvelopeFollower_setDecayCoefficient(tEnvelopeFollower* const ef, float decayCoeff) | |
| 68 | 68 | { |
| 69 | 69 | _tEnvelopeFollower* e = *ef; |
| 70 | − return e->d_coeff = decayCoeff; | |
| 70 | + e->d_coeff = decayCoeff; | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | −int tEnvelopeFollower_attackThresh(tEnvelopeFollower* const ef, float attackThresh) | |
| 73 | +void tEnvelopeFollower_setAttackThreshold(tEnvelopeFollower* const ef, float attackThresh) | |
| 74 | 74 | { |
| 75 | 75 | _tEnvelopeFollower* e = *ef; |
| 76 | − return e->a_thresh = attackThresh; | |
| 76 | + e->a_thresh = attackThresh; | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| @@ -82,15 +82,15 @@ int tEnvelopeFollower_attackThresh(tEnvelopeFollower* const ef, float attack · 2 unmodified lines | ||
| 82 | 82 | |
| 83 | 83 | // zero crossing detector |
| 84 | 84 | |
| 85 | −void tZeroCrossing_init (tZeroCrossing* const zc, int maxWindowSize) | |
| 85 | +void tZeroCrossingCounter_init (tZeroCrossingCounter* const zc, int maxWindowSize) | |
| 86 | 86 | { |
| 87 | − tZeroCrossing_initToPool (zc, maxWindowSize, &leaf.mempool); | |
| 87 | + tZeroCrossingCounter_initToPool (zc, maxWindowSize, &leaf.mempool); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | −void tZeroCrossing_initToPool (tZeroCrossing* const zc, int maxWindowSize, tMempool* const mp) | |
| 90 | +void tZeroCrossingCounter_initToPool (tZeroCrossingCounter* const zc, int maxWindowSize, tMempool* const mp) | |
| 91 | 91 | { |
| 92 | 92 | _tMempool* m = *mp; |
| 93 | − _tZeroCrossing* z = *zc = (_tZeroCrossing*) mpool_alloc(sizeof(_tZeroCrossing), m); | |
| 93 | + _tZeroCrossingCounter* z = *zc = (_tZeroCrossingCounter*) mpool_alloc(sizeof(_tZeroCrossing), m); | |
| 94 | 94 | z->mempool = m; |
| 95 | 95 | |
| 96 | 96 | z->count = 0; |
| @@ -103,9 +103,9 @@ void tZeroCrossing_initToPool (tZeroCrossing* const zc, int maxWindowSize, · 6 unmodified lines | ||
| 103 | 103 | z->countBuffer = (uint16_t*) mpool_calloc(sizeof(uint16_t) * maxWindowSize, m); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | −void tZeroCrossing_free (tZeroCrossing* const zc) | |
| 106 | +void tZeroCrossingCounter_free (tZeroCrossingCounter* const zc) | |
| 107 | 107 | { |
| 108 | − _tZeroCrossing* z = *zc; | |
| 108 | + _tZeroCrossingCounter* z = *zc; | |
| 109 | 109 | |
| 110 | 110 | mpool_free((char*)z->inBuffer, z->mempool); |
| 111 | 111 | mpool_free((char*)z->countBuffer, z->mempool); |
| @@ -113,9 +113,9 @@ void tZeroCrossing_free (tZeroCrossing* const zc) · 1 unmodified line | ||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | //returns proportion of zero crossings within window size (0.0 would be none in window, 1.0 would be all zero crossings) |
| 116 | −float tZeroCrossing_tick (tZeroCrossing* const zc, float input) | |
| 116 | +float tZeroCrossingCounter_tick (tZeroCrossingCounter* const zc, float input) | |
| 117 | 117 | { |
| 118 | − _tZeroCrossing* z = *zc; | |
| 118 | + _tZeroCrossingCounter* z = *zc; | |
| 119 | 119 | |
| 120 | 120 | z->inBuffer[z->position] = input; |
| 121 | 121 | int futurePosition = ((z->position + 1) % z->currentWindowSize); |
| @@ -152,9 +152,9 @@ float tZeroCrossing_tick (tZeroCrossing* const zc, float input) · 30 unmodified lines | ||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | −void tZeroCrossing_setWindow (tZeroCrossing* const zc, float windowSize) | |
| 155 | +void tZeroCrossingCounter_setWindowSize (tZeroCrossingCounter* const zc, float windowSize) | |
| 156 | 156 | { |
| 157 | − _tZeroCrossing* z = *zc; | |
| 157 | + _tZeroCrossingCounter* z = *zc; | |
| 158 | 158 | if (windowSize <= z->maxWindowSize) |
| 159 | 159 | { |
| 160 | 160 | z->currentWindowSize = windowSize; |
| @@ -285,11 +285,11 @@ void tTalkbox_lpc(float *buf, float *car, double* dl, double* Rt, int32_t n, int · 284 unmodified lines | ||
| 285 | 285 | { |
| 286 | 286 | if(r[0] < min) |
| 287 | 287 | { |
| 288 | − for(i=0; i<n; i++) | |
| 289 | − { | |
| 288 | +// for(i=0; i<n; i++) | |
| 289 | +// { | |
| 290 | 290 | buf[i] = 0.0f; |
| 291 | 291 | return; |
| 292 | − } | |
| 292 | +// } | |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | tTalkbox_lpcDurbin(r, o, k, G); //calc reflection coeffs |
| @@ -612,11 +612,11 @@ void tTalkboxFloat_lpc(float *buf, float *car, float* dl, float* Rt, int32_t n, · 316 unmodified lines | ||
| 612 | 612 | { |
| 613 | 613 | if(r[0] < min) |
| 614 | 614 | { |
| 615 | − for(i=0; i<n; i++) | |
| 616 | − { | |
| 615 | +// for(i=0; i<n; i++) | |
| 616 | +// { | |
| 617 | 617 | buf[i] = 0.0f; |
| 618 | 618 | return; |
| 619 | − } | |
| 619 | +// } | |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | tTalkbox_lpcDurbin(r, o, k, G); //calc reflection coeffs |