Skip to content

Commit

Permalink
Merge pull request #152 from 4ms/lyle4ms--audible_simple_modules
Browse files Browse the repository at this point in the history
Audible Instruments simple modules
  • Loading branch information
danngreen authored Nov 2, 2023
2 parents d7abb14 + 2407700 commit ac7c2da
Show file tree
Hide file tree
Showing 91 changed files with 14,258 additions and 19 deletions.
2 changes: 1 addition & 1 deletion firmware/lib/jansson/jansson
Submodule jansson updated 1 files
+0 −5 src/hashtable_seed.c
2 changes: 1 addition & 1 deletion firmware/lib/mdrivlib
1 change: 0 additions & 1 deletion firmware/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ target_link_script(
-Wno-psabi
-ffreestanding
-nostartfiles
# -nostdlib
-flto=auto
)

Expand Down
5 changes: 5 additions & 0 deletions firmware/src/VCV_adaptor/VCV_module_wrapper.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "VCV_adaptor/engine/Param.hpp"
#include "VCV_adaptor/engine/ParamQuantity.hpp"
#include "VCV_adaptor/engine/Port.hpp"
#include "VCV_adaptor/random.hpp"
#include <array>
#include <memory>
#include <vector>
Expand All @@ -21,6 +22,10 @@ struct VCVModuleWrapper : CoreProcessor {
int64_t frame;
};

VCVModuleWrapper() {
rack::random::init();
}

virtual void process(const ProcessArgs &) = 0;

void update() override {
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/VCV_adaptor/app/Widget.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct ThemedSvgPort : SvgPort {

struct ModuleLightWidget : widget::Widget {
int firstLightId = -1;
// NVGcolor bgColor = nvgRGBA(0, 0, 0, 0);
NVGcolor bgColor = nvgRGBA(0, 0, 0, 0);
// NVGcolor color = nvgRGBA(0, 0, 0, 0);
// NVGcolor borderColor = nvgRGBA(0, 0, 0, 0);

Expand Down
31 changes: 22 additions & 9 deletions firmware/src/VCV_adaptor/helpers.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include "CoreModules/elements/element_info.hh"
#include "CoreModules/elements/element_setters.hh"
#include "CoreModules/elements/element_strings.hh"
#include "VCV_adaptor/app/Menu.hpp"
#include "VCV_adaptor/app/SvgPanel.hpp"
#include "VCV_adaptor/engine/Module.hpp"
Expand All @@ -9,6 +9,7 @@
#include "VCV_adaptor/widget_convert/widget_element_convert.hh"
#include <functional>
#include <string_view>

// #include "pr_dbg.hh"

namespace rack
Expand All @@ -31,30 +32,42 @@ T *createElementWidget(math::Vec pos, MetaModule::Coords coord_ref, std::string_

inline std::string_view getParamName(engine::Module *module, int id) {
if (auto pq = module->getParamQuantity(id)) {
return pq->name;
if (pq->name.size()) {
remove_extended_chars(pq->name);
return pq->name;
}
}
return "";
return "(Param)";
}

inline std::string_view getInputName(engine::Module *module, int id) {
if (auto info = module->getInputInfo(id)) {
return info->name;
if (info->name.size()) {
remove_extended_chars(info->name);
return info->name;
}
}
return "";
return "(In)";
}

inline std::string_view getOutputName(engine::Module *module, int id) {
if (auto info = module->getOutputInfo(id)) {
return info->name;
if (info->name.size()) {
remove_extended_chars(info->name);
return info->name;
}
}
return "";
return "(Out)";
}

inline std::string_view getLightName(engine::Module *module, int id) {
if (auto info = module->getLightInfo(id)) {
return info->name;
if (info->name.size()) {
remove_extended_chars(info->name);
return info->name;
}
}
return "";
return "(Light)";
}

template<class TWidget>
Expand Down
46 changes: 46 additions & 0 deletions firmware/src/VCV_adaptor/widget_convert/Rack.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ struct ElementConvert<componentlibrary::Davies1900hLargeWhiteKnob> {
using ElementType = MetaModule::Davies1900hLargeWhiteKnob;
};

template<>
struct ElementConvert<componentlibrary::Rogan1PSGreen> {
using ElementType = MetaModule::Rogan1PSGreen;
};

template<>
struct ElementConvert<componentlibrary::Rogan1PSRed> {
using ElementType = MetaModule::Rogan1PSRed;
};

template<>
struct ElementConvert<componentlibrary::Rogan1PSWhite> {
using ElementType = MetaModule::Rogan1PSWhite;
};

template<>
struct ElementConvert<componentlibrary::Rogan2SGray> {
using ElementType = MetaModule::Rogan2SGray;
Expand Down Expand Up @@ -86,6 +101,22 @@ struct ElementConvert<componentlibrary::Rogan2PSGreen> {
using ElementType = MetaModule::Rogan2PSGreen;
};

template<>
struct ElementConvert<componentlibrary::Rogan3PSWhite> {
using ElementType = MetaModule::Rogan3PSWhite;
};

template<>
struct ElementConvert<componentlibrary::Rogan3PSRed> {
using ElementType = MetaModule::Rogan3PSRed;
};

template<>
struct ElementConvert<componentlibrary::Rogan3PSGreen> {
using ElementType = MetaModule::Rogan3PSGreen;
};


template<>
struct ElementConvert<componentlibrary::Trimpot> {
using ElementType = MetaModule::Trimpot;
Expand Down Expand Up @@ -126,6 +157,21 @@ struct ElementConvert<componentlibrary::SmallLight<componentlibrary::GreenRedLig
using ElementType = MetaModule::SmallLight<MetaModule::GreenRedLight>;
};

template<>
struct ElementConvert<componentlibrary::MediumLight<componentlibrary::GreenRedLight>> {
using ElementType = MetaModule::MediumLight<MetaModule::GreenRedLight>;
};

template<>
struct ElementConvert<componentlibrary::MediumLight<componentlibrary::RedLight>> {
using ElementType = MetaModule::MediumLight<MetaModule::RedLight>;
};

template<>
struct ElementConvert<componentlibrary::MediumLight<componentlibrary::GreenLight>> {
using ElementType = MetaModule::MediumLight<MetaModule::GreenLight>;
};

template<>
struct ElementConvert<componentlibrary::PJ301MPort> {
using ElementTypeInput = MetaModule::PJ301MPortIn;
Expand Down
Loading

0 comments on commit ac7c2da

Please sign in to comment.