Skip to content

Commit

Permalink
V2upgrade (#117)
Browse files Browse the repository at this point in the history
* Initial update for V2
Midi modules disabled, pending ongoing works

* Release 2.0.1 alpha test for V2.0 finally
Only been compiled on ubuntu
  • Loading branch information
curlymorphic authored Dec 29, 2022
1 parent cdcdb28 commit 117995d
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 52 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# StudioSixPlusOne

# Early test release for v2.0

I have only compiled this on my current Ubuntu machine, where all the modules are now working, well a first glance was all good
but I would expect some issues to appear, I have no windows for mac setups currently, and would value any feedback. There is a away to go before
anything ready for the library will be done. This currently does not use any of the V2.0 features, labels.

VCV Rack modules

These have not been updated for V2.0, and have build fails on a MAC that I am unable to test.
Expand Down
25 changes: 14 additions & 11 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"slug": "StudioSixPlusOne",
"name": "Studio Six Plus One",
"version": "1.4",

"version": "2.0.1",

"license": "GPL-3.0-or-later",
"brand": "Studio Six Plus One",
"author": "Studio Six Plus One",
Expand Down Expand Up @@ -112,6 +114,16 @@
"Controller"
]
},
{
"slug": "Zilah",
"name": "Zilah",
"description": "14 bit Midi-CC input",
"manualUrl": "https://github.com/StudioSixPlusOne/rack-modules/blob/master/README.md#zilah",
"tags": [
"MIDI",
"external"
]
},
{
"slug": "Iverson",
"name": "Iverson",
Expand All @@ -132,16 +144,7 @@
"Sequencer"
]
},
{
"slug": "Zilah",
"name": "Zilah",
"description": "14 bit Midi-CC input",
"manualUrl": "https://github.com/StudioSixPlusOne/rack-modules/blob/master/README.md#zilah",
"tags": [
"MIDI",
"external"
]
},

{
"slug": "Hula",
"name": "Hula",
Expand Down
2 changes: 1 addition & 1 deletion src/composites/LaLa.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "simd/functions.hpp"
#include "simd/sse_mathfun.h"
#include "simd/sse_mathfun_extension.h"
#include "simd/vector.hpp"
//#include "simd/vector.hpp"

#include <memory>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions src/composites/framework/WidgetComposite.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class WidgetComposite
};
float engineGetSampleRate()
{
return ::rack::appGet()->engine->getSampleRate();
return ::rack::engine::Engine().getSampleRate();
}

float engineGetSampleTime()
{
return ::rack::appGet()->engine->getSampleTime();
return ::rack::engine::Engine().getSampleTime();
}
//protected:
std::vector<Input>& inputs;
Expand Down
19 changes: 10 additions & 9 deletions src/ctrl/SqHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,28 @@ class SqHelper {
*/
static std::shared_ptr<::rack::Svg> loadSvg(const char* path, bool pathIsAbsolute = false) {
if (pathIsAbsolute) {
return ::rack::appGet()->window->loadSvg(path);
rack::window::Window().loadSvg(path);
} else {
return ::rack::appGet()->window->loadSvg(
return rack::window::Window().loadSvg(
SqHelper::assetPlugin(pluginInstance, path));
}
}

static void setPanel(::rack::app::ModuleWidget* widget, const char* path) {
widget->setPanel(::rack::appGet()->window->loadSvg(::rack::asset::plugin(pluginInstance, path)));
widget->setPanel(APP->window->loadSvg(::rack::asset::plugin(pluginInstance, path)));
}

static void openBrowser(const char* url) {
::rack::system::openBrowser(url);
//return ::rack::asset::plugin(plugin, filename);
}
static std::string assetPlugin(::rack::plugin::Plugin* plugin, const std::string& filename) {
return ::rack::asset::plugin(plugin, filename);
}
static float engineGetSampleRate() {
return ::rack::appGet()->engine->getSampleRate();
return APP->engine->getSampleRate();
}
static float engineGetSampleTime() {
return ::rack::appGet()->engine->getSampleTime();
return APP->engine->getSampleTime();
}

template <typename T>
Expand Down Expand Up @@ -116,12 +116,13 @@ class SqHelper {
}

static float getValue(::rack::app::ParamWidget* widget) {
return (widget->paramQuantity) ? widget->paramQuantity->getValue() : 0;
return (widget->getParamQuantity()) ? widget->getParamQuantity()->getValue() : 0;

}

static void setValue(::rack::app::ParamWidget* widget, float v) {
if (widget->paramQuantity) {
widget->paramQuantity->setValue(v);
if (widget->getParamQuantity()) {
widget->getParamQuantity()->setValue(v);
}
}
};
Expand Down
12 changes: 6 additions & 6 deletions src/ctrl/SqMenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct SqMenuItem_BooleanParam2 : ::rack::MenuItem {

void onAction(const sq::EventAction& e) override {
const float newValue = isOn() ? 0 : 1;
::rack::appGet()->engine->setParam(module, paramId, newValue);
rack::engine::Engine().setParamValue(module ,paramId, newValue);
e.consume(this);
}

Expand All @@ -94,7 +94,7 @@ struct SqMenuItem_BooleanParam2 : ::rack::MenuItem {

private:
bool isOn() {
return ::rack::appGet()->engine->getParam(module, paramId) > .5;
return rack::engine::Engine().getParamValue(module, paramId) > .5;
}
const int paramId;
::rack::engine::Module* const module;
Expand All @@ -106,8 +106,8 @@ struct SqMenuItem_BooleanParam : ::rack::MenuItem {

void onAction(const sq::EventAction& e) override {
const float newValue = isOn() ? 0 : 1;
if (widget->paramQuantity) {
widget->paramQuantity->setValue(newValue);
if (widget->getParamQuantity()) {
widget->getParamQuantity()->setValue(newValue);
}

sq::EventChange ec;
Expand All @@ -122,8 +122,8 @@ struct SqMenuItem_BooleanParam : ::rack::MenuItem {
private:
bool isOn() {
bool ret = false;
if (widget->paramQuantity) {
ret = widget->paramQuantity->getValue() > .5f;
if (widget->getParamQuantity()) {
ret = widget->getParamQuantity()->getValue() > .5f;
}

return ret;
Expand Down
2 changes: 1 addition & 1 deletion src/dsp/HardLimiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <cmath>
#include <utility>

#include "simd/vector.hpp"
// TODO #include "simd/vector.hpp"
#include "simd/functions.hpp"
#include "simd/sse_mathfun.h"
#include "simd/sse_mathfun_extension.h"
Expand Down
2 changes: 1 addition & 1 deletion src/dsp/UtilityFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "AudioMath.h"
#include "simd/functions.hpp"
#include "simd/vector.hpp"
//#include "simd/vector.hpp"
#include "simd/sse_mathfun_extension.h"
#include "simd/sse_mathfun.h"

Expand Down
32 changes: 16 additions & 16 deletions src/modules/Iverson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
*
*/

#include <rack0.hpp>
//#include <rack0.hpp>
#include "plugin.hpp"
#include "widgets.h"
#include "Iverson.h"
#include "WidgetComposite.h"
#include "ctrl/SqMenuItem.h"
#include "app/MidiWidget.hpp"
#include "app/MidiDisplay.hpp"

#include <sstream>

Expand Down Expand Up @@ -170,13 +170,13 @@ namespace sspo
void onSampleRateChange() override;
json_t* dataToJson() override;
void dataFromJson (json_t* rootJ) override;
void doLearn();
void doLearn(const ProcessArgs& args);
void process (const ProcessArgs& args) override;

/// Midi events are used to set assigned params
/// midi handling would require linking to RACK for unit test
/// hence all midi to be processed in Iverson.cpp
void midiToParm();
void midiToParm(const ProcessArgs& args);

/// sends midi to external controller to show status
void pageLights();
Expand All @@ -187,12 +187,12 @@ namespace sspo
/**
* Checks for midi mappings and passes data to the assigned parameter
*/
void IversonBase::midiToParm()
void IversonBase::midiToParm(const ProcessArgs& args)
{
midi::Message msg;
for (auto q = 0; q < GRID_WIDTH / 8; ++q) // GRID_WIDTH / 8 = number of midi controllers
{
while (midiInputQueues[q].shift (&msg))
while (midiInputQueues[q].tryPop(&msg, args.frame)) //TODO -1 used as placeholder
{
switch (msg.getStatus())
{
Expand Down Expand Up @@ -258,7 +258,7 @@ namespace sspo
/**
* Midi mapping from controller to parameters
*/
void IversonBase::doLearn()
void IversonBase::doLearn(const ProcessArgs& args)
{
if (! iverson->isLearning)
midiLearnMapping.reset();
Expand Down Expand Up @@ -357,7 +357,7 @@ namespace sspo
midi::Message msg;
for (auto q = 0; q < GRID_WIDTH / 8; ++q) // GRID_WIDTH /8 == number of midi controllers
{
while (midiInputQueues[q].shift (&msg))
while (midiInputQueues[q].tryPop(&msg, args.frame)) //TODO -1 placeholder
{
switch (msg.getStatus())
{
Expand Down Expand Up @@ -394,8 +394,8 @@ namespace sspo
APP->scene->rack->touchedParam = nullptr;
// dont learn midi learn param as turning off midi learn may result in overriding
// the last learnt parameter with midi learn.
if (touchedParam->paramQuantity->paramId != iverson->MIDI_LEARN_PARAM)
midiLearnMapping.paramId = touchedParam->paramQuantity->paramId;
if (touchedParam->getParamQuantity()->paramId != iverson->MIDI_LEARN_PARAM)
midiLearnMapping.paramId = touchedParam->getParamQuantity()->paramId;
}
}
}
Expand Down Expand Up @@ -537,10 +537,10 @@ namespace sspo

void IversonBase::process (const Module::ProcessArgs& args)
{
doLearn();
doLearn(args);
if (paramMidiUpdateDivider.process())
{
midiToParm();
midiToParm(args);
}

iverson->step();
Expand Down Expand Up @@ -971,7 +971,7 @@ User Interface
momentary = true;
shadow->opacity = 0;

addFrame (appGet()->window->loadSvg (asset::plugin (pluginInstance, "res/8X8_transparent.svg")));
addFrame (APP->window->loadSvg (asset::plugin (pluginInstance, "res/8X8_transparent.svg")));
}
};

Expand Down Expand Up @@ -1125,7 +1125,7 @@ User Interface
* @param port The midi queue
* @return
*/
MidiWidget* createMidiWidget (const IversonBase* module, midi::Port* port, Vec pos);
MidiDisplay* createMidiWidget (const IversonBase* module, midi::Port* port, Vec pos);

void appendContextMenu (Menu* menu) override;
};
Expand Down Expand Up @@ -1241,9 +1241,9 @@ User Interface
setModule (module);
}

MidiWidget* IversonBaseWidget::createMidiWidget (const IversonBase* module, midi::Port* port, Vec pos)
MidiDisplay* IversonBaseWidget::createMidiWidget (const IversonBase* module, midi::Port* port, Vec pos)
{
auto* midiAInWidget = createWidget<MidiWidget> (mm2px (pos));
auto* midiAInWidget = createWidget<MidiDisplay> (mm2px (pos));
midiAInWidget->box.size = mm2px (Vec (40, 25));
midiAInWidget->setMidiPort (module ? port : NULL);
addChild (midiAInWidget);
Expand Down
7 changes: 4 additions & 3 deletions src/modules/Zazel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ struct ParameterSelectWidget : Widget
{
APP->scene->rack->touchedParam = nullptr;
RequestedParamId rpi;
rpi.moduleid = touchedParam->paramQuantity->module->id;
rpi.paramid = touchedParam->paramQuantity->paramId;
rpi.moduleid = touchedParam->getParamQuantity()->module->id;
rpi.paramid = touchedParam->getParamQuantity()->paramId;
module->requestedParameter.store (rpi);
module->updateParamHandle();
learning = false;
Expand Down Expand Up @@ -409,7 +409,8 @@ struct ParameterSelectWidget : Widget
if (paramId >= (int) m->params.size())
return "";
ParamQuantity* pq = m->paramQuantities[paramId];
return pq->label;
return pq->getLabel();

}
}

Expand Down
4 changes: 2 additions & 2 deletions src/modules/Zilah.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ struct Zilah : Module
void process (const ProcessArgs& args) override
{
midi::Message msg;
while (midiInputQueue.shift (&msg))
while (midiInputQueue.tryPop(&msg, args.frame)) //-1 placeholder
{
switch (msg.getStatus())
{
Expand Down Expand Up @@ -612,7 +612,7 @@ struct Midi_cc_14Widget : ModuleWidget

if (module)
{
auto* midiAInWidget = createWidget<MidiWidget> (mm2px (Vec (30, 14.211)));
auto* midiAInWidget = createWidget<MidiDisplay> (mm2px (Vec (30, 14.211)));
midiAInWidget->box.size = mm2px (Vec (40, 25));
midiAInWidget->setMidiPort (&module->midiInputQueue);
addChild (midiAInWidget);
Expand Down
2 changes: 2 additions & 0 deletions src/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ extern Model* modelLaLa;
extern Model* modelEva;
extern Model* modelZazel;
extern Model* modelTe;
// removed Iverson due to crahing plugin browser and midi

extern Model* modelIverson;
extern Model* modelIversonJr;
extern Model* modelZilah;
Expand Down

0 comments on commit 117995d

Please sign in to comment.