Skip to content

Commit 6f2aff8

Browse files
committed
Added panel UI
1 parent ea7ffca commit 6f2aff8

8 files changed

Lines changed: 907 additions & 72 deletions

File tree

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/build
2-
/dist
3-
/*.so
4-
/*.dylib
5-
/*.dll
6-
.DS_Store
1+
/build
2+
/dist
3+
/*.so
4+
/*.dylib
5+
/*.dll
6+
.DS_Store

Makefile

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# If RACK_DIR is not defined when calling the Makefile, default to two directories above
2-
# RACK_DIR ?= ../..
3-
RACK_DIR = E:/VCVPlugins/sdk
4-
5-
# FLAGS will be passed to both the C and C++ compiler
6-
FLAGS +=
7-
CFLAGS +=
8-
CXXFLAGS +=
9-
10-
# Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.
11-
# Static libraries are fine, but they should be added to this plugin's build system.
12-
LDFLAGS +=
13-
14-
# Add .cpp files to the build
15-
SOURCES += $(wildcard src/*.cpp)
16-
17-
# Add files to the ZIP package when running `make dist`
18-
# The compiled plugin and "plugin.json" are automatically added.
19-
DISTRIBUTABLES += res
20-
DISTRIBUTABLES += $(wildcard LICENSE*)
21-
DISTRIBUTABLES += $(wildcard presets)
22-
23-
# Include the Rack plugin Makefile framework
24-
include $(RACK_DIR)/plugin.mk
1+
# If RACK_DIR is not defined when calling the Makefile, default to two directories above
2+
RACK_DIR ?= ../..
3+
# RACK_DIR = E:/VCVPlugins/sdk
4+
5+
# FLAGS will be passed to both the C and C++ compiler
6+
FLAGS +=
7+
CFLAGS +=
8+
CXXFLAGS +=
9+
10+
# Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.
11+
# Static libraries are fine, but they should be added to this plugin's build system.
12+
LDFLAGS +=
13+
14+
# Add .cpp files to the build
15+
SOURCES += $(wildcard src/*.cpp)
16+
17+
# Add files to the ZIP package when running `make dist`
18+
# The compiled plugin and "plugin.json" are automatically added.
19+
DISTRIBUTABLES += res
20+
DISTRIBUTABLES += $(wildcard LICENSE*)
21+
DISTRIBUTABLES += $(wildcard presets)
22+
23+
# Include the Rack plugin Makefile framework
24+
include $(RACK_DIR)/plugin.mk

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Matrix Sequncer
1+
# Matrix Sequncer

plugin.json

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
{
2-
"slug": "matrix-sequencer",
3-
"name": "Matrix Sequencer",
4-
"version": "2.0.0",
5-
"license": "AGPL-3.0-only",
6-
"brand": "Matrix Sequencer",
7-
"author": "R3tr0",
8-
"authorEmail": "offer.nik.kor@gmail.com",
9-
"authorUrl": "",
10-
"pluginUrl": "",
11-
"manualUrl": "",
12-
"sourceUrl": "",
13-
"donateUrl": "",
14-
"changelogUrl": "",
15-
"modules": []
1+
{
2+
"slug": "matrix-sequencer",
3+
"name": "Matrix Sequencer",
4+
"version": "2.0.0",
5+
"license": "AGPL-3.0-only",
6+
"brand": "Matrix Sequencer",
7+
"author": "R3tr0",
8+
"authorEmail": "offer.nik.kor@gmail.com",
9+
"authorUrl": "",
10+
"pluginUrl": "",
11+
"manualUrl": "",
12+
"sourceUrl": "",
13+
"donateUrl": "",
14+
"changelogUrl": "",
15+
"modules": [
16+
{
17+
"slug": "matrix-sequencer",
18+
"name": "matrix-sequencer",
19+
"description": "",
20+
"tags": []
21+
}
22+
]
1623
}

res/matrix-sequencer.svg

Lines changed: 668 additions & 0 deletions
Loading

src/matrix-sequncer.cpp

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
#include "plugin.hpp"
2+
3+
4+
struct Matrix_sequencer : Module {
5+
enum ParamId {
6+
X1_Y1_KNOB_PARAM,
7+
X2_Y1_KNOB_PARAM,
8+
X3_Y1_KNOB_PARAM,
9+
X4_Y1_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
64+
configParam(X1_Y1_KNOB_PARAM, 0.f, 1.f, 0.f, "");
65+
configParam(X2_Y1_KNOB_PARAM, 0.f, 1.f, 0.f, "");
66+
configParam(X3_Y1_KNOB_PARAM, 0.f, 1.f, 0.f, "");
67+
configParam(X4_Y1_KNOB_PARAM, 0.f, 1.f, 0.f, "");
68+
configParam(X1_Y2_KNOB_PARAM, 0.f, 1.f, 0.f, "");
69+
configParam(X2_Y2_KNOB_PARAM, 0.f, 1.f, 0.f, "");
70+
configParam(X3_Y2_KNOB_PARAM, 0.f, 1.f, 0.f, "");
71+
configParam(X4_Y2_KNOB_PARAM, 0.f, 1.f, 0.f, "");
72+
configParam(X1_Y3_KNOB_PARAM, 0.f, 1.f, 0.f, "");
73+
configParam(X2_Y3_KNOB_PARAM, 0.f, 1.f, 0.f, "");
74+
configParam(X3_Y3_KNOB_PARAM, 0.f, 1.f, 0.f, "");
75+
configParam(X4_Y3_KNOB_PARAM, 0.f, 1.f, 0.f, "");
76+
configParam(X1_Y4_KNOB_PARAM, 0.f, 1.f, 0.f, "");
77+
configParam(X2_Y4_KNOB_PARAM, 0.f, 1.f, 0.f, "");
78+
configParam(X3_Y4_KNOB_PARAM, 0.f, 1.f, 0.f, "");
79+
configParam(X4_Y4_KNOB_PARAM, 0.f, 1.f, 0.f, "");
80+
configInput(PATH5098_INPUT, "");
81+
configInput(RUN_IN_INPUT, "");
82+
configInput(RESET_IN_INPUT, "");
83+
configOutput(Y1_OUT_OUTPUT, "");
84+
configOutput(Y2_OUT_OUTPUT, "");
85+
configOutput(Y3_OUT_OUTPUT, "");
86+
configOutput(Y4_OUT_OUTPUT, "");
87+
configOutput(X1_OUT_OUTPUT, "");
88+
configOutput(X2_OUT_OUTPUT, "");
89+
configOutput(X3_OUT_OUTPUT, "");
90+
configOutput(X4_OUT_OUTPUT, "");
91+
configOutput(TOTAL_PITCH_OUT_OUTPUT, "");
92+
}
93+
94+
void process(const ProcessArgs& args) override {
95+
}
96+
};
97+
98+
99+
struct Matrix_sequencerWidget : ModuleWidget {
100+
Matrix_sequencerWidget(Matrix_sequencer* module) {
101+
setModule(module);
102+
setPanel(createPanel(asset::plugin(pluginInstance, "res/matrix-sequencer.svg")));
103+
104+
addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
105+
addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
106+
addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
107+
addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
108+
109+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(35.56, 20.32)), module, Matrix_sequencer::X1_Y1_KNOB_PARAM));
110+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(63.5, 20.32)), module, Matrix_sequencer::X2_Y1_KNOB_PARAM));
111+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(91.44, 20.32)), module, Matrix_sequencer::X3_Y1_KNOB_PARAM));
112+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(119.38, 20.32)), module, Matrix_sequencer::X4_Y1_KNOB_PARAM));
113+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(35.56, 43.18)), module, Matrix_sequencer::X1_Y2_KNOB_PARAM));
114+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(63.5, 43.18)), module, Matrix_sequencer::X2_Y2_KNOB_PARAM));
115+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(91.44, 43.18)), module, Matrix_sequencer::X3_Y2_KNOB_PARAM));
116+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(119.38, 43.18)), module, Matrix_sequencer::X4_Y2_KNOB_PARAM));
117+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(35.56, 66.04)), module, Matrix_sequencer::X1_Y3_KNOB_PARAM));
118+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(63.5, 66.04)), module, Matrix_sequencer::X2_Y3_KNOB_PARAM));
119+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(91.44, 66.04)), module, Matrix_sequencer::X3_Y3_KNOB_PARAM));
120+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(119.38, 66.04)), module, Matrix_sequencer::X4_Y3_KNOB_PARAM));
121+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(35.56, 88.9)), module, Matrix_sequencer::X1_Y4_KNOB_PARAM));
122+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(63.5, 88.9)), module, Matrix_sequencer::X2_Y4_KNOB_PARAM));
123+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(91.44, 88.9)), module, Matrix_sequencer::X3_Y4_KNOB_PARAM));
124+
addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(119.38, 88.9)), module, Matrix_sequencer::X4_Y4_KNOB_PARAM));
125+
126+
addInput(createInputCentered<PJ301MPort>(mm2px(Vec(12.7, 25.4)), module, Matrix_sequencer::PATH5098_INPUT));
127+
addInput(createInputCentered<PJ301MPort>(mm2px(Vec(12.7, 43.18)), module, Matrix_sequencer::RUN_IN_INPUT));
128+
addInput(createInputCentered<PJ301MPort>(mm2px(Vec(12.7, 60.96)), module, Matrix_sequencer::RESET_IN_INPUT));
129+
130+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(137.16, 20.32)), module, Matrix_sequencer::Y1_OUT_OUTPUT));
131+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(137.16, 43.18)), module, Matrix_sequencer::Y2_OUT_OUTPUT));
132+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(137.16, 66.04)), module, Matrix_sequencer::Y3_OUT_OUTPUT));
133+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(137.16, 88.9)), module, Matrix_sequencer::Y4_OUT_OUTPUT));
134+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(35.56, 119.38)), module, Matrix_sequencer::X1_OUT_OUTPUT));
135+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(63.5, 119.38)), module, Matrix_sequencer::X2_OUT_OUTPUT));
136+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(91.44, 119.38)), module, Matrix_sequencer::X3_OUT_OUTPUT));
137+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(119.38, 119.38)), module, Matrix_sequencer::X4_OUT_OUTPUT));
138+
addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(137.16, 119.38)), module, Matrix_sequencer::TOTAL_PITCH_OUT_OUTPUT));
139+
140+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(35.56, 31.75)), module, Matrix_sequencer::X1_Y1_LIGHT_LIGHT));
141+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(63.5, 31.75)), module, Matrix_sequencer::X2_Y1_LIGHT_LIGHT));
142+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(91.44, 31.75)), module, Matrix_sequencer::X3_Y1_LIGHT_LIGHT));
143+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(119.38, 31.75)), module, Matrix_sequencer::X4_Y1_LIGHT_LIGHT));
144+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(35.56, 54.61)), module, Matrix_sequencer::X1_Y2_LIGHT_LIGHT));
145+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(63.5, 54.61)), module, Matrix_sequencer::X2_Y2_LIGHT_LIGHT));
146+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(91.44, 54.61)), module, Matrix_sequencer::X3_Y2_LIGHT_LIGHT));
147+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(119.38, 54.61)), module, Matrix_sequencer::X4_Y2_LIGHT_LIGHT));
148+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(35.56, 77.47)), module, Matrix_sequencer::X1_Y3_LIGHT_LIGHT));
149+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(63.5, 77.47)), module, Matrix_sequencer::X2_Y3_LIGHT_LIGHT));
150+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(91.44, 77.47)), module, Matrix_sequencer::X3_Y3_LIGHT_LIGHT));
151+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(119.38, 77.47)), module, Matrix_sequencer::X4_Y3_LIGHT_LIGHT));
152+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(35.56, 100.33)), module, Matrix_sequencer::X1_Y4_LIGHT_LIGHT));
153+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(63.5, 100.33)), module, Matrix_sequencer::X2_Y4_LIGHT_LIGHT));
154+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(91.44, 100.33)), module, Matrix_sequencer::X3_Y4_LIGHT_LIGHT));
155+
addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(119.38, 100.33)), module, Matrix_sequencer::X4_Y4_LIGHT_LIGHT));
156+
}
157+
};
158+
159+
160+
Model* modelMatrix_sequencer = createModel<Matrix_sequencer, Matrix_sequencerWidget>("matrix-sequencer");

src/plugin.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#include "plugin.hpp"
2-
3-
4-
Plugin* pluginInstance;
5-
6-
7-
void init(Plugin* p) {
8-
pluginInstance = p;
9-
10-
// Add modules here
11-
// p->addModel(modelMyModule);
12-
13-
// Any other plugin initialization may go here.
14-
// As an alternative, consider lazy-loading assets and lookup tables when your module is created to reduce startup times of Rack.
15-
}
1+
#include "plugin.hpp"
2+
3+
4+
Plugin* pluginInstance;
5+
6+
7+
void init(Plugin* p) {
8+
pluginInstance = p;
9+
10+
// Add modules here
11+
p->addModel(modelMatrix_sequencer);
12+
13+
// Any other plugin initialization may go here.
14+
// As an alternative, consider lazy-loading assets and lookup tables when your module is created to reduce startup times of Rack.
15+
}

src/plugin.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#pragma once
2-
#include <rack.hpp>
3-
4-
5-
using namespace rack;
6-
7-
// Declare the Plugin, defined in plugin.cpp
8-
extern Plugin* pluginInstance;
9-
10-
// Declare each Model, defined in each module source file
11-
// extern Model* modelMyModule;
1+
#pragma once
2+
#include <rack.hpp>
3+
4+
using namespace rack;
5+
6+
// Declare the Plugin, defined in plugin.cpp
7+
extern Plugin* pluginInstance;
8+
extern Model* modelMatrix_sequencer;
9+
10+
// Declare each Model, defined in each module source file
11+
// extern Model* modelMyModule;

0 commit comments

Comments
 (0)