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