Unified · Split
| @@ -61,4 +61,4 @@ void tCrusher_setSamplingRatio (tCrusher* const, float ratio); · 60 unmodified lines | ||
| 61 | 61 | |
| 62 | 62 | #endif // LEAF_WAVEFOLDER_H_INCLUDED |
| 63 | 63 | |
| 64 | −//============================================================================== | |
| 64 | +//============================================================================== | |
| @@ -25,12 +25,12 @@ typedef struct _LEAF · 24 unmodified lines | ||
| 25 | 25 | float invSampleRate; |
| 26 | 26 | int blockSize; |
| 27 | 27 | |
| 28 | − /* | |
| 28 | + | |
| 29 | 29 | float* sinewave; |
| 30 | 30 | float* sawtooth[11]; |
| 31 | 31 | float* square[11]; |
| 32 | 32 | float* triangle[11]; |
| 33 | − */ | |
| 33 | + | |
| 34 | 34 | |
| 35 | 35 | float (*random)(void); |
| 36 | 36 | } LEAF; |
| @@ -57,7 +57,7 @@ extern const float shaper1[SHAPER1_TABLE_SIZE]; · 20 unmodified lines | ||
| 57 | 57 | // Feel free to change to suit memory constraints or desired delay max length / functionality. |
| 58 | 58 | |
| 59 | 59 | |
| 60 | − | |
| 60 | +#define TALKBOX_BUFFER_LENGTH 1600 // Every talkbox instance introduces 5 buffers of this size | |
| 61 | 61 | |
| 62 | 62 | union unholy_t { /* a union between a float and an integer */ |
| 63 | 63 | float f; |
| @@ -77,6 +77,7 @@ extern "C" { · 76 unmodified lines | ||
| 77 | 77 | |
| 78 | 78 | float idx; |
| 79 | 79 | float inc; |
| 80 | + float last; | |
| 80 | 81 | float iinc; |
| 81 | 82 | int8_t dir; |
| 82 | 83 | int8_t flip; |
| @@ -81,4 +81,4 @@ void tCrusher_setRound (tCrusher* const c, float rnd) · 80 unmodified lines | ||
| 81 | 81 | void tCrusher_setSamplingRatio (tCrusher* const c, float ratio) |
| 82 | 82 | { |
| 83 | 83 | c->srr = ratio; |
| 84 | −} | |
| 84 | +} | |
| @@ -141,8 +141,13 @@ void tSampler_free (tSampler* const p) · 140 unmodified lines | ||
| 141 | 141 | |
| 142 | 142 | float tSampler_tick (tSampler* const p) |
| 143 | 143 | { |
| 144 | − if (p->active == 0 || (p->len < 4)) return 0.f; | |
| 145 | − | |
| 144 | + if (p->active == 0) return 0.f; | |
| 145 | + | |
| 146 | + if ((p->inc == 0.0f) || (p->len < 4)) | |
| 147 | + { | |
| 148 | + return p->last; | |
| 149 | + } | |
| 150 | + | |
| 146 | 151 | float sample = 0.f; |
| 147 | 152 | float cfxsample = 0.f; |
| 148 | 153 | int numsamps; |
| @@ -162,7 +167,7 @@ float tSampler_tick (tSampler* const p) · 13 unmodified lines | ||
| 162 | 167 | } |
| 163 | 168 | else |
| 164 | 169 | { |
| 165 | − idx = (int) (p->idx + 1.f); // we think this is because flooring on int works different when reading backwards | |
| 170 | + idx = (int) (p->idx+1.f); // we think this is because flooring on int works different when reading backwards | |
| 166 | 171 | alpha = (p->idx+1.f) - idx; |
| 167 | 172 | } |
| 168 | 173 | |
| @@ -173,52 +178,53 @@ float tSampler_tick (tSampler* const p) · 4 unmodified lines | ||
| 173 | 178 | end = p->start; |
| 174 | 179 | } |
| 175 | 180 | |
| 176 | − // Check dir (direction) to interpolate properly | |
| 177 | − if (dir > 0) | |
| 178 | − { | |
| 179 | − // FORWARD NORMAL SAMPLE | |
| 180 | − int i1 = idx-1; | |
| 181 | − int i3 = idx+1; | |
| 182 | − int i4 = idx+2; | |
| 183 | − | |
| 184 | − sample = LEAF_interpolate_hermite (buff[i1], | |
| 185 | − buff[idx], | |
| 186 | − buff[i3], | |
| 187 | − buff[i4], | |
| 188 | − alpha); | |
| 189 | − | |
| 190 | − // num samples to end of loop | |
| 191 | − numsamps = (dir > 0) ? (end - idx) : (idx - start); | |
| 192 | − numsamps *= p->iinc; | |
| 193 | − | |
| 194 | − if (p->mode == PlayLoop) | |
| 195 | − { | |
| 196 | − if (numsamps <= p->cfxlen) | |
| 197 | − { | |
| 198 | − // CROSSFADE SAMPLE | |
| 199 | − float idxx = p->idx - p->len; | |
| 200 | − int cdx = (int)(idxx); | |
| 201 | − | |
| 202 | − i1 = cdx-1; | |
| 203 | − i3 = cdx+1; | |
| 204 | − i4 = cdx+2; | |
| 205 | − | |
| 206 | − cfxsample = LEAF_interpolate_hermite (buff[i1], | |
| 207 | − buff[cdx], | |
| 208 | − buff[i3], | |
| 209 | − buff[i4], | |
| 210 | − alpha); | |
| 211 | − | |
| 212 | − g2 = (float) (p->cfxlen - numsamps) / (float) p->cfxlen; | |
| 213 | − } | |
| 214 | − } | |
| 215 | − } | |
| 216 | − else | |
| 181 | + // Check dir (direction) to interpolate properly | |
| 182 | + if (dir > 0) | |
| 183 | + { | |
| 184 | + // FORWARD NORMAL SAMPLE | |
| 185 | + int i1 = ((idx-1) + p->len) % p->len; | |
| 186 | + int i3 = (idx+1) % p->len; | |
| 187 | + int i4 = (idx+2) % p->len; | |
| 188 | + | |
| 189 | + sample = LEAF_interpolate_hermite (buff[i1], | |
| 190 | + buff[idx], | |
| 191 | + buff[i3], | |
| 192 | + buff[i4], | |
| 193 | + alpha); | |
| 194 | + | |
| 195 | + // num samples to end of loop | |
| 196 | + numsamps = (idx - start) / p->inc; | |
| 197 | + //numsamps = (dir > 0) ? (end - idx) : (idx - start); | |
| 198 | + //numsamps *= p->iinc; | |
| 199 | + | |
| 200 | + if (p->mode == PlayLoop) | |
| 201 | + { | |
| 202 | + if (numsamps <= p->cfxlen) | |
| 203 | + { | |
| 204 | + // CROSSFADE SAMPLE | |
| 205 | + float idxx = p->idx - p->len; | |
| 206 | + int cdx = ((int)(idxx) + p->len) % p->len; | |
| 207 | + | |
| 208 | + i1 = ((cdx-1) + p->len) % p->len; | |
| 209 | + i3 = (cdx+1) % p->len; | |
| 210 | + i4 = (cdx+2) % p->len; | |
| 211 | + | |
| 212 | + cfxsample = LEAF_interpolate_hermite (buff[i1], | |
| 213 | + buff[cdx], | |
| 214 | + buff[i3], | |
| 215 | + buff[i4], | |
| 216 | + alpha); | |
| 217 | + | |
| 218 | + g2 = (float) (p->cfxlen - numsamps) / (float) p->cfxlen; | |
| 219 | + } | |
| 220 | + } | |
| 221 | + } | |
| 222 | + else | |
| 217 | 223 | { |
| 218 | − // REVERSE | |
| 219 | − int i1 = idx+1; | |
| 220 | − int i3 = idx-1; | |
| 221 | − int i4 = idx-2; | |
| 224 | + // REVERSE | |
| 225 | + int i1 = (idx+1) % p->len; | |
| 226 | + int i3 = ((idx-1) + p->len) % p->len; | |
| 227 | + int i4 = ((idx-2) + p->len) % p->len; | |
| 222 | 228 | |
| 223 | 229 | sample = LEAF_interpolate_hermite (buff[i1], |
| 224 | 230 | buff[idx], |
| @@ -234,12 +240,12 @@ float tSampler_tick (tSampler* const p) · 9 unmodified lines | ||
| 234 | 240 | { |
| 235 | 241 | // CROSSFADE SAMPLE |
| 236 | 242 | float idxx = p->idx + p->len + 1.f; |
| 237 | − int cdx = (int)(idxx); | |
| 243 | + int cdx = ((int)(idxx)) % p->len; | |
| 238 | 244 | alpha = idxx - cdx; |
| 239 | 245 | |
| 240 | − i1 = cdx+1; | |
| 241 | − i3 = cdx-1; | |
| 242 | − i4 = cdx-2; | |
| 246 | + i1 = (cdx+1) % p->len; | |
| 247 | + i3 = ((cdx-1) + p->len) % p->len; | |
| 248 | + i4 = ((cdx-2) + p->len) % p->len; | |
| 243 | 249 | |
| 244 | 250 | cfxsample = LEAF_interpolate_hermite (buff[i1], |
| 245 | 251 | buff[cdx], |
| @@ -322,7 +328,9 @@ float tSampler_tick (tSampler* const p) · 76 unmodified lines | ||
| 322 | 328 | } |
| 323 | 329 | } |
| 324 | 330 | |
| 325 | − return sample; | |
| 331 | + p->last = sample; | |
| 332 | + | |
| 333 | + return p->last; | |
| 326 | 334 | } |
| 327 | 335 | |
| 328 | 336 | void tSampler_setSample (tSampler* const p, tBuffer* s) |
Binary file not shown.
| @@ -451,6 +451,12 @@ · 450 unmodified lines | ||
| 451 | 451 | #ifndef JucePlugin_IAAName |
| 452 | 452 | #define JucePlugin_IAAName "pumusic: LEAF" |
| 453 | 453 | #endif |
| 454 | +#ifndef JucePlugin_VSTNumMidiInputs | |
| 455 | + #define JucePlugin_VSTNumMidiInputs 16 | |
| 456 | +#endif | |
| 457 | +#ifndef JucePlugin_VSTNumMidiOutputs | |
| 458 | + #define JucePlugin_VSTNumMidiOutputs 16 | |
| 459 | +#endif | |
| 454 | 460 | #ifndef JucePlugin_MaxNumInputChannels |
| 455 | 461 | #define JucePlugin_MaxNumInputChannels 2 |
| 456 | 462 | #endif |
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | pluginIsSynth="0" pluginWantsMidiIn="1" pluginProducesMidiOut="0" |
| 9 | 9 | pluginIsMidiEffectPlugin="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="LEAFAU" |
| 10 | 10 | pluginRTASCategory="" aaxIdentifier="com.pumusic.LEAF" pluginAAXCategory="2" |
| 11 | − jucerVersion="5.4.1" companyName="Princeton University" companyEmail="mrmulshine@gmail.com" | |
| 11 | + jucerVersion="5.4.3" companyName="Princeton University" companyEmail="mrmulshine@gmail.com" | |
| 12 | 12 | displaySplashScreen="1" reportAppUsage="1" splashScreenColour="Dark" |
| 13 | 13 | buildStandalone="1" enableIAA="0" cppLanguageStandard="11" companyCopyright="Princeton University" |
| 14 | 14 | pluginFormats="buildVST,buildAU,buildStandalone" pluginCharacteristicsValue="pluginWantsMidiIn"> |
| @@ -15,14 +15,13 @@ · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | std::vector<juce::String> cButtonNames = std::vector<juce::String> |
| 17 | 17 | { |
| 18 | − | |
| 18 | + "record" | |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | std::vector<juce::String> cSliderNames = std::vector<juce::String> |
| 22 | 22 | { |
| 23 | − "gain", | |
| 24 | − "frequency", | |
| 25 | − "distortion" | |
| 23 | + "mod freq", | |
| 24 | + "mod depth" | |
| 26 | 25 | }; |
| 27 | 26 | |
| 28 | 27 | std::vector<juce::String> cComboBoxNames = std::vector<juce::String> |
| @@ -1,153 +1,194 @@ | ||
| 1 | −/* | |
| 2 | − ============================================================================== | |
| 3 | − | |
| 4 | − FM.c | |
| 5 | − Created: 23 Jan 2017 9:39:38am | |
| 6 | − Author: Michael R Mulshine | |
| 7 | − | |
| 8 | − ============================================================================== | |
| 9 | −*/ | |
| 10 | − | |
| 11 | −#include "LEAFTest.h" | |
| 12 | −#include "MyTest.h" | |
| 13 | − | |
| 14 | − | |
| 15 | −static void leaf_pool_report(void); | |
| 16 | −static void leaf_pool_dump(void); | |
| 17 | −static void run_pool_test(void); | |
| 18 | − | |
| 19 | −float gain, freqVal; | |
| 20 | −float clipThreshold = 1.f; | |
| 21 | − | |
| 22 | −tCycle test; | |
| 23 | −tOversampler2x os2; | |
| 24 | −tOversampler4x os4; | |
| 25 | − | |
| 26 | −void LEAFTest_init (float sampleRate, int blockSize) | |
| 27 | −{ | |
| 28 | − LEAF_init(sampleRate, blockSize, &randomNumberGenerator); | |
| 29 | − | |
| 30 | − tCycle_init(&test); | |
| 31 | − tOversampler2x_init(&os2); | |
| 32 | − tOversampler4x_init(&os4); | |
| 33 | − | |
| 34 | − leaf_pool_report(); | |
| 35 | −} | |
| 36 | − | |
| 37 | − | |
| 38 | −float softClip(float sample) | |
| 39 | −{ | |
| 40 | − return LEAF_softClip(sample, clipThreshold); | |
| 41 | −} | |
| 42 | − | |
| 43 | −float lastOut; | |
| 44 | − | |
| 45 | −float LEAFTest_tick (float input) | |
| 46 | −{ | |
| 47 | − tCycle_setFreq(&test, freqVal); | |
| 48 | − float sample = tCycle_tick(&test); | |
| 49 | − | |
| 50 | − sample = tOversampler4x_tick(&os4, sample, &softClip); | |
| 51 | − | |
| 52 | − return sample * gain; | |
| 53 | −} | |
| 54 | − | |
| 55 | −bool lastState = false, lastPlayState = false; | |
| 56 | −void LEAFTest_block (void) | |
| 57 | −{ | |
| 58 | − clipThreshold = (1.f - getSliderValue("distortion")) * 0.3f; | |
| 59 | − gain = getSliderValue("gain") * 0.5f; | |
| 60 | − freqVal = getSliderValue("frequency") * 18000.f; | |
| 61 | −} | |
| 62 | − | |
| 63 | −void LEAFTest_controllerInput (int cnum, float cval) | |
| 64 | −{ | |
| 65 | − | |
| 66 | −} | |
| 67 | − | |
| 68 | −void LEAFTest_pitchBendInput (int pitchBend) | |
| 69 | −{ | |
| 70 | − | |
| 71 | −} | |
| 72 | − | |
| 73 | −int lastNote; | |
| 74 | −void LEAFTest_noteOn (int note, float velocity) | |
| 75 | −{ | |
| 76 | −} | |
| 77 | − | |
| 78 | − | |
| 79 | −void LEAFTest_noteOff (int note) | |
| 80 | −{ | |
| 1 | +/* | |
| 2 | + ============================================================================== | |
| 3 | + | |
| 4 | + FM.c | |
| 5 | + Created: 23 Jan 2017 9:39:38am | |
| 6 | + Author: Michael R Mulshine | |
| 7 | + | |
| 8 | + ============================================================================== | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +#include "LEAFTest.h" | |
| 12 | +#include "MyTest.h" | |
| 13 | + | |
| 14 | + | |
| 15 | +static void leaf_pool_report(void); | |
| 16 | +static void leaf_pool_dump(void); | |
| 17 | +static void run_pool_test(void); | |
| 18 | + | |
| 19 | +float mix = 0.f; | |
| 20 | +float fx = 1.f; | |
| 21 | + | |
| 22 | +#define NUM_GRAINS 20 | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | +tTapeDelay delay; | |
| 27 | + | |
| 28 | +float feedback = 0.f; | |
| 29 | + | |
| 30 | +tBuffer buff; | |
| 31 | +tSampler samp; | |
| 32 | + | |
| 33 | +tCycle osc; | |
| 34 | + | |
| 35 | +void LEAFTest_init (float sampleRate, int blockSize) | |
| 36 | +{ | |
| 37 | + LEAF_init(sampleRate, blockSize, &getRandomFloat); | |
| 38 | + | |
| 39 | + // Init and set record | |
| 40 | + tBuffer_init (&buff, leaf.sampleRate * 1.f); // init, 1 second buffer | |
| 41 | + tBuffer_setRecordMode (&buff, RecordOneShot); // RecordOneShot records once through | |
| 42 | + tBuffer_record(&buff); // starts recording | |
| 43 | + | |
| 44 | + // Init and set play | |
| 45 | + tSampler_init (&samp, &buff); // init, give address of record buffer | |
| 46 | + tSampler_setMode (&samp, PlayLoop); //set in Loop Mode | |
| 47 | + tSampler_setRate(&samp, 1.f); // Rate of 1.0 | |
| 48 | + tSampler_play(&samp); // start spitting samples out | |
| 49 | + | |
| 50 | + tCycle_init(&osc); | |
| 51 | + | |
| 52 | + leaf_pool_report(); | |
| 81 | 53 | } |
| 82 | 54 | |
| 83 | − | |
| 84 | − | |
| 85 | −void LEAFTest_end (void) | |
| 86 | −{ | |
| 87 | − | |
| 88 | −} | |
| 89 | − | |
| 90 | −// LEAF POOL UTILITIES | |
| 91 | − | |
| 92 | −void leaf_pool_report(void) | |
| 93 | −{ | |
| 94 | − DBG(String(leaf_pool_get_used()) + " of " + String(leaf_pool_get_size())); | |
| 95 | −} | |
| 96 | − | |
| 97 | −void leaf_pool_dump(void) | |
| 98 | −{ | |
| 99 | − float* buff = (float*)leaf_pool_get_pool(); | |
| 100 | − int siz = leaf_pool_get_size(); | |
| 101 | − siz /= sizeof(float); | |
| 102 | − for (int i = 0; i < siz; i++) | |
| 103 | − { | |
| 104 | − DBG(String(buff[i])); | |
| 105 | − } | |
| 106 | −} | |
| 107 | − | |
| 108 | −static void run_pool_test(void) | |
| 109 | −{ | |
| 110 | − leaf_pool_report(); | |
| 111 | − | |
| 112 | − DBG("ALLOC BUFFER 1"); | |
| 113 | − int size = 50; | |
| 114 | − float* buffer; | |
| 115 | − buffer = (float*) leaf_alloc(sizeof(float) * size); | |
| 116 | − | |
| 117 | − for (int i = 0; i < size; i++) | |
| 118 | − { | |
| 119 | − buffer[i] = (float)i; | |
| 120 | − | |
| 121 | − } | |
| 122 | − | |
| 123 | − leaf_pool_report(); | |
| 124 | − | |
| 125 | − DBG("ALLOC BUFFER 2"); | |
| 126 | − size = 25; | |
| 127 | − | |
| 128 | − buffer = (float*) leaf_alloc(sizeof(float) * size); | |
| 129 | − | |
| 130 | − leaf_pool_report(); | |
| 131 | − | |
| 132 | − for (int i = 0; i < size; i++) | |
| 55 | +float depth = 1.0f; | |
| 56 | + | |
| 57 | +float LEAFTest_tick (float input) | |
| 58 | +{ | |
| 59 | + float sample = 0.f; | |
| 60 | + | |
| 61 | + tBuffer_tick(&buff, input); // ticking the buffer records in to buffer | |
| 62 | + | |
| 63 | + tSampler_setRate(&samp, tCycle_tick(&osc) * depth); | |
| 64 | + | |
| 65 | + // dont tick sampler if buffer not active (not recording) | |
| 66 | + if (buff.active == 0) | |
| 67 | + { | |
| 68 | + sample = tSampler_tick(&samp); // ticking sampler loops sample | |
| 69 | + } | |
| 70 | + | |
| 71 | + | |
| 72 | + return sample; | |
| 73 | +} | |
| 74 | + | |
| 75 | +bool lastState = false, lastPlayState = false; | |
| 76 | +void LEAFTest_block (void) | |
| 77 | +{ | |
| 78 | + bool state = getButtonState("record"); | |
| 79 | + | |
| 80 | + if (state) | |
| 133 | 81 | { |
| 134 | − buffer[i] = (float)(i*2); | |
| 82 | + setButtonState("record", false); | |
| 83 | + tBuffer_record(&buff); | |
| 135 | 84 | } |
| 136 | − leaf_free(buffer); | |
| 137 | − | |
| 138 | − leaf_pool_report(); | |
| 139 | − | |
| 140 | − DBG("ALLOC BUFFER 3"); | |
| 141 | − size = 15; | |
| 142 | 85 | |
| 143 | − buffer = (float*) leaf_alloc(sizeof(float) * size); | |
| 144 | − | |
| 145 | − for (int i = 0; i < size; i++) | |
| 146 | − { | |
| 147 | − buffer[i] = (float)(i*3); | |
| 148 | − } | |
| 149 | − | |
| 150 | − leaf_pool_report(); | |
| 151 | − | |
| 152 | − leaf_pool_dump(); | |
| 153 | −} | |
| 86 | + float val = getSliderValue("mod freq"); | |
| 87 | + | |
| 88 | + float freq = 0.1 + 999.9 * val; | |
| 89 | + | |
| 90 | + tCycle_setFreq(&osc, freq); | |
| 91 | + | |
| 92 | + DBG("mod freq: " + String(freq)); | |
| 93 | + | |
| 94 | + val = getSliderValue("mod depth"); | |
| 95 | + | |
| 96 | + depth = 0.1 + val * 15.9f; | |
| 97 | + | |
| 98 | + DBG("mod depth: " + String(depth)); | |
| 99 | + | |
| 100 | + | |
| 101 | +} | |
| 102 | + | |
| 103 | +void LEAFTest_controllerInput (int cnum, float cval) | |
| 104 | +{ | |
| 105 | + | |
| 106 | +} | |
| 107 | + | |
| 108 | +void LEAFTest_pitchBendInput (int pitchBend) | |
| 109 | +{ | |
| 110 | + | |
| 111 | +} | |
| 112 | + | |
| 113 | +int lastNote; | |
| 114 | +void LEAFTest_noteOn (int note, float velocity) | |
| 115 | +{ | |
| 116 | +} | |
| 117 | + | |
| 118 | + | |
| 119 | +void LEAFTest_noteOff (int note) | |
| 120 | +{ | |
| 121 | +} | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | +void LEAFTest_end (void) | |
| 126 | +{ | |
| 127 | + | |
| 128 | +} | |
| 129 | + | |
| 130 | +// LEAF POOL UTILITIES | |
| 131 | + | |
| 132 | +void leaf_pool_report(void) | |
| 133 | +{ | |
| 134 | + DBG(String(leaf_pool_get_used()) + " of " + String(leaf_pool_get_size())); | |
| 135 | +} | |
| 136 | + | |
| 137 | +void leaf_pool_dump(void) | |
| 138 | +{ | |
| 139 | + float* buff = (float*)leaf_pool_get_pool(); | |
| 140 | + int siz = leaf_pool_get_size(); | |
| 141 | + siz /= sizeof(float); | |
| 142 | + for (int i = 0; i < siz; i++) | |
| 143 | + { | |
| 144 | + DBG(String(buff[i])); | |
| 145 | + } | |
| 146 | +} | |
| 147 | + | |
| 148 | +static void run_pool_test(void) | |
| 149 | +{ | |
| 150 | + leaf_pool_report(); | |
| 151 | + | |
| 152 | + DBG("ALLOC BUFFER 1"); | |
| 153 | + int size = 50; | |
| 154 | + float* buffer; | |
| 155 | + buffer = (float*) leaf_alloc(sizeof(float) * size); | |
| 156 | + | |
| 157 | + for (int i = 0; i < size; i++) | |
| 158 | + { | |
| 159 | + buffer[i] = (float)i; | |
| 160 | + | |
| 161 | + } | |
| 162 | + | |
| 163 | + leaf_pool_report(); | |
| 164 | + | |
| 165 | + DBG("ALLOC BUFFER 2"); | |
| 166 | + size = 25; | |
| 167 | + | |
| 168 | + buffer = (float*) leaf_alloc(sizeof(float) * size); | |
| 169 | + | |
| 170 | + leaf_pool_report(); | |
| 171 | + | |
| 172 | + for (int i = 0; i < size; i++) | |
| 173 | + { | |
| 174 | + buffer[i] = (float)(i*2); | |
| 175 | + } | |
| 176 | + leaf_free(buffer); | |
| 177 | + | |
| 178 | + leaf_pool_report(); | |
| 179 | + | |
| 180 | + DBG("ALLOC BUFFER 3"); | |
| 181 | + size = 15; | |
| 182 | + | |
| 183 | + buffer = (float*) leaf_alloc(sizeof(float) * size); | |
| 184 | + | |
| 185 | + for (int i = 0; i < size; i++) | |
| 186 | + { | |
| 187 | + buffer[i] = (float)(i*3); | |
| 188 | + } | |
| 189 | + | |
| 190 | + leaf_pool_report(); | |
| 191 | + | |
| 192 | + leaf_pool_dump(); | |
| 193 | +} | |
| 194 | + | |