-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
10,354 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.