Skip to content

Commit

Permalink
Merge branch 'Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveBenham committed Mar 11, 2024
2 parents 282f753 + d1679a0 commit 924217c
Show file tree
Hide file tree
Showing 44 changed files with 10,354 additions and 37 deletions.
209 changes: 183 additions & 26 deletions README.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Venom Modules Changelog

## 2.7.0 (2024-03-11)
### New Modules
- Auxilliary Clone Expander
- Multi Merge
- Multi Split
- Poly Offset
- Poly Scale

### Enhancements
- Modified Clone Merge, Poly Clone, and Poly Unison to work with the Auxilliary Clone Expander

### Bug Fixes
- Fixed a bug with Venom expander modules. Prior to version 2.7, Venom expander modules could misbehave and possibly crash VCV Rack if an expander or base module was deleted.

## 2.6.1 (2024-02-28)
### Enhancements
- Harmonic Quantizer: Add detune parameters
Expand Down
Binary file added doc/AuxClone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/MultiMerge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/MultiSplit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/PolyOffset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/PolyScale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 53 additions & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"slug": "Venom",
"name": "Venom",
"version": "2.6.1",
"version": "2.7.0",
"license": "GPL-3.0-or-later",
"brand": "",
"author": "David Benham",
Expand All @@ -13,6 +13,17 @@
"donateUrl": "",
"changelogUrl": "https://github.com/DaveBenham/VenomModules/blob/main/changelog.md",
"modules": [
{
"slug": "AuxClone",
"name": "Auxilliary Clone Expander",
"description": "Adds additional cloned poly input/output pairs to Clone Merge, Poly Merge, or Poly Unison",
"manualUrl": "https://github.com/DaveBenham/VenomModules/blob/main/README.md#auxilliary-clone-expander",
"tags": [
"Expander",
"Polyphonic",
"Utility"
]
},
{
"slug": "BenjolinOsc",
"name": "Benjolin Oscillator",
Expand Down Expand Up @@ -228,6 +239,26 @@
"Utility"
]
},
{
"slug": "MultiMerge",
"name": "Multi Merge",
"description": "Merge one or more sets of mono and/or poly inputs into polyphonic outputs",
"manualUrl": "https://github.com/DaveBenham/VenomModules/blob/main/README.md#multi-merge",
"tags": [
"Polyphonic",
"Utility"
]
},
{
"slug": "MultiSplit",
"name": "Multi Split",
"description": "Split one or more poly inputs into multiple mono or poly outputs",
"manualUrl": "https://github.com/DaveBenham/VenomModules/blob/main/README.md#multi-merge",
"tags": [
"Polyphonic",
"Utility"
]
},
{
"slug": "NORS_IQ",
"name": "Non-Octave-Repeating Scale Intervallic Quantizer",
Expand Down Expand Up @@ -258,6 +289,16 @@
"Utility"
]
},
{
"slug": "PolyOffset",
"name": "Poly Offset",
"description": "Provides an offset control for each channel of a polyphonic signal",
"manualUrl": "https://github.com/DaveBenham/VenomModules/blob/main/README.md#poly-offset",
"tags": [
"Polyphonic",
"Utility"
]
},
{
"slug": "PolySHASR",
"name": "Poly Sample & Hold Analog Shift Register",
Expand All @@ -269,6 +310,17 @@
"Sample and hold"
]
},
{
"slug": "PolyScale",
"name": "Poly Scale",
"description": "Provides a level control for each channel of a polyphonic signal",
"manualUrl": "https://github.com/DaveBenham/VenomModules/blob/main/README.md#poly-offset",
"tags": [
"Attenuator",
"Polyphonic",
"Utility"
]
},
{
"slug": "PolyUnison",
"name": "Poly Unison",
Expand Down
380 changes: 380 additions & 0 deletions res/Coal/AuxClone_Coal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
488 changes: 488 additions & 0 deletions res/Coal/MultiMerge_Coal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
485 changes: 485 additions & 0 deletions res/Coal/MultiSplit_Coal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
440 changes: 440 additions & 0 deletions res/Coal/PolyOffset_Coal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
435 changes: 435 additions & 0 deletions res/Coal/PolyScale_Coal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
380 changes: 380 additions & 0 deletions res/Danger/AuxClone_Danger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
488 changes: 488 additions & 0 deletions res/Danger/MultiMerge_Danger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
485 changes: 485 additions & 0 deletions res/Danger/MultiSplit_Danger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
440 changes: 440 additions & 0 deletions res/Danger/PolyOffset_Danger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
435 changes: 435 additions & 0 deletions res/Danger/PolyScale_Danger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
380 changes: 380 additions & 0 deletions res/Earth/AuxClone_Earth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
488 changes: 488 additions & 0 deletions res/Earth/MultiMerge_Earth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
485 changes: 485 additions & 0 deletions res/Earth/MultiSplit_Earth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
440 changes: 440 additions & 0 deletions res/Earth/PolyOffset_Earth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
435 changes: 435 additions & 0 deletions res/Earth/PolyScale_Earth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
367 changes: 367 additions & 0 deletions res/Ivory/AuxClone_Ivory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
467 changes: 467 additions & 0 deletions res/Ivory/MultiMerge_Ivory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
446 changes: 446 additions & 0 deletions res/Ivory/MultiSplit2_Ivory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
464 changes: 464 additions & 0 deletions res/Ivory/MultiSplit_Ivory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
416 changes: 416 additions & 0 deletions res/Ivory/PolyOffset_Ivory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions res/Ivory/PolyScale_Ivory.svg

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions src/AuxClone.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Venom Modules (c) 2023, 2024 Dave Benham
// Licensed under GNU GPLv3

#include "plugin.hpp"
#include "CloneModule.hpp"

#define LIGHT_OFF 0.02f
#define LIGHT_ON 1.f

struct AuxClone : CloneModule {

AuxClone() {
venomConfig(EXP_PARAMS_LEN, EXP_INPUTS_LEN, EXP_OUTPUTS_LEN, EXP_LIGHTS_LEN);
for (int i=0; i<EXPANDER_PORTS; i++) {
std::string label = string::f("Poly %d", i + 1);
configInput(EXP_POLY_INPUT+i, label);
configOutput(EXP_POLY_OUTPUT+i, label);
configLight(EXP_POLY_LIGHT+i*2, label+" cloned indicator")->description = "yellow: OK, orange: Missing channels, red: Excess channels dropped";
outputExtensions[EXP_POLY_OUTPUT+i].portNameLink = EXP_POLY_INPUT+i;
inputExtensions[EXP_POLY_INPUT+i].portNameLink = EXP_POLY_OUTPUT+i;
}
configLight(EXP_CONNECT_LIGHT, "Left connection indicator");
}

void process(const ProcessArgs& args) override {
VenomModule::process(args);
}

void onExpanderChange(const ExpanderChangeEvent& e) override {
Module* mod = getLeftExpander().module;
bool connected = mod && (mod->model==modelCloneMerge || mod->model==modelPolyUnison || mod->model==modelPolyClone);
lights[EXP_CONNECT_LIGHT].setBrightness( connected );
if (!connected) {
for (int i=0; i<EXPANDER_PORTS; i++) {
outputs[EXP_POLY_OUTPUT+i].setVoltage(0.f);
outputs[EXP_POLY_OUTPUT+i].setChannels(1);
lights[EXP_POLY_LIGHT+i*2].setBrightness(0.f);
lights[EXP_POLY_LIGHT+i*2+1].setBrightness(0.f);
}
}
}

};

struct AuxCloneWidget : VenomWidget {
int venomDelCnt = 0;

AuxCloneWidget(AuxClone* module) {
setModule(module);
setVenomPanel("AuxClone");
float delta=0.f;
for(int i=0; i<EXPANDER_PORTS; i++){
addInput(createInputCentered<PolyPort>(Vec(22.5f,61.5f+delta), module, AuxClone::EXP_POLY_INPUT+i));
addOutput(createOutputCentered<PolyPort>(Vec(22.5f,226.5f+delta), module, AuxClone::EXP_POLY_OUTPUT+i));
addChild(createLightCentered<SmallLight<YellowRedLight<>>>(Vec(36.f, 214.f+delta), module, AuxClone::EXP_POLY_LIGHT+i*2));
delta+=35.f;
}
addChild(createLightCentered<SmallSimpleLight<YellowLight>>(Vec(6.f, 10.f), module, AuxClone::EXP_CONNECT_LIGHT));
}

};

Model* modelAuxClone = createModel<AuxClone, AuxCloneWidget>("AuxClone");
2 changes: 1 addition & 1 deletion src/BernoulliSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct BernoulliSwitch : VenomModule {
lights[NO_SWAP_LIGHT].setBrightness(true);
lights[SWAP_LIGHT].setBrightness(false);
}

void process(const ProcessArgs& args) override {
VenomModule::process(args);
using float_4 = simd::float_4;
Expand Down
6 changes: 5 additions & 1 deletion src/CloneMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// Licensed under GNU GPLv3

#include "plugin.hpp"
#include "CloneModule.hpp"

struct CloneMerge : CloneModuleBase {

struct CloneMerge : VenomModule {
enum ParamId {
CLONE_PARAM,
PARAMS_LEN
Expand Down Expand Up @@ -57,12 +59,14 @@ struct CloneMerge : VenomModule {
outputs[POLY_OUTPUT].setVoltage(val, channel++);
}
outputs[POLY_OUTPUT].setChannels(channel);
processExpander(clones, goodIns);

if (lightDivider.process()) {
for (int i=0; i<8; i++) {
lights[MONO_LIGHTS+i*2].setBrightness(i<goodIns);
lights[MONO_LIGHTS+i*2+1].setBrightness(i>=goodIns && i<ins);
}
setExpanderLights(goodIns);
}
}

Expand Down
89 changes: 89 additions & 0 deletions src/CloneModule.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// Venom Modules (c) 2023, 2024 Dave Benham
// Licensed under GNU GPLv3

struct CloneModule : VenomModule {

#define EXPANDER_PORTS 4
enum ExpParamId {
EXP_PARAMS_LEN
};
enum ExpInputId {
ENUMS(EXP_POLY_INPUT,4),
EXP_INPUTS_LEN
};
enum ExpOutputId {
ENUMS(EXP_POLY_OUTPUT,4),
EXP_OUTPUTS_LEN
};
enum ExpLightId {
EXP_CONNECT_LIGHT,
ENUMS(EXP_POLY_LIGHT,8),
EXP_LIGHTS_LEN
};

};

struct CloneModuleBase : CloneModule {

void processExpander(int clones, int goodCh){
int expanderChannels[EXPANDER_PORTS]{};
Module* expander = getRightExpander().module;
expander = expander
&& !expander->isBypassed()
&& expander->model == modelAuxClone
? expander
: NULL;
if (!expander) return;
for (int i=0; i<EXPANDER_PORTS; i++){
if (expander->outputs[EXP_POLY_OUTPUT+i].isConnected())
expanderChannels[i] = std::max(expander->inputs[EXP_POLY_INPUT+i].getChannels(),1);
}
for (int c=0; c<goodCh; c++) {
for (int e=0; e<EXPANDER_PORTS; e++){
float val = expander->inputs[EXP_POLY_INPUT+e].getPolyVoltage(c);
for (int j=0, ec=c*clones; j<clones; j++, ec++)
expander->outputs[EXP_POLY_OUTPUT+e].setVoltage(val, ec);
}
}
int outCnt = clones * goodCh;
for (int e=0; e<EXPANDER_PORTS; e++){
expander->outputs[EXP_POLY_OUTPUT+e].setChannels( expanderChannels[e] ? outCnt : 0 );
}
}

void setExpanderLights(int goodCh) {
Module* expander = getRightExpander().module;
expander = expander
&& !expander->isBypassed()
&& expander->model == modelAuxClone
? expander
: NULL;
if (!expander) return;
for (int e=0; e<EXPANDER_PORTS; e++){
int channels = expander->outputs[EXP_POLY_OUTPUT+e].isConnected() ? std::max(expander->inputs[EXP_POLY_INPUT+e].getChannels(),1) : 0;
expander->lights[EXP_POLY_LIGHT+e*2].setBrightness(
channels>goodCh ? 0.f : (channels==goodCh || channels==1 ? 1.f : (channels ? 0.2f : 0.f))
);
expander->lights[EXP_POLY_LIGHT+e*2+1].setBrightness(
channels>goodCh ? 1.f : (channels==goodCh || channels==1 ? 0.f : (channels ? 1.0f : 0.f))
);
}
}

void onBypass(const BypassEvent& e) override {
Module* expander = getRightExpander().module;
expander = expander
&& expander->model == modelAuxClone
? expander
: NULL;
if (expander){
for (int i=0; i<EXPANDER_PORTS; i++){
expander->outputs[EXP_POLY_OUTPUT+i].setVoltage(0.f);
expander->outputs[EXP_POLY_OUTPUT+i].setChannels(0);
expander->lights[EXP_POLY_LIGHT+i*2].setBrightness(0.f);
expander->lights[EXP_POLY_LIGHT+i*2+1].setBrightness(0.f);
}
}
}

};
2 changes: 1 addition & 1 deletion src/LinearBeats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct LinearBeats : VenomModule {

void process(const ProcessArgs& args) override {
VenomModule::process(args);

bool preState = false;
bool trig = (!inputs[CLOCK_INPUT].isConnected()) || clockTrigger.process(inputs[CLOCK_INPUT].getVoltage(), 0.1f, 1.f);
Module* finalInMute = inMute && !inMute->isBypassed() ? inMute : NULL;
Expand Down
8 changes: 6 additions & 2 deletions src/LinearBeatsExpander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ struct LinearBeatsExpander : VenomModule {
paramQuantities[MUTE_PARAM+i]->name = label[i]+str;
inputInfos[MUTE_INPUT+i]->name = label[i]+str+" CV";
}
}
}

void onExpanderChange(const ExpanderChangeEvent& e) override {
void setConnectionLight(){
Module* mod = getRightExpander().module;
if (mod && mod->model == modelLinearBeats) {
lights[RIGHT_LIGHT].setBrightness(1.f);
Expand All @@ -56,6 +56,10 @@ struct LinearBeatsExpander : VenomModule {
left = false;
}
}
}

void onExpanderChange(const ExpanderChangeEvent& e) override {
setConnectionLight();
}

};
Expand Down
3 changes: 2 additions & 1 deletion src/MixModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,12 @@ struct MixExpanderWidget : VenomWidget {
if(this->module) {
mixMod = dynamic_cast<MixModule*>(this->module);
mixMod->lights[MixModule::EXP_LIGHT].setBrightness(connected);
if (!connected)
if (!connected){
for (int i=0; i<mixMod->getNumOutputs(); i++) {
mixMod->outputs[i].setVoltage(0.f);
mixMod->outputs[i].setChannels(1);
}
}
}

VenomWidget::step();
Expand Down
Loading

0 comments on commit 924217c

Please sign in to comment.