Skip to content

Commit

Permalink
update to v2.6.17-beta9
Browse files Browse the repository at this point in the history
  • Loading branch information
sickozell committed Jan 11, 2025
1 parent 8369dea commit 197606e
Show file tree
Hide file tree
Showing 8 changed files with 512 additions and 72 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SickoCV v2.6.17-beta7
# SickoCV v2.6.17-beta9
VCV Rack plugin modules (BETA TEST AREA)
Compile or **download binary for ANY platform** on the releases page

Expand All @@ -17,10 +17,11 @@ Please check your subscription on https://library.vcvrack.com/plugins and look f
## **to do list:**
- keySampler: correct midi learn function that doesn't update at first time the new key

## **changelog**
## **changelog**
- added 'randLoops' module
- added 'simpleSeq4' module
- added 'Attenuator' option on adder8 module
- 'sickoLooper' and 'clocker' modules: improved audio click management
- 'clocker' and 'clocker2' modules: fixed a bug on /2 clock division that was actually x2, and fixed its display color to red instead of green
- 'sickoQuant' and 'sickoQuant4' module browser search made easier with keyword 'squant'
- multiRouter / multiSwitcher: added 'cycle' and 'RST input = reverse advance' options in the right-click menu
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### 2.6.17 (2024-12-29)
### 2.6.17 (2025-01-11)
- added 'randLoops' module
- added 'simpleSeq4' module
- added 'Attenuator' option on adder8 module
- 'sickoLooper' and 'clocker' modules: improved audio click management
- 'clocker' and 'clocker2' modules: fixed a bug on /2 clock division that was actually x2, and fixed its display color to red instead of green
- 'sickoQuant' and 'sickoQuant4' module browser search made easier with keyword 'squant'
- multiRouter / multiSwitcher: added 'cycle' and 'RST input = reverse advance' options in the right-click menu
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"slug": "SickoCV",
"name": "SickoCV",
"version": "2.6.17-beta7",
"version": "2.6.17-beta9",
"license": "GPL-3.0-or-later",
"brand": "Sickozell",
"author": "Sickozell",
Expand Down
127 changes: 114 additions & 13 deletions src/Clocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#define MEDIUM_SMOOTH 2
#define HIGH_SMOOTH 3

#define CLICK_STANDARD 0
#define CLICK_CUSTOM 3

#include "plugin.hpp"
#include "osdialog.h"
//#define DR_WAV_IMPLEMENTATION
Expand Down Expand Up @@ -139,6 +142,8 @@ struct Clocker : Module {

float clickOutput;

int clickSelect = CLICK_STANDARD;

double a0, a1, a2, b1, b2, z1, z2;

int click_setting;
Expand Down Expand Up @@ -361,11 +366,14 @@ struct Clocker : Module {
registerValue[i] = 0;
*/

/*
for (int i = 0; i < 2; i++) {
clearSlot(i);
play[i] = false;
}
*/
setClick(0);

Module::onReset(e);
}

Expand All @@ -374,12 +382,15 @@ struct Clocker : Module {
oneMsTime = (APP->engine->getSampleRate()) / 1000;
//oneMsTime = (APP->engine->getSampleRate()) / 10; // for testing purposes

/*
for (int i = 0; i < 2; i++) {
if (fileLoaded[i]) {
play[i] = false;
loadSample(storedPath[i],i);
}
}
*/
setClick(clickSelect);
}

json_t *dataToJson() override {
Expand All @@ -398,6 +409,7 @@ struct Clocker : Module {
json_object_set_new(rootJ, "Swing4", json_boolean(divSwing[3]));
json_object_set_new(rootJ, "Slot1", json_string(storedPath[0].c_str()));
json_object_set_new(rootJ, "Slot2", json_string(storedPath[1].c_str()));
json_object_set_new(rootJ, "clickSelect", json_integer(clickSelect));
return rootJ;
}

Expand Down Expand Up @@ -466,6 +478,7 @@ struct Clocker : Module {
if (swing4J)
divSwing[3] = json_boolean_value(swing4J);

/*
json_t *slot1J = json_object_get(rootJ, "Slot1");
if (slot1J) {
storedPath[0] = json_string_value(slot1J);
Expand All @@ -476,6 +489,31 @@ struct Clocker : Module {
storedPath[1] = json_string_value(slot2J);
loadSample(storedPath[1], 1);
}
*/
json_t *clickSlot1J = json_object_get(rootJ, "Slot1");
if (clickSlot1J) {
storedPath[0] = json_string_value(clickSlot1J);
if (storedPath[0] == "")
clearSlot(0);
else
loadSample(storedPath[0], 0, true);
}
json_t *clickSlot2J = json_object_get(rootJ, "Slot2");
if (clickSlot2J) {
storedPath[1] = json_string_value(clickSlot2J);
if (storedPath[1] == "")
clearSlot(1);
else
loadSample(storedPath[1], 1, true);
}

json_t* clickSelectJ = json_object_get(rootJ, "clickSelect");
if (clickSelectJ) {
clickSelect = json_integer_value(clickSelectJ);
if (clickSelect < 0 || clickSelect > 3)
clickSelect = CLICK_STANDARD;
setClick(clickSelect);
}
}

void calcBiquadLpf(double frequency, double samplerate, double Q) {
Expand Down Expand Up @@ -513,8 +551,14 @@ struct Clocker : Module {
char *path = osdialog_file(OSDIALOG_OPEN, NULL, NULL, filters);
fileLoaded[slot] = false;
if (path) {
/*
loadSample(path, slot);
storedPath[slot] = std::string(path);
*/
loadSample(path, slot, true);
storedPath[slot] = std::string(path);
if (clickSelect != CLICK_CUSTOM)
setClick(clickSelect);
} else {
fileLoaded[slot] = true;
}
Expand All @@ -524,7 +568,7 @@ struct Clocker : Module {
free(path);
}

void loadSample(std::string path, int slot) {
void loadSample(std::string path, int slot, bool customClick) {
z1 = 0; z2 = 0;

unsigned int c;
Expand Down Expand Up @@ -640,12 +684,22 @@ struct Clocker : Module {
tempBuffer2.clear();

char* pathDup = strdup(path.c_str());
/*
fileDescription[slot] = basename(pathDup);
free(pathDup);
storedPath[slot] = path;
fileLoaded[slot] = true;
*/
if (customClick) {
fileDescription[slot] = basename(pathDup);

storedPath[slot] = path;

}
fileLoaded[slot] = true;
free(pathDup);

} else {
fileFound[slot] = false;
Expand All @@ -658,27 +712,39 @@ struct Clocker : Module {
void clearSlot(int slot) {
storedPath[slot] = "";
fileDescription[slot] = "--none--";
fileFound[slot] = false;
fileLoaded[slot] = false;
playBuffer[slot].clear();
totalSampleC[slot] = 0;
if (clickSelect == CLICK_CUSTOM) {
fileFound[slot] = false;
fileLoaded[slot] = false;
playBuffer[slot].clear();
totalSampleC[slot] = 0;
}
}

void setClick(int clickNo) {
switch (clickNo) {
case 0:
loadSample(asset::plugin(pluginInstance, "res/clicks/click0_beat.wav"),0);
loadSample(asset::plugin(pluginInstance, "res/clicks/click0_bar.wav"),1);
loadSample(asset::plugin(pluginInstance, "res/clicks/click0_beat.wav"), 0, false);
loadSample(asset::plugin(pluginInstance, "res/clicks/click0_bar.wav"), 1, false);
break;

case 1:
loadSample(asset::plugin(pluginInstance, "res/clicks/click1_beat.wav"),0);
loadSample(asset::plugin(pluginInstance, "res/clicks/click1_bar.wav"),1);
loadSample(asset::plugin(pluginInstance, "res/clicks/click1_beat.wav"), 0, false);
loadSample(asset::plugin(pluginInstance, "res/clicks/click1_bar.wav"), 1, false);
break;

case 2:
loadSample(asset::plugin(pluginInstance, "res/clicks/click2_beat.wav"),0);
loadSample(asset::plugin(pluginInstance, "res/clicks/click2_bar.wav"),1);
loadSample(asset::plugin(pluginInstance, "res/clicks/click2_beat.wav"), 0, false);
loadSample(asset::plugin(pluginInstance, "res/clicks/click2_bar.wav"), 1, false);
break;

case 3:
if (storedPath[0] != "")
loadSample(storedPath[0], 0, true);
else
clearSlot(0);
if (storedPath[1] != "")
loadSample(storedPath[1], 1, true);
else clearSlot(1);
break;
}
}
Expand Down Expand Up @@ -2024,6 +2090,8 @@ struct ClockerWidget : ModuleWidget {
}));
*/


/*
menu->addChild(new MenuSeparator());
menu->addChild(createSubmenuItem("Click Presets", "", [=](Menu * menu) {
Expand All @@ -2042,8 +2110,7 @@ struct ClockerWidget : ModuleWidget {
menu->addChild(createMenuItem("File: " + module->fileDescription[1], "", [=]() {module->menuLoadSample(1);}));
menu->addChild(createMenuItem("", "Clear", [=]() {module->clearSlot(1);}));
menu->addChild(new MenuSeparator());
menu->addChild(createBoolPtrMenuItem("Beat pulse also on Bar", "", &module->beatOnBar));
*/

menu->addChild(new MenuSeparator());
menu->addChild(createSubmenuItem("On Run", "", [=](Menu* menu) {
Expand All @@ -2054,6 +2121,40 @@ struct ClockerWidget : ModuleWidget {
menu->addChild(createBoolPtrMenuItem("Reset Bar", "", &module->resetOnStop));
menu->addChild(createBoolPtrMenuItem("Pulse to RST out", "", &module->resetPulseOnStop));
}));

menu->addChild(new MenuSeparator());
menu->addChild(createBoolPtrMenuItem("Beat pulse also on Bar", "", &module->beatOnBar));

struct ClickItem : MenuItem {
Clocker* module;
int clickSelect;
void onAction(const event::Action& e) override {
module->clickSelect = clickSelect;
module->setClick(clickSelect);
}
};

menu->addChild(createSubmenuItem("Click Settings", "", [=](Menu * menu) {

std::string clickNames[4] = {"Standard", "Click1", "Click2", "Custom"};
for (int i = 0; i < 4; i++) {
ClickItem* clickItem = createMenuItem<ClickItem>(clickNames[i]);
clickItem->rightText = CHECKMARK(module->clickSelect == i);
clickItem->module = module;
clickItem->clickSelect = i;
menu->addChild(clickItem);
}

menu->addChild(new MenuSeparator());

menu->addChild(createMenuItem("Custom BEAT click", "", [=]() {module->menuLoadSample(0);}));
menu->addChild(createMenuItem("File: " + module->fileDescription[0], "", [=]() {module->menuLoadSample(0);}));
menu->addChild(createMenuItem("", "Clear", [=]() {module->clearSlot(0);}));
menu->addChild(new MenuSeparator());
menu->addChild(createMenuItem("Custom BAR click", "", [=]() {module->menuLoadSample(1);}));
menu->addChild(createMenuItem("File: " + module->fileDescription[1], "", [=]() {module->menuLoadSample(1);}));
menu->addChild(createMenuItem("", "Clear", [=]() {module->clearSlot(1);}));
}));
}
};

Expand Down
42 changes: 30 additions & 12 deletions src/RandLoops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ struct RandLoops : Module {
float oneMsTime = (APP->engine->getSampleRate()) / 1000;

float delTrig = 0;
float prevDelTrig = 0;
bool delWait = false;

float addTrig = 0;
float prevAddTrig = 0;
bool addWait = false;

float clock = 0;
Expand Down Expand Up @@ -484,25 +486,41 @@ struct RandLoops : Module {

delTrig = inputs[DEL_INPUT].getVoltage() + params[DEL_BUTTON].getValue();

if (delTrig >= 1.f) {
delTrig = 1;
delWait = true;
lights[DEL_LIGHT].setBrightness(1.f);
}
if (!bufferedAddDel)
if (bufferedAddDel) {
if (delTrig >= 1.f && prevDelTrig < 1.f) {
delTrig = 1;
delWait = true;
lights[DEL_LIGHT].setBrightness(1.f);
}
} else {
if (delTrig >= 1.f) {
delTrig = 1;
delWait = true;
}
lights[DEL_LIGHT].setBrightness(delTrig);
}

prevDelTrig = delTrig;

// -------------------------------- add trigger

addTrig = inputs[ADD_INPUT].getVoltage() + params[ADD_BUTTON].getValue();

if (addTrig >= 1.f) {
addTrig = 1;
addWait = true;
lights[ADD_LIGHT].setBrightness(1.f);
}
if (!bufferedAddDel)
if (bufferedAddDel) {
if (addTrig >= 1.f && prevAddTrig < 1.f) {
addTrig = 1;
addWait = true;
lights[ADD_LIGHT].setBrightness(1.f);
}
} else {
if (addTrig >= 1.f) {
addTrig = 1;
addWait = true;
}
lights[ADD_LIGHT].setBrightness(addTrig);
}

prevAddTrig = addTrig;

// -------------------------------- clock trigger

Expand Down
Loading

0 comments on commit 197606e

Please sign in to comment.