diff --git a/plugins/community/repos/Bidoo/src/Bidoo.cpp b/plugins/community/repos/Bidoo/src/Bidoo.cpp index cf7d1d33..1821b3d4 100644 --- a/plugins/community/repos/Bidoo/src/Bidoo.cpp +++ b/plugins/community/repos/Bidoo/src/Bidoo.cpp @@ -38,9 +38,8 @@ RACK_PLUGIN_MODEL_DECLARE(Bidoo, VOID); RACK_PLUGIN_INIT(Bidoo) { RACK_PLUGIN_INIT_ID(); - + RACK_PLUGIN_INIT_VERSION("0.6.29"); RACK_PLUGIN_INIT_WEBSITE("https://github.com/sebastien-bouffier/Bidoo"); - RACK_PLUGIN_INIT_VERSION("0.6.28"); RACK_PLUGIN_MODEL_ADD(Bidoo, DTROY); RACK_PLUGIN_MODEL_ADD(Bidoo, BORDL); diff --git a/plugins/community/repos/Bidoo/src/CURT.cpp b/plugins/community/repos/Bidoo/src/CURT.cpp index 752aa9ea..f811a751 100644 --- a/plugins/community/repos/Bidoo/src/CURT.cpp +++ b/plugins/community/repos/Bidoo/src/CURT.cpp @@ -16,6 +16,8 @@ struct CURT : Module { enum ParamIds { PITCH_PARAM, MODE_PARAM, + BUFF_SIZE_PARAM, + OVERLAP_PARAM, NUM_PARAMS }; enum InputIds { @@ -35,12 +37,15 @@ struct CURT : Module { DoubleRingBuffer out_Buffer; float bins[OVERLAP][BUFF_SIZE]; int index=-1; - int readSteps=0; - int writeSteps=0; + size_t readSteps=0; + size_t writeSteps=0; SchmittTrigger modeTrigger; bool mode=0; + size_t overlap, buff_size; CURT() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + overlap = OVERLAP; + buff_size = BUFF_SIZE; for(int i=0; ibuff_size) { + in_Buffer.startIncr(1); + } + while (out_Buffer.size()<2*buff_size) { + in_Buffer.push(0.0f); + } + while (out_Buffer.size()>2*buff_size) { + in_Buffer.startIncr(1); + } + } + json_t *toJson() override { json_t *rootJ = json_object(); json_object_set_new(rootJ, "mode", json_boolean(mode)); @@ -76,35 +96,43 @@ void CURT::step() { mode = !mode; } + if ((size_t)params[BUFF_SIZE_PARAM].value != buff_size) { + buff_size = pow(2.0f, params[BUFF_SIZE_PARAM].value); + updateBuff(); + } + + if ((size_t)params[OVERLAP_PARAM].value != overlap) { + overlap = params[OVERLAP_PARAM].value; + } + in_Buffer.startIncr(1); in_Buffer.push(inputs[INPUT].value); readSteps++; - if (readSteps>=(BUFF_SIZE/OVERLAP)) { - index=(index+1)%OVERLAP; - for(int i=0; i=(buff_size/overlap)) { + index=(index+1)%overlap; + for(size_t i=0; i=((float)BUFF_SIZE*params[PITCH_PARAM].value/(float)OVERLAP))) { + if ((writeSteps>=((float)buff_size*params[PITCH_PARAM].value/(float)overlap))) { if ((index%2==0) || (mode)) { - for(int i=0; i(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addParam(ParamWidget::create(Vec(8, 100), module, CURT::PITCH_PARAM, 0.2f, 2.0f, 1.0f)); - addInput(Port::create(Vec(10, 150.0f), Port::INPUT, module, CURT::PITCH_INPUT)); - addParam(ParamWidget::create(Vec(8, 190.0f), module, CURT::MODE_PARAM, 0.0f, 1.0f, 0.0f)); - addInput(Port::create(Vec(10, 242.66f), Port::INPUT, module, CURT::INPUT)); + addParam(ParamWidget::create(Vec(8, 90), module, CURT::PITCH_PARAM, 0.2f, 2.0f, 1.0f)); + addInput(Port::create(Vec(10, 140.0f), Port::INPUT, module, CURT::PITCH_INPUT)); + addParam(ParamWidget::create(Vec(8, 175.0f), module, CURT::MODE_PARAM, 0.0f, 1.0f, 0.0f)); + addParam(ParamWidget::create(Vec(2, 205), module, CURT::BUFF_SIZE_PARAM, 6.0f, 8.0f, 8.0f)); + addParam(ParamWidget::create(Vec(25, 205), module, CURT::OVERLAP_PARAM, 1.0f, 4.0f, 2.0f)); + + addInput(Port::create(Vec(10, 245.66f), Port::INPUT, module, CURT::INPUT)); addOutput(Port::create(Vec(10, 299), Port::OUTPUT, module, CURT::OUTPUT)); } }; diff --git a/plugins/community/repos/Bidoo/src/HCTIP.cpp b/plugins/community/repos/Bidoo/src/HCTIP.cpp index 6f1c3f3d..2bfe0f45 100644 --- a/plugins/community/repos/Bidoo/src/HCTIP.cpp +++ b/plugins/community/repos/Bidoo/src/HCTIP.cpp @@ -45,7 +45,7 @@ struct HCTIP : Module { void HCTIP::step() { - in_Buffer.push(inputs[INPUT].value/10.0f); + in_Buffer.push(inputs[INPUT].active ? inputs[INPUT].value/10.0f : 0.0f); if (in_Buffer.full()) { pShifter->process(clamp(params[PITCH_PARAM].value + inputs[PITCH_INPUT].value ,0.5f,2.0f), in_Buffer.startData(), out_Buffer.endData()); @@ -54,7 +54,7 @@ void HCTIP::step() { } if (out_Buffer.size()>0) { - outputs[OUTPUT].value = *out_Buffer.startData() * 5.0f; + outputs[OUTPUT].value = *out_Buffer.startData() * 5.0f * (inputs[INPUT].active ? 1.0f : 0.0f); out_Buffer.startIncr(1); } diff --git a/plugins/community/repos/Bidoo/src/LIMONADE.cpp b/plugins/community/repos/Bidoo/src/LIMONADE.cpp index 64be3919..9c023801 100644 --- a/plugins/community/repos/Bidoo/src/LIMONADE.cpp +++ b/plugins/community/repos/Bidoo/src/LIMONADE.cpp @@ -337,42 +337,49 @@ struct LIMONADE : Module { }; inline void LIMONADE::updateWaveTable() { - thread t = thread(tUpdateWaveTable, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tUpdateWaveTable(table, params[INDEX_PARAM].value); + // thread t = thread(tUpdateWaveTable, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } inline void LIMONADE::fftSample() { - thread t = thread(tFFTSample, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tFFTSample(table, params[INDEX_PARAM].value); + // thread t = thread(tFFTSample, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } inline void LIMONADE::ifftSample() { - thread t = thread(tIFFTSample, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tIFFTSample(table, params[INDEX_PARAM].value); + // thread t = thread(tIFFTSample, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } inline void LIMONADE::morphWavetable() { - thread t = thread(tMorphWaveTable, std::ref(table)); + //thread t = thread(tMorphWaveTable, std::ref(table)); morphType = 0; - t.detach(); + tMorphWaveTable(table); + //t.detach(); } inline void LIMONADE::morphSpectrum() { - thread t = thread(tMorphSpectrum, std::ref(table)); + //thread t = thread(tMorphSpectrum, std::ref(table)); morphType = 1; - t.detach(); + tMorphSpectrum(table); + //t.detach(); } inline void LIMONADE::morphSpectrumConstantPhase() { - thread t = thread(tMorphSpectrumConstantPhase, std::ref(table)); + //thread t = thread(tMorphSpectrumConstantPhase, std::ref(table)); morphType = 2; - t.detach(); + tMorphSpectrumConstantPhase(table); + //t.detach(); } inline void LIMONADE::deleteMorphing() { - thread t = thread(tDeleteMorphing, std::ref(table)); + //thread t = thread(tDeleteMorphing, std::ref(table)); morphType = -1; - t.detach(); + tDeleteMorphing(table); + //t.detach(); } void LIMONADE::addFrame() { @@ -381,21 +388,24 @@ void LIMONADE::addFrame() { } void LIMONADE::deleteFrame() { - thread t = thread(tDeleteFrame, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tDeleteFrame(table, params[INDEX_PARAM].value); + // thread t = thread(tDeleteFrame, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } void LIMONADE::resetWaveTable() { - thread t = thread(tResetWaveTable, std::ref(table)); - t.detach(); + tResetWaveTable(table); + // thread t = thread(tResetWaveTable, std::ref(table)); + // t.detach(); } void LIMONADE::loadSample() { char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL); if (path) { lastPath=path; - thread t = thread(tLoadSample, std::ref(table), path, frameSize, true); - t.detach(); + tLoadSample(table, path, frameSize, true); + // thread t = thread(tLoadSample, std::ref(table), path, frameSize, true); + // t.detach(); free(path); } } @@ -404,8 +414,9 @@ void LIMONADE::loadFrame() { char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL); if (path) { lastPath=path; - thread t = thread(tLoadFrame, std::ref(table), path, params[INDEX_PARAM].value, true); - t.detach(); + tLoadFrame(table, path, params[INDEX_PARAM].value, true); + // thread t = thread(tLoadFrame, std::ref(table), path, params[INDEX_PARAM].value, true); + // t.detach(); free(path); } } @@ -414,51 +425,60 @@ void LIMONADE::loadPNG() { char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL); if (path) { lastPath=path; - thread t = thread(tLoadPNG, std::ref(table), path); - t.detach(); + tLoadPNG(table, path); + // thread t = thread(tLoadPNG, std::ref(table), path); + // t.detach(); free(path); } } void LIMONADE::windowWt() { - thread t = thread(tWindowWt, std::ref(table)); - t.detach(); + tWindowWt(table); + // thread t = thread(tWindowWt, std::ref(table)); + // t.detach(); } void LIMONADE::smoothWt() { - thread t = thread(tSmoothWt, std::ref(table)); - t.detach(); + tSmoothWt(table); + // thread t = thread(tSmoothWt, std::ref(table)); + // t.detach(); } void LIMONADE::windowFrame() { - thread t = thread(tWindowFrame, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tWindowFrame(table, params[INDEX_PARAM].value); + // thread t = thread(tWindowFrame, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } void LIMONADE::smoothFrame() { - thread t = thread(tSmoothFrame, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tSmoothFrame(table, params[INDEX_PARAM].value); + // thread t = thread(tSmoothFrame, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } void LIMONADE::removeDCOffset() { - thread t = thread(tRemoveDCOffset, std::ref(table)); - t.detach(); + tRemoveDCOffset(table); + // thread t = thread(tRemoveDCOffset, std::ref(table)); + // t.detach(); } void LIMONADE::normalizeFrame() { - thread t = thread(tNormalizeFrame, std::ref(table), params[INDEX_PARAM].value); - t.detach(); + tNormalizeFrame(table, params[INDEX_PARAM].value); + // thread t = thread(tNormalizeFrame, std::ref(table), params[INDEX_PARAM].value); + // t.detach(); } void LIMONADE::normalizeWt() { - thread t = thread(tNormalizeWt, std::ref(table)); - t.detach(); + tNormalizeWt(table); + // thread t = thread(tNormalizeWt, std::ref(table)); + // t.detach(); } void LIMONADE::normalizeAllFrames() { - thread t = thread(tNormalizeAllFrames, std::ref(table)); - t.detach(); + tNormalizeAllFrames(table); + // thread t = thread(tNormalizeAllFrames, std::ref(table)); + // t.detach(); } void LIMONADE::step() {