From dd5344d2b8ebc57110f3755481965ff9245a1d80 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 29 Jun 2022 14:14:14 +0100 Subject: [PATCH] More details for lv2 export (category, CV type, label/brand) Signed-off-by: falkTX --- lv2export/export.cpp | 37 +++++++++++++++++-- lv2export/lv2plugin.cpp | 10 ++++- .../plugins/aubileinstruments-macro-osc-2.cpp | 3 ++ .../plugins/aubileinstruments-macro-osc.cpp | 3 ++ lv2export/plugins/fundamental-quantizer.cpp | 7 +++- lv2export/plugins/fundamental-seq3.cpp | 16 +++++++- lv2export/plugins/msm-phaser.cpp | 3 ++ lv2export/plugins/rackwindows-mv.cpp | 3 ++ lv2export/plugins/rackwindows-vibrato.cpp | 3 ++ lv2export/plugins/valleyaudio-plateau.cpp | 4 +- 10 files changed, 79 insertions(+), 10 deletions(-) diff --git a/lv2export/export.cpp b/lv2export/export.cpp index 1f775f4..c058ea9 100644 --- a/lv2export/export.cpp +++ b/lv2export/export.cpp @@ -15,6 +15,14 @@ * For a full copy of the GNU General Public License see the LICENSE file. */ +#ifndef PLUGIN_BRAND +# error PLUGIN_BRAND undefined +#endif + +#ifndef PLUGIN_LABEL +# error PLUGIN_LABEL undefined +#endif + #ifndef PLUGIN_MODEL # error PLUGIN_MODEL undefined #endif @@ -43,11 +51,14 @@ void lv2_generate_ttl() d_stdout("@prefix doap: ."); d_stdout("@prefix foaf: ."); d_stdout("@prefix lv2: ."); + d_stdout("@prefix mod: ."); d_stdout(""); d_stdout(""); - d_stdout(" a lv2:Plugin, doap:Project ;"); + d_stdout(" a \"" PLUGIN_LV2_CATEGORY "\", doap:Project ;"); d_stdout(" doap:name \"" SLUG "\" ;"); + d_stdout(" mod:brand \"" PLUGIN_BRAND "\" ;"); + d_stdout(" mod:label \"" PLUGIN_LABEL "\" ;"); d_stdout(""); int index = 0; @@ -57,8 +68,18 @@ void lv2_generate_ttl() d_stdout(" lv2:port ["); if (kCvInputs[i]) { - d_stdout(" a lv2:InputPort, lv2:CVPort ;"); + d_stdout(" a lv2:InputPort, lv2:CVPort, mod:CVPort ;"); d_stdout(" lv2:symbol \"lv2_cv_in_%d\" ;", ++numCV); + if (kCvOutputs[i] == Bi) + { + d_stdout(" lv2:minimum -5.0 ;"); + d_stdout(" lv2:maximum 5.0 ;"); + } + else + { + d_stdout(" lv2:minimum 0.0 ;"); + d_stdout(" lv2:maximum 10.0 ;"); + } } else { @@ -76,8 +97,18 @@ void lv2_generate_ttl() d_stdout(" lv2:port ["); if (kCvOutputs[i]) { - d_stdout(" a lv2:OutputPort, lv2:CVPort ;"); + d_stdout(" a lv2:OutputPort, lv2:CVPort, mod:CVPort ;"); d_stdout(" lv2:symbol \"lv2_cv_out_%d\" ;", ++numCV); + if (kCvOutputs[i] == Bi) + { + d_stdout(" lv2:minimum -5.0 ;"); + d_stdout(" lv2:maximum 5.0 ;"); + } + else + { + d_stdout(" lv2:minimum 0.0 ;"); + d_stdout(" lv2:maximum 10.0 ;"); + } } else { diff --git a/lv2export/lv2plugin.cpp b/lv2export/lv2plugin.cpp index e86eb82..e15e4b6 100644 --- a/lv2export/lv2plugin.cpp +++ b/lv2export/lv2plugin.cpp @@ -27,8 +27,14 @@ # error PLUGIN_CV_OUTPUTS undefined #endif -static constexpr const bool kCvInputs[] = PLUGIN_CV_INPUTS; -static constexpr const bool kCvOutputs[] = PLUGIN_CV_OUTPUTS; +enum PortType { + Audio = 0, + Bi = 1, + Uni = 2, +}; + +static constexpr const int kCvInputs[] = PLUGIN_CV_INPUTS; +static constexpr const int kCvOutputs[] = PLUGIN_CV_OUTPUTS; #include "src/lv2/buf-size.h" #include "src/lv2/options.h" diff --git a/lv2export/plugins/aubileinstruments-macro-osc-2.cpp b/lv2export/plugins/aubileinstruments-macro-osc-2.cpp index b626f40..5e6d73e 100644 --- a/lv2export/plugins/aubileinstruments-macro-osc-2.cpp +++ b/lv2export/plugins/aubileinstruments-macro-osc-2.cpp @@ -52,9 +52,12 @@ #include "AudibleInstruments/eurorack/plaits/resources.cc" +#define PLUGIN_BRAND "AudibleInstruments" +#define PLUGIN_LABEL "Macro Osc 2" #define PLUGIN_MODEL modelPlaits #define PLUGIN_CV_INPUTS {1,1,1,1,1,1,1,1} #define PLUGIN_CV_OUTPUTS {0,0} +#define PLUGIN_LV2_CATEGORY "lv2:GeneratorPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/aubileinstruments-macro-osc.cpp b/lv2export/plugins/aubileinstruments-macro-osc.cpp index d9c4db7..ed913e0 100644 --- a/lv2export/plugins/aubileinstruments-macro-osc.cpp +++ b/lv2export/plugins/aubileinstruments-macro-osc.cpp @@ -32,9 +32,12 @@ // #include "AudibleInstruments/eurorack/braids/quantizer.cc" #include "AudibleInstruments/eurorack/braids/resources.cc" +#define PLUGIN_BRAND "AudibleInstruments" +#define PLUGIN_LABEL "Macro Osc" #define PLUGIN_MODEL modelBraids #define PLUGIN_CV_INPUTS {1,1,1,1,1} #define PLUGIN_CV_OUTPUTS {0} +#define PLUGIN_LV2_CATEGORY "lv2:GeneratorPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/fundamental-quantizer.cpp b/lv2export/plugins/fundamental-quantizer.cpp index e2131bf..bfc6d94 100644 --- a/lv2export/plugins/fundamental-quantizer.cpp +++ b/lv2export/plugins/fundamental-quantizer.cpp @@ -17,9 +17,12 @@ #include "Fundamental/src/Quantizer.cpp" +#define PLUGIN_BRAND "VCV Fundamental" +#define PLUGIN_LABEL "Quantizer" #define PLUGIN_MODEL modelQuantizer -#define PLUGIN_CV_INPUTS {1} -#define PLUGIN_CV_OUTPUTS {1} +#define PLUGIN_CV_INPUTS {Bi} +#define PLUGIN_CV_OUTPUTS {Bi} +#define PLUGIN_LV2_CATEGORY "mod:CVPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/fundamental-seq3.cpp b/lv2export/plugins/fundamental-seq3.cpp index e2dde55..98d6efb 100644 --- a/lv2export/plugins/fundamental-seq3.cpp +++ b/lv2export/plugins/fundamental-seq3.cpp @@ -17,9 +17,21 @@ #include "Fundamental/src/SEQ3.cpp" +#define PLUGIN_BRAND "VCV Fundamental" +#define PLUGIN_LABEL "SEQ3" #define PLUGIN_MODEL modelSEQ3 -#define PLUGIN_CV_INPUTS {1,1,1,1,1} -#define PLUGIN_CV_OUTPUTS {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} +#define PLUGIN_CV_INPUTS {Bi,Uni,Uni,Uni,Uni} +#define PLUGIN_CV_OUTPUTS { \ + /* trigger */ \ + Uni, \ + /* 3 cv outs */ \ + Bi,Bi,Bi, \ + /* 8 steps */ \ + Uni,Uni,Uni,Uni,Uni,Uni,Uni,Uni, \ + /* steps, clk, run, reset */ \ + Uni,Uni,Uni,Uni \ +} +#define PLUGIN_LV2_CATEGORY "mod:CVPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/msm-phaser.cpp b/lv2export/plugins/msm-phaser.cpp index 6e0eede..8e93f86 100644 --- a/lv2export/plugins/msm-phaser.cpp +++ b/lv2export/plugins/msm-phaser.cpp @@ -17,9 +17,12 @@ #include "MSM/src/Phaser.cpp" +#define PLUGIN_BRAND "MSM" +#define PLUGIN_LABEL "Phaser" #define PLUGIN_MODEL modelPhaserModule #define PLUGIN_CV_INPUTS {1,1,1,0} #define PLUGIN_CV_OUTPUTS {0} +#define PLUGIN_LV2_CATEGORY "lv2:DistortionPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/rackwindows-mv.cpp b/lv2export/plugins/rackwindows-mv.cpp index 25c85e6..a7991ce 100644 --- a/lv2export/plugins/rackwindows-mv.cpp +++ b/lv2export/plugins/rackwindows-mv.cpp @@ -17,9 +17,12 @@ #include "rackwindows/src/mv.cpp" +#define PLUGIN_BRAND "Rackwindows" +#define PLUGIN_LABEL "MV" #define PLUGIN_MODEL modelMv #define PLUGIN_CV_INPUTS {1,1,1,1,0,0} #define PLUGIN_CV_OUTPUTS {0,0} +#define PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/rackwindows-vibrato.cpp b/lv2export/plugins/rackwindows-vibrato.cpp index 25a218e..a4bdd9e 100644 --- a/lv2export/plugins/rackwindows-vibrato.cpp +++ b/lv2export/plugins/rackwindows-vibrato.cpp @@ -17,9 +17,12 @@ #include "rackwindows/src/vibrato.cpp" +#define PLUGIN_BRAND "Rackwindows" +#define PLUGIN_LABEL "Vibrato" #define PLUGIN_MODEL modelVibrato #define PLUGIN_CV_INPUTS {1,1,1,1,1,0} #define PLUGIN_CV_OUTPUTS {1,0,1} +#define PLUGIN_LV2_CATEGORY "lv2:DynamicsPlugin" #include "lv2plugin.cpp" #include "export.cpp" diff --git a/lv2export/plugins/valleyaudio-plateau.cpp b/lv2export/plugins/valleyaudio-plateau.cpp index 52b59e3..9f4cc03 100644 --- a/lv2export/plugins/valleyaudio-plateau.cpp +++ b/lv2export/plugins/valleyaudio-plateau.cpp @@ -20,10 +20,12 @@ #include "ValleyAudio/src/Plateau/Dattorro.cpp" #include "ValleyAudio/src/Plateau/Plateau.cpp" - +#define PLUGIN_BRAND "Valley Audio" +#define PLUGIN_LABEL "Plateau" #define PLUGIN_MODEL modelPlateau #define PLUGIN_CV_INPUTS {0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} #define PLUGIN_CV_OUTPUTS {0,0} +#define PLUGIN_LV2_CATEGORY "lv2:ReverbPlugin" #include "lv2plugin.cpp" #include "export.cpp"