Unified · Split
| @@ -55,6 +55,7 @@ extern "C" { · 54 unmodified lines | |||
| 55 | 55 | ||
| 56 | void tBuffer_record (tBuffer* const); | 56 | void tBuffer_record (tBuffer* const); |
| 57 | void tBuffer_stop (tBuffer* const); | 57 | void tBuffer_stop (tBuffer* const); |
| 58 | int tBuffer_getRecordPosition(tBuffer* const); | ||
| 58 | 59 | ||
| 59 | void tBuffer_setRecordMode (tBuffer* const, RecordMode mode); | 60 | void tBuffer_setRecordMode (tBuffer* const, RecordMode mode); |
| 60 | 61 | ||
| @@ -99,6 +99,12 @@ void tBuffer_stop(tBuffer* const sb) · 98 unmodified lines | |||
| 99 | s->active = 0; | 99 | s->active = 0; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | int tBuffer_getRecordPosition(tBuffer* const sb) | ||
| 103 | { | ||
| 104 | _tBuffer* s = *sb; | ||
| 105 | return s->idx; | ||
| 106 | } | ||
| 107 | |||
| 102 | void tBuffer_setRecordMode (tBuffer* const sb, RecordMode mode) | 108 | void tBuffer_setRecordMode (tBuffer* const sb, RecordMode mode) |
| 103 | { | 109 | { |
| 104 | _tBuffer* s = *sb; | 110 | _tBuffer* s = *sb; |
| @@ -224,7 +230,7 @@ float tSampler_tick (tSampler* const sp) · 119 unmodified lines | |||
| 224 | alpha); | 230 | alpha); |
| 225 | 231 | ||
| 226 | // num samples to end of loop | 232 | // num samples to end of loop |
| 227 | numsamps = (idx - start) / p->inc; | 233 | numsamps = (idx - start) * p->iinc; |
| 228 | //numsamps = (dir > 0) ? (end - idx) : (idx - start); | 234 | //numsamps = (dir > 0) ? (end - idx) : (idx - start); |
| 229 | //numsamps *= p->iinc; | 235 | //numsamps *= p->iinc; |
| 230 | 236 | ||
| @@ -263,7 +269,7 @@ float tSampler_tick (tSampler* const sp) · 32 unmodified lines | |||
| 263 | buff[i4], | 269 | buff[i4], |
| 264 | 1.0f-alpha); | 270 | 1.0f-alpha); |
| 265 | 271 | ||
| 266 | numsamps = (idx - start) / p->inc; | 272 | numsamps = (idx - start) * p->iinc; |
| 267 | 273 | ||
| 268 | if (p->mode == PlayLoop) | 274 | if (p->mode == PlayLoop) |
| 269 | { | 275 | { |
| @@ -55,7 +55,7 @@ void LEAFTest_init (float sampleRate, int blockSize) · 54 unmodified lines | |||
| 55 | // Init and set play | 55 | // Init and set play |
| 56 | tSampler_init (&samp, &buff); // init, give address of record buffer | 56 | tSampler_init (&samp, &buff); // init, give address of record buffer |
| 57 | tSampler_setMode (&samp, PlayLoop); //set in Loop Mode | 57 | tSampler_setMode (&samp, PlayLoop); //set in Loop Mode |
| 58 | tSampler_setRate(&samp, 1.f); // Rate of 1.0 | 58 | tSampler_setRate(&samp, 1.763f); // Rate of 1.0 |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | float LEAFTest_tick (float input) | 61 | float LEAFTest_tick (float input) |
| @@ -95,11 +95,13 @@ void LEAFTest_block (void) · 33 unmodified lines | |||
| 95 | 95 | ||
| 96 | y = val * 49.0f + 1.0f; | 96 | y = val * 49.0f + 1.0f; |
| 97 | b = val * 20.0f - 5.0f; | 97 | b = val * 20.0f - 5.0f; |
| 98 | b = val * tBuffer_getLength(&buff); | ||
| 98 | 99 | ||
| 99 | DBG("rate: " + String(b)); | 100 | DBG("rate: " + String(b)); |
| 100 | 101 | ||
| 101 | tSampler_setStart(&samp, a); | 102 | tSampler_setStart(&samp, a); |
| 102 | tSampler_setRate(&samp, b); | 103 | tSampler_setEnd(&samp, b); |
| 104 | // tSampler_setRate(&samp, b); | ||
| 103 | 105 | ||
| 104 | // tFormantShifter_setShiftFactor(&fs, x); | 106 | // tFormantShifter_setShiftFactor(&fs, x); |
| 105 | // tFormantShifter_setIntensity(&fs, y); | 107 | // tFormantShifter_setIntensity(&fs, y); |