Browse Source

update Bidoo.* to v0.6.29

pull/1639/head
bsp2 6 years ago
parent
commit
814581c565
4 changed files with 110 additions and 60 deletions
  1. +1
    -2
      plugins/community/repos/Bidoo/src/Bidoo.cpp
  2. +47
    -16
      plugins/community/repos/Bidoo/src/CURT.cpp
  3. +2
    -2
      plugins/community/repos/Bidoo/src/HCTIP.cpp
  4. +60
    -40
      plugins/community/repos/Bidoo/src/LIMONADE.cpp

+ 1
- 2
plugins/community/repos/Bidoo/src/Bidoo.cpp View File

@@ -38,9 +38,8 @@ RACK_PLUGIN_MODEL_DECLARE(Bidoo, VOID);


RACK_PLUGIN_INIT(Bidoo) { RACK_PLUGIN_INIT(Bidoo) {
RACK_PLUGIN_INIT_ID(); RACK_PLUGIN_INIT_ID();
RACK_PLUGIN_INIT_VERSION("0.6.29");
RACK_PLUGIN_INIT_WEBSITE("https://github.com/sebastien-bouffier/Bidoo"); 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, DTROY);
RACK_PLUGIN_MODEL_ADD(Bidoo, BORDL); RACK_PLUGIN_MODEL_ADD(Bidoo, BORDL);


+ 47
- 16
plugins/community/repos/Bidoo/src/CURT.cpp View File

@@ -16,6 +16,8 @@ struct CURT : Module {
enum ParamIds { enum ParamIds {
PITCH_PARAM, PITCH_PARAM,
MODE_PARAM, MODE_PARAM,
BUFF_SIZE_PARAM,
OVERLAP_PARAM,
NUM_PARAMS NUM_PARAMS
}; };
enum InputIds { enum InputIds {
@@ -35,12 +37,15 @@ struct CURT : Module {
DoubleRingBuffer<float, 2*BUFF_SIZE> out_Buffer; DoubleRingBuffer<float, 2*BUFF_SIZE> out_Buffer;
float bins[OVERLAP][BUFF_SIZE]; float bins[OVERLAP][BUFF_SIZE];
int index=-1; int index=-1;
int readSteps=0;
int writeSteps=0;
size_t readSteps=0;
size_t writeSteps=0;
SchmittTrigger modeTrigger; SchmittTrigger modeTrigger;
bool mode=0; bool mode=0;
size_t overlap, buff_size;


CURT() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { CURT() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {
overlap = OVERLAP;
buff_size = BUFF_SIZE;
for(int i=0; i<OVERLAP; i++) { for(int i=0; i<OVERLAP; i++) {
memset(bins[i], 0, sizeof(bins[i])); memset(bins[i], 0, sizeof(bins[i]));
} }
@@ -56,6 +61,21 @@ struct CURT : Module {


} }


void updateBuff() {
while (in_Buffer.size()<buff_size) {
in_Buffer.push(0.0f);
}
while (in_Buffer.size()>buff_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 *toJson() override {
json_t *rootJ = json_object(); json_t *rootJ = json_object();
json_object_set_new(rootJ, "mode", json_boolean(mode)); json_object_set_new(rootJ, "mode", json_boolean(mode));
@@ -76,35 +96,43 @@ void CURT::step() {
mode = !mode; 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.startIncr(1);
in_Buffer.push(inputs[INPUT].value); in_Buffer.push(inputs[INPUT].value);


readSteps++; readSteps++;


if (readSteps>=(BUFF_SIZE/OVERLAP)) {
index=(index+1)%OVERLAP;
for(int i=0; i<BUFF_SIZE; i++) {
if (readSteps>=(buff_size/overlap)) {
index=(index+1)%overlap;
for(size_t i=0; i<buff_size; i++) {
bins[index][i]=*(in_Buffer.startData()+i); bins[index][i]=*(in_Buffer.startData()+i);
} }
blackmanHarrisWindow(bins[index],BUFF_SIZE);
blackmanHarrisWindow(bins[index],buff_size);
readSteps = 0; readSteps = 0;
} }


writeSteps++; writeSteps++;


if ((writeSteps>=((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)) { if ((index%2==0) || (mode)) {
for(int i=0; i<BUFF_SIZE; i++) {
out_Buffer.data[out_Buffer.mask(out_Buffer.end-BUFF_SIZE+i)] += bins[index][i];
for(size_t i=0; i<buff_size; i++) {
out_Buffer.data[out_Buffer.mask(out_Buffer.end-buff_size+i)] += bins[index][i];
} }
} }
else else
{ {
for(int i=0; i<BUFF_SIZE; i++) {
out_Buffer.data[out_Buffer.mask(out_Buffer.end-BUFF_SIZE+i)] += bins[index][BUFF_SIZE-i-1];
for(size_t i=0; i<buff_size; i++) {
out_Buffer.data[out_Buffer.mask(out_Buffer.end-buff_size+i)] += bins[index][buff_size-i-1];
} }
} }

writeSteps = 0; writeSteps = 0;
} }


@@ -123,10 +151,13 @@ struct CURTWidget : ModuleWidget {
addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));




addParam(ParamWidget::create<BidooBlueKnob>(Vec(8, 100), module, CURT::PITCH_PARAM, 0.2f, 2.0f, 1.0f));
addInput(Port::create<PJ301MPort>(Vec(10, 150.0f), Port::INPUT, module, CURT::PITCH_INPUT));
addParam(ParamWidget::create<BlueCKD6>(Vec(8, 190.0f), module, CURT::MODE_PARAM, 0.0f, 1.0f, 0.0f));
addInput(Port::create<PJ301MPort>(Vec(10, 242.66f), Port::INPUT, module, CURT::INPUT));
addParam(ParamWidget::create<BidooBlueKnob>(Vec(8, 90), module, CURT::PITCH_PARAM, 0.2f, 2.0f, 1.0f));
addInput(Port::create<PJ301MPort>(Vec(10, 140.0f), Port::INPUT, module, CURT::PITCH_INPUT));
addParam(ParamWidget::create<BlueCKD6>(Vec(8, 175.0f), module, CURT::MODE_PARAM, 0.0f, 1.0f, 0.0f));
addParam(ParamWidget::create<BidooBlueSnapTrimpot>(Vec(2, 205), module, CURT::BUFF_SIZE_PARAM, 6.0f, 8.0f, 8.0f));
addParam(ParamWidget::create<BidooBlueSnapTrimpot>(Vec(25, 205), module, CURT::OVERLAP_PARAM, 1.0f, 4.0f, 2.0f));

addInput(Port::create<PJ301MPort>(Vec(10, 245.66f), Port::INPUT, module, CURT::INPUT));
addOutput(Port::create<PJ301MPort>(Vec(10, 299), Port::OUTPUT, module, CURT::OUTPUT)); addOutput(Port::create<PJ301MPort>(Vec(10, 299), Port::OUTPUT, module, CURT::OUTPUT));
} }
}; };


+ 2
- 2
plugins/community/repos/Bidoo/src/HCTIP.cpp View File

@@ -45,7 +45,7 @@ struct HCTIP : Module {




void HCTIP::step() { 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()) { 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()); 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) { 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); out_Buffer.startIncr(1);
} }




+ 60
- 40
plugins/community/repos/Bidoo/src/LIMONADE.cpp View File

@@ -337,42 +337,49 @@ struct LIMONADE : Module {
}; };


inline void LIMONADE::updateWaveTable() { 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() { 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() { 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() { inline void LIMONADE::morphWavetable() {
thread t = thread(tMorphWaveTable, std::ref(table));
//thread t = thread(tMorphWaveTable, std::ref(table));
morphType = 0; morphType = 0;
t.detach();
tMorphWaveTable(table);
//t.detach();
} }


inline void LIMONADE::morphSpectrum() { inline void LIMONADE::morphSpectrum() {
thread t = thread(tMorphSpectrum, std::ref(table));
//thread t = thread(tMorphSpectrum, std::ref(table));
morphType = 1; morphType = 1;
t.detach();
tMorphSpectrum(table);
//t.detach();
} }


inline void LIMONADE::morphSpectrumConstantPhase() { inline void LIMONADE::morphSpectrumConstantPhase() {
thread t = thread(tMorphSpectrumConstantPhase, std::ref(table));
//thread t = thread(tMorphSpectrumConstantPhase, std::ref(table));
morphType = 2; morphType = 2;
t.detach();
tMorphSpectrumConstantPhase(table);
//t.detach();
} }


inline void LIMONADE::deleteMorphing() { inline void LIMONADE::deleteMorphing() {
thread t = thread(tDeleteMorphing, std::ref(table));
//thread t = thread(tDeleteMorphing, std::ref(table));
morphType = -1; morphType = -1;
t.detach();
tDeleteMorphing(table);
//t.detach();
} }


void LIMONADE::addFrame() { void LIMONADE::addFrame() {
@@ -381,21 +388,24 @@ void LIMONADE::addFrame() {
} }


void LIMONADE::deleteFrame() { 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() { 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() { void LIMONADE::loadSample() {
char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL); char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL);
if (path) { if (path) {
lastPath=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); free(path);
} }
} }
@@ -404,8 +414,9 @@ void LIMONADE::loadFrame() {
char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL); char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL);
if (path) { if (path) {
lastPath=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); free(path);
} }
} }
@@ -414,51 +425,60 @@ void LIMONADE::loadPNG() {
char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL); char *path = osdialog_file(OSDIALOG_OPEN, "", NULL, NULL);
if (path) { if (path) {
lastPath=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); free(path);
} }
} }


void LIMONADE::windowWt() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { void LIMONADE::step() {


Loading…
Cancel
Save