Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to v0.6 API changes #7

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

SOURCES = $(wildcard src/*.cpp)
# FLAGS += -I. -I./ext/LambertW -DJE_VERSION=0.6.0dev -DJE_MANUFACTURER="Julien Eres"
FLAGS += -I. -I./ext/LambertW

SLUG = JE
VERSION = 0.6.0

SOURCES += $(wildcard src/*.cpp)
SOURCES += $(wildcard common/*.cpp)
SOURCES += $(wildcard components/*.cpp)
SOURCES += $(wildcard ext/LambertW/*.cc)
SOURCES += $(wildcard utils/*.cpp)
SOURCES += $(wildcard widgets/*.cpp)

FLAGS += -I. -I./ext/LambertW -DJE_VERSION=0.5.1 -DJE_MANUFACTURER="Julien Eres"

include ../../plugin.mk
DISTRIBUTABLES += $(wildcard LICENSE*) res

dist: all
mkdir -p dist/JE
cp LICENSE* dist/JE/
cp plugin.* dist/JE/
cp -R res dist/JE/
RACK_DIR ?= ../..
include $(RACK_DIR)/plugin.mk
22 changes: 6 additions & 16 deletions src/JE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@

rack::Plugin* plugin;

void init(rack::Plugin *p)
{

void init(rack::Plugin *p) {
plugin = p;
plugin->slug = "JE";
plugin->version = TOSTRING(JE_VERSION);
plugin->website = "https://github.com/eres-j/VCVRack-plugin-JE";
plugin->manual = "https://github.com/eres-j/VCVRack-plugin-JE";
p->slug = TOSTRING(SLUG);
p->version = TOSTRING(VERSION);

p->addModel(rack::createModel<RingModulatorWidget>(
TOSTRING(JE_MANUFACTURER),
"RingModulator", "Ring Modulator",
rack::EFFECT_TAG, rack::RING_MODULATOR_TAG
));
p->addModel(modelRingModulator);
p->addModel(modelWaveFolder);

p->addModel(rack::createModel<WaveFolderWidget>(
TOSTRING(JE_MANUFACTURER),
"SimpleWaveFolder", "Simple Wave Folder",
rack::EFFECT_TAG, rack::WAVESHAPER_TAG
));
}
14 changes: 4 additions & 10 deletions src/JE.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

#include "rack.hpp"

extern rack::Plugin *plugin;

struct RingModulatorWidget : rack::ModuleWidget
{
RingModulatorWidget();
};
using namespace rack;

extern rack::Plugin *plugin;

struct WaveFolderWidget : rack::ModuleWidget
{
WaveFolderWidget();
};
extern Model *modelRingModulator;
extern Model *modelWaveFolder;
59 changes: 35 additions & 24 deletions src/RingModulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,30 @@ struct RingModulator : rack::Module
Diode m_diode;
};

RingModulatorWidget::RingModulatorWidget()
struct RingModulatorWidget : rack::ModuleWidget
{
RingModulatorWidget(RingModulator *module);
};

RingModulatorWidget::RingModulatorWidget(RingModulator *module) : ModuleWidget(module) {
/*RingModulatorWidget::RingModulatorWidget()
{
RingModulator* module = new RingModulator();
setModule(module);
box.size = rack::Vec(15*10, 380);
setModule(module);*/
/* box.size = rack::Vec(15*10, 380);

{
rack::SVGPanel *panel = new rack::SVGPanel();
panel->box.size = box.size;
panel->setBackground(rack::SVG::load(assetPlugin(plugin, "res/CleanRingModulator.svg")));
addChild(panel);
}
}*/
setPanel(SVG::load(assetPlugin(plugin, "res/CleanRingModulator.svg")));

addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(15, 0)));
addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(box.size.x-30, 0)));
addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(15, 365)));
addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(box.size.x-30, 365)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(15, 0)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(box.size.x-30, 0)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(15, 365)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(box.size.x-30, 365)));

const float switchX = box.size.x - 40.f;

Expand All @@ -167,46 +174,50 @@ RingModulatorWidget::RingModulatorWidget()
float portY = 63.f;
float knobY = 57.f;
float switchY = 54.f;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(9, portY), module, RingModulator::INPUT_INPUT));
addParam(rack::createParam<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, RingModulator::INPUT_LEVEL_PARAM, 0.0, 1.0, 1.0));
addParam(rack::createParam<rack::NKK>(rack::Vec(switchX, switchY), module, RingModulator::INPUT_POLARITY_PARAM, 0.0, 2.0, 1.0));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(9, portY), Port::INPUT, module, RingModulator::INPUT_INPUT));
addParam(rack::ParamWidget::create<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, RingModulator::INPUT_LEVEL_PARAM, 0.0, 1.0, 1.0));
addParam(rack::ParamWidget::create<rack::NKK>(rack::Vec(switchX, switchY), module, RingModulator::INPUT_POLARITY_PARAM, 0.0, 2.0, 1.0));

portY += yOffset;
knobY += yOffset;
switchY += yOffset;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(9, portY), module, RingModulator::CARRIER_INPUT));
addParam(rack::createParam<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, RingModulator::CARRIER_LEVEL_PARAM, 0.0, 1.0, 1.0));
addParam(rack::createParam<rack::NKK>(rack::Vec(switchX, switchY), module, RingModulator::CARRIER_POLARITY_PARAM, 0.0, 2.0, 1.0));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(9, portY), Port::INPUT, module, RingModulator::CARRIER_INPUT));
addParam(rack::ParamWidget::create<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, RingModulator::CARRIER_LEVEL_PARAM, 0.0, 1.0, 1.0));
addParam(rack::ParamWidget::create<rack::NKK>(rack::Vec(switchX, switchY), module, RingModulator::CARRIER_POLARITY_PARAM, 0.0, 2.0, 1.0));

portY += yOffset;
knobY += yOffset;
switchY += yOffset;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(9, portY), module, RingModulator::CARRIER_OFFSET_INPUT));
addParam(rack::createParam<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, RingModulator::CARRIER_OFFSET_PARAM, -g_controlPeakVoltage, g_controlPeakVoltage, 0.0));
addOutput(rack::createOutput<rack::PJ301MPort>(rack::Vec(box.size.x-34, portY), module, RingModulator::RING_OUTPUT));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(9, portY), Port::INPUT, module, RingModulator::CARRIER_OFFSET_INPUT));
addParam(rack::ParamWidget::create<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, RingModulator::CARRIER_OFFSET_PARAM, -g_controlPeakVoltage, g_controlPeakVoltage, 0.0));
addOutput(rack::Port::create<rack::PJ301MPort>(rack::Vec(box.size.x-34, portY), Port::OUTPUT, module, RingModulator::RING_OUTPUT));

portY += yOffset;
knobY += yOffset;
switchY += yOffset;
float xOffset = 35.f;
float x = 9.f;
addOutput(rack::createOutput<rack::PJ301MPort>(rack::Vec(x, portY), module, RingModulator::SUM_OUTPUT));
addOutput(rack::Port::create<rack::PJ301MPort>(rack::Vec(x, portY), Port::OUTPUT, module, RingModulator::SUM_OUTPUT));
x += xOffset;
addOutput(rack::createOutput<rack::PJ301MPort>(rack::Vec(x, portY), module, RingModulator::DIFF_OUTPUT));
addOutput(rack::Port::create<rack::PJ301MPort>(rack::Vec(x, portY), Port::OUTPUT, module, RingModulator::DIFF_OUTPUT));
x += xOffset;
addOutput(rack::createOutput<rack::PJ301MPort>(rack::Vec(x, portY), module, RingModulator::MIN_OUTPUT));
addOutput(rack::Port::create<rack::PJ301MPort>(rack::Vec(x, portY), Port::OUTPUT, module, RingModulator::MIN_OUTPUT));
x += xOffset;
addOutput(rack::createOutput<rack::PJ301MPort>(rack::Vec(x, portY), module, RingModulator::MAX_OUTPUT));
addOutput(rack::Port::create<rack::PJ301MPort>(rack::Vec(x, portY), Port::OUTPUT, module, RingModulator::MAX_OUTPUT));

portY += yOffset;
knobY += yOffset;
switchY += yOffset;
const float y = knobY - 6.f;
xOffset = 52.f;
x = 9.f;
addParam(rack::createParam<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, RingModulator::DIODE_VB_PARAM, std::numeric_limits<float>::epsilon(), g_controlPeakVoltage, 0.2));
addParam(rack::ParamWidget::create<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, RingModulator::DIODE_VB_PARAM, std::numeric_limits<float>::epsilon(), g_controlPeakVoltage, 0.2));
x += xOffset;
addParam(rack::createParam<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, RingModulator::DIODE_VL_MINUS_VB_PARAM, std::numeric_limits<float>::epsilon(), g_controlPeakVoltage, 0.5));
addParam(rack::ParamWidget::create<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, RingModulator::DIODE_VL_MINUS_VB_PARAM, std::numeric_limits<float>::epsilon(), g_controlPeakVoltage, 0.5));
x += xOffset;
addParam(rack::createParam<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, RingModulator::DIODE_H_PARAM, 0.0, 1.0, 0.9));
addParam(rack::ParamWidget::create<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, RingModulator::DIODE_H_PARAM, 0.0, 1.0, 0.9));
}

Model *modelRingModulator = Model::create<RingModulator, RingModulatorWidget>(
/*p->addModel(rack::createModel<RingModulatorWidget>(*/
TOSTRING(SLUG), "RingModulator", "Ring Modulator", EFFECT_TAG, RING_MODULATOR_TAG);
46 changes: 30 additions & 16 deletions src/WaveFolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,52 +140,66 @@ struct WaveFolder : rack::Module
float m_delta = (m_loadResistor * m_saturationCurrent) / m_thermalVoltage;
};

struct WaveFolderWidget : rack::ModuleWidget
{
WaveFolderWidget(WaveFolder *module);
};

WaveFolderWidget::WaveFolderWidget(WaveFolder *module) : ModuleWidget(module) {
/*
WaveFolderWidget::WaveFolderWidget()
{
WaveFolder* module = new WaveFolder();
setModule(module);
box.size = rack::Vec(15*7, 380);
*/
/* box.size = rack::Vec(15*7, 380);

{
rack::SVGPanel *panel = new rack::SVGPanel();
panel->box.size = box.size;
panel->setBackground(rack::SVG::load(assetPlugin(plugin, "res/CleanWaveFolder.svg")));
addChild(panel);
}
}*/
setPanel(SVG::load(assetPlugin(plugin, "res/CleanWaveFolder.svg")));

addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(15, 0)));
addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(box.size.x-30, 0)));
addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(15, 365)));
addChild(rack::createScrew<rack::ScrewBlack>(rack::Vec(box.size.x-30, 365)));

addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(15, 0)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(box.size.x-30, 0)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(15, 365)));
addChild(rack::Widget::create<rack::ScrewBlack>(rack::Vec(box.size.x-30, 365)));

float yOffset = 67.f;

float portY = 63.f;
float knobY = 57.f;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(9, portY), module, WaveFolder::INPUT_GAIN_INPUT));
addParam(rack::createParam<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, WaveFolder::INPUT_GAIN_PARAM, 0.0, 1.0, 0.1));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(9, portY), Port::INPUT, module, WaveFolder::INPUT_GAIN_INPUT));
addParam(rack::ParamWidget::create<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, WaveFolder::INPUT_GAIN_PARAM, 0.0, 1.0, 0.1));

portY += yOffset;
knobY += yOffset;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(9, portY), module, WaveFolder::DC_OFFSET_INPUT));
addParam(rack::createParam<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, WaveFolder::DC_OFFSET_PARAM, -5.0, 5.0, 0.0));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(9, portY), Port::INPUT, module, WaveFolder::DC_OFFSET_INPUT));
addParam(rack::ParamWidget::create<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, WaveFolder::DC_OFFSET_PARAM, -5.0, 5.0, 0.0));

portY += yOffset;
knobY += yOffset;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(9, portY), module, WaveFolder::OUTPUT_GAIN_INPUT));
addParam(rack::createParam<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, WaveFolder::OUTPUT_GAIN_PARAM, 0.0, 10.0, 1.0));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(9, portY), Port::INPUT, module, WaveFolder::OUTPUT_GAIN_INPUT));
addParam(rack::ParamWidget::create<rack::RoundBlackKnob>(rack::Vec(54, knobY), module, WaveFolder::OUTPUT_GAIN_PARAM, 0.0, 10.0, 1.0));

portY += yOffset;
knobY += yOffset;
addInput(rack::createInput<rack::PJ301MPort>(rack::Vec(18, portY), module, WaveFolder::INPUT_INPUT));
addOutput(rack::createOutput<rack::PJ301MPort>(rack::Vec(box.size.x-43, portY), module, WaveFolder::OUTPUT_OUTPUT));
addInput(rack::Port::create<rack::PJ301MPort>(rack::Vec(18, portY), Port::INPUT, module, WaveFolder::INPUT_INPUT));
addOutput(rack::Port::create<rack::PJ301MPort>(rack::Vec(box.size.x-43, portY), Port::OUTPUT, module, WaveFolder::OUTPUT_OUTPUT));

portY += yOffset;
knobY += yOffset;
const float y = knobY - 6.f;
float xOffset = 52.f;
float x = 9.f;
addParam(rack::createParam<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, WaveFolder::RESISTOR_PARAM, 10000.f, 100000.f, 15000.f));
addParam(rack::ParamWidget::create<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, WaveFolder::RESISTOR_PARAM, 10000.f, 100000.f, 15000.f));
x += xOffset;
addParam(rack::createParam<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, WaveFolder::LOAD_RESISTOR_PARAM, 1000.f, 10000.f, 7500.f));
addParam(rack::ParamWidget::create<rack::RoundSmallBlackKnob>(rack::Vec(x, y), module, WaveFolder::LOAD_RESISTOR_PARAM, 1000.f, 10000.f, 7500.f));
}

Model *modelWaveFolder = Model::create<WaveFolder, WaveFolderWidget>(
/*p->addModel(rack::createModel<WaveFolderWidget>(*/
TOSTRING(SLUG), "SimpleWaveFolder", "Simple Wave Folder", EFFECT_TAG, WAVESHAPER_TAG );