Skip to content

Commit

Permalink
Merge pull request #195 from david-c14/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
david-c14 authored Jan 4, 2022
2 parents b0f8304 + 13266f0 commit 1679666
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildDevelop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- develop
name: Develop
env:
RACK_SDK_VERSION: 2.0.3
RACK_SDK_VERSION: 2.0.5
jobs:
buildLinux:
name: Build Linux
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Release
env:
RACK_DIR: ${GITHUB_WORKSPACE}/Rack-SDK
RACK_USER_DIR: ${GITHUB_WORKSPACE}
RACK_SDK_VERSION: 2.0.3
RACK_SDK_VERSION: 2.0.5
jobs:
buildLinux:
name: Build Linux
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## v2.0.4
- 04-Jan-2022 Update CI pipelines to SDK v2.0.5
- 04-Jan-2022 Fix resizing issue with TD-316
- 04-Jan-2022 Fix bug #193 incorrect wiring for AG-202, OG-202 and XG-202 devices
- 22-Dec-2021 Add AO-101 module
- 20-Dec-2021 Fix bug #186 missing algorithms is AO-1xx manual
- 18-Dec-2021 Fix bug #185 html tables in manual

Expand Down
Binary file added manual/A0-101.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions manual/AO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Arithmetic Operators
#### AO-101 1 Algorithm Arithmetic Operators
![View of the AO-101 - Arithmetic Operators](A0-101.png "Arithmetic Operators")
#### AO-106 6 Algorithm Arithmetic Operators
![View of the AO-106 - Arithmetic Operators](A0-106.png "Arithmetic Operators")
#### AO-112 12 Algorithm Arithmetic Operators
Expand All @@ -16,6 +18,8 @@ The AO-1xx series of modules take a number of inputs down the left (X-inputs) an

If no algorithm is selected, the X-input to the block passes directly through to the block (or output) on the right, and the Y-input passes directly through to the block (or output) below.

The AO-101 has just a single X and Y input, and a single output. If no algorithm is selected, the X input passes to the output.

#### [All Algorithms](AO-list.md)

#### [Oscillator Example](AO-example-osc.md)
Expand Down
20 changes: 14 additions & 6 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"donateUrl": "https://www.paypal.me/SubmarineFree",
"pluginUrl": "https://vcvrack.submarine.org.uk",
"changelogUrl": "https://github.com/david-c14/SubmarineFree/blob/main/changelog.md",
"version": "2.0.3",
"version": "2.0.4",
"modules": [
{
"slug":"AG-104",
Expand All @@ -37,43 +37,51 @@
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AG.md",
"tags": ["LOGIC", "DUAL", "POLYPHONIC"]
},
{
"slug":"A0-101",
"name":"AO-101",
"description": "AO-101 Arithmetic Operators",
"keywords": "Maths Algoritmm Arithmetic Operators",
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AO.md",
"tags": ["UTILITY"]
},
{
"slug":"A0-106",
"name":"AO-106",
"description": "AO-106 Arithmetic Operators",
"keywords": "Hex Six Maths Algoritmm Arthimetic Operators",
"keywords": "Hex Six Maths Algoritmm Arithmetic Operators",
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AO.md",
"tags": ["UTILITY", "MULTIPLE"]
},
{
"slug":"A0-112",
"name":"AO-112",
"description": "AO-112 Arithmetic Operators",
"keywords": "Twelve Maths Algoritmm Arthimetic Operators",
"keywords": "Twelve Maths Algoritmm Arithmetic Operators",
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AO.md",
"tags": ["UTILITY", "MULTIPLE"]
},
{
"slug":"A0-118",
"name":"AO-118",
"description": "AO-118 Arithmetic Operators",
"keywords": "Eighteen Maths Algoritmm Arthimetic Operators",
"keywords": "Eighteen Maths Algoritmm Arithmetic Operators",
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AO.md",
"tags": ["UTILITY", "MULTIPLE"]
},
{
"slug":"A0-124",
"name":"AO-124",
"description": "AO-124 Arithmetic Operators",
"keywords": "Twenty Four Maths Algoritmm Arthimetic Operators",
"keywords": "Twenty Four Maths Algoritmm Arithmetic Operators",
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AO.md",
"tags": ["UTILITY", "MULTIPLE"]
},
{
"slug":"A0-136",
"name":"AO-136",
"description": "AO-136 Arithmetic Operators",
"keywords": "Thirty Six Maths Algoritmm Arthimetic Operators",
"keywords": "Thirty Six Maths Algoritmm Arithmetic Operators",
"manualUrl": "https://github.com/david-c14/SubmarineFree/blob/main/manual/AO.md",
"tags": ["UTILITY", "MULTIPLE"]
},
Expand Down
2 changes: 1 addition & 1 deletion src/AG2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct AG_2 : DS_Module {
accumulator &= getInput(channels, 0xFFFF, INPUT_B_1 + i);
accumulator &= getInput(channels, 0xFFFF, INPUT_C_1 + i);
accumulator &= getInput(channels, 0xFFFF, INPUT_D_1 + i);
setOutput(channels, OUTPUT_1, accumulator);
setOutput(channels, OUTPUT_1 + i, accumulator);
}
}
};
Expand Down
131 changes: 124 additions & 7 deletions src/AO1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ namespace {
#undef RF

struct AOFuncDisplay : Knob {
Module *module;
int index;
int index = 0;
AOFuncDisplay() {
box.size.x = 80;
box.size.y = 15;
Expand All @@ -436,8 +435,7 @@ namespace {
};

struct AOConstDisplay : Knob {
Module *module;
int index;
int index = 0;
AOConstDisplay() {
box.size.x = 80;
box.size.y = 15;
Expand All @@ -458,6 +456,48 @@ namespace {
}
};

struct AOFuncDisplayR : AOFuncDisplay {
AOFuncDisplayR() {
box.size.x = 16;
box.size.y = 80;
snap = true;
smooth = false;
speed = 0.5f;
}
void onHover(const HoverEvent &e) override {
ParamWidget::onHover(e);
}
void drawLayer(const DrawArgs &args, int layer) override {
if ((layer) == 1 && module) {
nvgTranslate(args.vg, 0, box.size.y);
nvgRotate(args.vg, M_PI / -2);
}
AOFuncDisplay::drawLayer(args, layer);
}
};

struct AOConstDisplayR : AOConstDisplay {
AOConstDisplayR() {
box.size.x = 16;
box.size.y = 80;
snap = true;
speed = 0.005;
}
void onHover(const HoverEvent &e) override {
ParamWidget::onHover(e);
}
void onButton(const ButtonEvent &e) override {
ParamWidget::onButton(e);
}
void drawLayer(const DrawArgs &args, int layer) override {
if ((layer == 1) && module) {
nvgTranslate(args.vg, 0, box.size.y);
nvgRotate(args.vg, M_PI / -2);
}
AOConstDisplay::drawLayer(args, layer);
}
};

std::vector<std::string> AODescriptions;

std::vector<std::string> AOGetDescriptions() {
Expand Down Expand Up @@ -490,7 +530,7 @@ struct AO1 : Module {
};
enum LightIds {
NUM_LIGHTS
};
};

AO1() : Module() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
Expand Down Expand Up @@ -532,6 +572,52 @@ struct AO1 : Module {
}
};

struct AO101 : Module {
enum ParamIds {
PARAM_FUNC,
PARAM_CONST,
NUM_PARAMS
};
enum InputIds {
INPUT_X,
INPUT_Y,
NUM_INPUTS
};
enum OutputIds {
OUTPUT,
NUM_OUTPUTS
};
enum LightIds {
NUM_LIGHTS
};

AO101() : Module() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);

std::vector<std::string> descriptions = AOGetDescriptions();
configSwitch(PARAM_FUNC, 0.0f, functions.size() - 1.0f, 0.0f, "Algorithm", descriptions);
configParam(PARAM_CONST, -10000.0f, 10000.0f, 0.0f, "Constant", "", 0.f, 0.01f);
configInput(INPUT_X, "Signal X");
configInput(INPUT_Y, "Signal Y");
configOutput(OUTPUT, "Signal");

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

float x = inputs[INPUT_X].getVoltageSum();
float y = inputs[INPUT_Y].getVoltageSum();
unsigned int f = params[PARAM_FUNC].getValue();
if (f >= functions.size()) {
f = functions.size() - 1;
}
if (f > 0) {
x = functions[f].func(x, y, ((int)params[PARAM_CONST].getValue())/100.0f);
}
outputs[OUTPUT].setVoltage(std::isfinite(x)?x:0.0f);

}
};

namespace {

struct AlgorithmMenu : MenuItem {
Expand Down Expand Up @@ -652,12 +738,10 @@ struct AOWidget : SchemeModuleWidget {
for (unsigned int iy = 0; iy < y; iy++) {
for (unsigned int ix = 0; ix < x; ix++) {
AOFuncDisplay *fd = createParam<AOFuncDisplay>(Vec(42.5 + 90 * iy, 59 + 46 * ix), module, AO1<x,y>::PARAM_FUNC_1 + ix + iy * x);
fd->module = module;
fd->index = AO1<x,y>::PARAM_FUNC_1 + ix + iy * x;
addParam(fd);
funcDisplay[iy * x + ix] = fd;
AOConstDisplay *cd = createParam<AOConstDisplay>(Vec(42.5 + 90 * iy, 78 + 46 * ix), module, AO1<x,y>::PARAM_CONST_1 + ix + iy * x);
cd->module = module;
cd->index = AO1<x,y>::PARAM_CONST_1 + ix + iy * x;
addParam(cd);
constDisplay[iy * x + ix] = cd;
Expand Down Expand Up @@ -776,6 +860,39 @@ struct AOWidget : SchemeModuleWidget {
}
};

struct AO_101 : SchemeModuleWidget {
AO_101(AO101 *module) {
setModule(module);
this->box.size = Vec(30, 380);
addChild(new SchemePanel(this->box.size));

addInput(createInputCentered<SilverPort>(Vec(15, 45), module, AO101::INPUT_X));
addInput(createInputCentered<SilverPort>(Vec(15, 90), module, AO101::INPUT_Y));
addOutput(createOutputCentered<SilverPort>(Vec(15, 320), module, AO101::OUTPUT));
AOFuncDisplayR *fd = createParam<AOFuncDisplayR>(Vec(7, 125), module, AO101::PARAM_FUNC);
fd->index = AO101::PARAM_FUNC;
addParam(fd);

AOConstDisplayR *cd = createParam<AOConstDisplayR>(Vec(7, 215), module, AO101::PARAM_CONST);
cd->index = AO101::PARAM_CONST;
addParam(cd);

}
void render(NVGcontext *vg, SchemeCanvasWidget *canvas) override {
drawBase(vg, "AO-101");
drawText(vg, 15, 68, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE, 8, gScheme.getContrast(module), "X");
drawText(vg, 15, 113, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE, 8, gScheme.getContrast(module), "Y");
drawText(vg, 15, 343, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE, 8, gScheme.getContrast(module), "OUT");
nvgFillColor(vg, nvgRGB(0,0,0));
nvgBeginPath(vg);
nvgRect(vg, 7, 125, 16, 80);
nvgRect(vg, 7, 215, 16, 80);
nvgFill(vg);

}
};

Model *modelAO101 = createModel<AO101, AO_101>("A0-101");
Model *modelAO106 = createModel<AO1<6,1>, AOWidget<6,1>>("A0-106");
Model *modelAO112 = createModel<AO1<6,2>, AOWidget<6,2>>("A0-112");
Model *modelAO118 = createModel<AO1<6,3>, AOWidget<6,3>>("A0-118");
Expand Down
2 changes: 1 addition & 1 deletion src/OG2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct OG_2 : DS_Module {
accumulator |= getInput(channels, 0x0, INPUT_B_1 + i);
accumulator |= getInput(channels, 0x0, INPUT_C_1 + i);
accumulator |= getInput(channels, 0x0, INPUT_D_1 + i);
setOutput(channels, OUTPUT_1, accumulator);
setOutput(channels, OUTPUT_1 + i, accumulator);
}
}
};
Expand Down
1 change: 1 addition & 0 deletions src/SubmarineFree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void init(rack::Plugin *p) {
p->addModel(modelAG104);
p->addModel(modelAG106);
p->addModel(modelAG202);
p->addModel(modelAO101);
p->addModel(modelAO106);
p->addModel(modelAO112);
p->addModel(modelAO118);
Expand Down
1 change: 1 addition & 0 deletions src/SubmarineFree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extern Model *modelAG104;
extern Model *modelAG106;
extern Model *modelAG202;

extern Model *modelAO101;
extern Model *modelAO106;
extern Model *modelAO112;
extern Model *modelAO118;
Expand Down
7 changes: 4 additions & 3 deletions src/TD3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ struct TD316 : SchemeModuleWidget {

TD316(TD_316 *module) {
setModule(module);
this->box.size = Vec(240, 380);
this->box.size = Vec(module ? (module->moduleSize) : 240, 380);
schemePanel = new SchemePanel(this->box.size, 75.0f, 300.0f);
schemePanel->resizeHandler = [=]() { onResized(); };
addChild(schemePanel);

textField = createWidget<TD3Text>(Vec(4, 18));
textField->box.size = Vec(232, 344);
textField->box.size = Vec(box.size.x - 8, 344);
textField->multiline = true;
addChild(textField);
addChild(createLightCentered<RightLight>(Vec(3, 14), module, 0));
light = createLightCentered<LeftLight>(Vec(237, 14), module, 1);
light = createLightCentered<LeftLight>(Vec(box.size.x - 3, 14), module, 1);
addChild(light);

}
Expand Down Expand Up @@ -191,6 +191,7 @@ struct TD316 : SchemeModuleWidget {
}

void onResize(const event::Resize &e) override {
ModuleWidget::onResize(e);
onResized();
}
void onResized() {
Expand Down
2 changes: 1 addition & 1 deletion src/XG2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct XG_2 : DS_Module {
accumulator ^= getInput(channels, 0x0, INPUT_B_1 + i);
accumulator ^= getInput(channels, 0x0, INPUT_C_1 + i);
accumulator ^= getInput(channels, 0x0, INPUT_D_1 + i);
setOutput(channels, OUTPUT_1, accumulator);
setOutput(channels, OUTPUT_1 + i, accumulator);
}
}
};
Expand Down

0 comments on commit 1679666

Please sign in to comment.