diff --git a/src/MOD/CardinalFX.lv2/modgui.ttl b/src/MOD/CardinalFX.lv2/modgui.ttl new file mode 100644 index 0000000..e92e345 --- /dev/null +++ b/src/MOD/CardinalFX.lv2/modgui.ttl @@ -0,0 +1,15 @@ +@prefix lv2: . +@prefix mod: . +@prefix modgui: . + + + mod:brand "DISTRHO" ; + mod:label "CardinalFX" ; + modgui:gui [ + modgui:resourcesDirectory ; + modgui:iconTemplate ; + modgui:javascript ; + modgui:stylesheet ; + modgui:screenshot ; + modgui:thumbnail ; + ] . diff --git a/src/MOD/CardinalFX.lv2/modgui/distrho.svg b/src/MOD/CardinalFX.lv2/modgui/distrho.svg new file mode 100644 index 0000000..30b9d9b --- /dev/null +++ b/src/MOD/CardinalFX.lv2/modgui/distrho.svg @@ -0,0 +1,99 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/MOD/CardinalFX.lv2/modgui/icon.html b/src/MOD/CardinalFX.lv2/modgui/icon.html new file mode 100644 index 0000000..f506270 --- /dev/null +++ b/src/MOD/CardinalFX.lv2/modgui/icon.html @@ -0,0 +1,169 @@ +
+
+
+
+
+
+ +
DISTRHO Cardinal - Mini -
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ 1 - 8 + 9 - 16 + 17 - 24 +
+
+
+
+
+
+ PARAM 1 +
+
+
+ PARAM 2 +
+
+
+ PARAM 3 +
+
+
+ PARAM 4 +
+
+
+ PARAM 5 +
+
+
+ PARAM 6 +
+
+
+ PARAM 7 +
+
+
+ PARAM 8 +
+
+
+
+
+ PARAM 9 +
+
+
+ PARAM 10 +
+
+
+ PARAM 11 +
+
+
+ PARAM 12 +
+
+
+ PARAM 13 +
+
+
+ PARAM 14 +
+
+
+ PARAM 15 +
+
+
+ PARAM 16 +
+
+
+
+
+ PARAM 17 +
+
+
+ PARAM 18 +
+
+
+ PARAM 19 +
+
+
+ PARAM 20 +
+
+
+ PARAM 21 +
+
+
+ PARAM 22 +
+
+
+ PARAM 23 +
+
+
+ PARAM 24 +
+
+
+
+
+ {{#effect.ports.audio.input}} +
+
+
+ {{/effect.ports.audio.input}} + {{#effect.ports.midi.input}} +
+
+
+ {{/effect.ports.midi.input}} + {{#effect.ports.cv.input}} +
+
+
+ {{/effect.ports.cv.input}} +
+
+ {{#effect.ports.audio.output}} +
+
+
+ {{/effect.ports.audio.output}} + {{#effect.ports.midi.output}} +
+
+
+ {{/effect.ports.midi.output}} + {{#effect.ports.cv.output}} +
+
+
+ {{/effect.ports.cv.output}} +
+
diff --git a/src/MOD/CardinalFX.lv2/modgui/javascript.js b/src/MOD/CardinalFX.lv2/modgui/javascript.js new file mode 100644 index 0000000..4f980c1 --- /dev/null +++ b/src/MOD/CardinalFX.lv2/modgui/javascript.js @@ -0,0 +1,41 @@ +function (event) { + + if (event.type == 'start') { + event.icon.find('.cardinal-fx-knob-page-selector .page-1').click(function() { + event.icon.find('.cardinal-fx-knob-page-2').css({'display':'none'}); + event.icon.find('.cardinal-fx-knob-page-3').css({'display':'none'}); + event.icon.find('.cardinal-fx-knob-page-1').css({'display':'flex'}); + event.icon.find('.cardinal-fx-knob-page-selector > span').removeClass('selected'); + $(this).addClass('selected'); + }); + event.icon.find('.cardinal-fx-knob-page-selector .page-2').click(function() { + event.icon.find('.cardinal-fx-knob-page-1').css({'display':'none'}); + event.icon.find('.cardinal-fx-knob-page-3').css({'display':'none'}); + event.icon.find('.cardinal-fx-knob-page-2').css({'display':'flex'}); + event.icon.find('.cardinal-fx-knob-page-selector > span').removeClass('selected'); + $(this).addClass('selected'); + }); + event.icon.find('.cardinal-fx-knob-page-selector .page-3').click(function() { + event.icon.find('.cardinal-fx-knob-page-1').css({'display':'none'}); + event.icon.find('.cardinal-fx-knob-page-2').css({'display':'none'}); + event.icon.find('.cardinal-fx-knob-page-3').css({'display':'flex'}); + event.icon.find('.cardinal-fx-knob-page-selector > span').removeClass('selected'); + $(this).addClass('selected'); + }); + return; + } + + if (event.type == 'change') { + if (event.uri === "https://distrho.kx.studio/plugins/cardinal#fx#screenshot") { + if (event.value) { + event.icon.find('.screenshot').css({'background-image':'url(data:image/png;base64,'+event.value+')'}); + event.icon.find('.cardinal-fx.mod-pedal .cardinal-patch-comment').hide(); + event.icon.find('.cardinal-fx.mod-pedal .cardinal-patch-screeenshot').show(); + } else { + event.icon.find('.cardinal-fx.mod-pedal .cardinal-patch-screeenshot').hide(); + event.icon.find('.cardinal-fx.mod-pedal .cardinal-patch-comment').show(); + } + } + return; + } +} diff --git a/src/MOD/CardinalFX.lv2/modgui/orange-knob.png b/src/MOD/CardinalFX.lv2/modgui/orange-knob.png new file mode 100644 index 0000000..2f08b7d Binary files /dev/null and b/src/MOD/CardinalFX.lv2/modgui/orange-knob.png differ diff --git a/src/MOD/CardinalFX.lv2/modgui/screenshot.png b/src/MOD/CardinalFX.lv2/modgui/screenshot.png new file mode 100644 index 0000000..8b81b66 Binary files /dev/null and b/src/MOD/CardinalFX.lv2/modgui/screenshot.png differ diff --git a/src/MOD/CardinalFX.lv2/modgui/stylesheet.css b/src/MOD/CardinalFX.lv2/modgui/stylesheet.css new file mode 100644 index 0000000..de03ec0 --- /dev/null +++ b/src/MOD/CardinalFX.lv2/modgui/stylesheet.css @@ -0,0 +1,204 @@ +/* main pedal */ +.cardinal-fx.mod-pedal { + background: #333333; + background: linear-gradient(to bottom, #181919, #333333); + color: white; + width: 480px; + height: 420px; + font-size: 20px; + margin: 0; + padding: 0; +} +.cardinal-fx.mod-pedal .border { + border: 2px solid #4c4d4d; + width: 480px; + height: 420px; + position: absolute; +} + +.cardinal-fx.mod-pedal .mod-control-group { + position: relative; + z-index: 35; +} + +/* top and bottom area split */ +.cardinal-fx.mod-pedal .cardinal-fx-top { + width: 100%; + height: 240px; + position: absolute; + top: 0px; +} + +.cardinal-fx.mod-pedal .cardinal-fx-bottom { + width: 100%; + height: 180px; + position: absolute; + top: 240px; +} + +/* top area split */ +.cardinal-fx.mod-pedal .cardinal-fx-top-left { + width: 120px; + height: 240px; + position: absolute; + top: 0px; + left: 0px; + display: flex; + flex-direction: column; + justify-content: space-around; + text-align: center; +} + +.cardinal-fx.mod-pedal .cardinal-fx-top-right { + width: 350px; + height: 240px; + position: absolute; + top: 0px; + left: 120px; +} + +.cardinal-fx.mod-pedal .cardinal-patch-comment, +.cardinal-fx.mod-pedal .cardinal-patch-screeenshot { + width: 340px; + height: 210px; + margin: 20px 20px 10px 0px; +} + +/* bottom section split */ +.cardinal-fx.mod-pedal .cardinal-fx-knob-page-selector { + width: 107px; /* NOTE intentional over bounds */ + height: 170px; + position: absolute; + top: 0px; + left: 0px; + text-align: center; + display: flex; + flex-direction: column; + padding-left: 6px; + z-index: 36; +} + +.cardinal-fx.mod-pedal .cardinal-fx-knobs { + width: 365px; + height: 170px; + position: absolute; + top: 0px; + left: 105px; + padding: 0px 10px; + display: flex; + flex-wrap: wrap; + justify-content: center; + text-align: center; + background-color: #181919; + border: 2px solid #4c4d4d; + border-radius: 10px; +} + +/* widgets */ +.cardinal-fx.mod-pedal .mod-switch-image { + background-image: url(/resources/switch.png{{{ns}}}); + background-position: left center; + background-repeat: no-repeat; + background-size: auto 50px; + font-weight: bold; + width: 100px; + height: 50px; + cursor: pointer; +} +.cardinal-fx.mod-pedal .mod-switch-image.off { + background-position: right center !important; +} +.cardinal-fx.mod-pedal .mod-switch-image.on { + background-position: left center !important; +} + +.cardinal-fx.mod-pedal .title { + font-size: 15px; + font-weight: bold; +} + +.cardinal-fx.mod-pedal .mod-knob { + padding: 0px 5px; + width: 85px; +} + +.cardinal-fx.mod-pedal .mod-knob-image { + background-image: url(/resources/orange-knob.png{{{ns}}}); + background-position: left center; + background-repeat: no-repeat; + background-size: auto 52px; + font-weight: bold; + height: 52px; + width: 52px; + margin: 0 auto; + position: relative; + overflow: hidden; +} + +.cardinal-fx.mod-pedal .distrho-logo { + background-image: url(/resources/distrho.svg{{{ns}}}); + background-size: cover; + background-repeat: no-repeat; + height: 48px; + width: 48px; + margin: 0 auto; +} + +.cardinal-fx.mod-pedal .cardinal-text { + font-size: 24px; +} + +.cardinal-fx.mod-pedal .mod-string-value { + border: 1px solid #4c4d4d; +} + +.cardinal-fx.mod-pedal .mod-string-content, +.cardinal-fx.mod-pedal .mod-string-value { + height: 100%; + width: 100%; +} + +.cardinal-fx.mod-pedal textarea { + background: black; + color: white; + resize: none; + white-space: pre-wrap; +} + .cardinal-fx.mod-pedal textarea::selection { + background: #4c4d4d; +} + +.cardinal-fx.mod-pedal .screenshot { + /* 1x1px black png */ + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NgYGD4DwABBAEAwS2OUAAAAABJRU5ErkJggg==); + background-position: center; + background-repeat: no-repeat; + background-size: contain; + width: 100%; + height: 100%; +} + +.cardinal-fx.mod-pedal .cardinal-fx-knob-page-selector > span { + cursor: pointer; + background-color: #4c4d4d; + border: solid #181919; + border-width: 2px 0px 2px 2px; + margin: 2px 0px 2px 2px; + font-size: 18px; +} +.cardinal-fx.mod-pedal .cardinal-fx-knob-page-selector > span:first-child { + margin-top: 10px; +} +.cardinal-fx.mod-pedal .cardinal-fx-knob-page-selector > span.selected { + background-color: #181919; + border: solid #4c4d4d; + border-width: 2px 0px 2px 2px; +} + +/* initial state */ +/*.cardinal-fx.mod-pedal .cardinal-patch-comment,*/ +.cardinal-fx.mod-pedal .cardinal-patch-screeenshot, +.cardinal-fx.mod-pedal .cardinal-fx-knob-page-2, +.cardinal-fx.mod-pedal .cardinal-fx-knob-page-3 { + display: none; +} diff --git a/src/MOD/CardinalFX.lv2/modgui/switch.png b/src/MOD/CardinalFX.lv2/modgui/switch.png new file mode 100644 index 0000000..b576339 Binary files /dev/null and b/src/MOD/CardinalFX.lv2/modgui/switch.png differ diff --git a/src/MOD/CardinalFX.lv2/modgui/thumbnail.png b/src/MOD/CardinalFX.lv2/modgui/thumbnail.png new file mode 100644 index 0000000..25b329a Binary files /dev/null and b/src/MOD/CardinalFX.lv2/modgui/thumbnail.png differ diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index c27a4cb..afb60e3 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -152,6 +152,10 @@ ifeq ($(HEADLESS),true) BASE_FLAGS += -DHEADLESS endif +ifeq ($(MOD_BUILD),true) +BASE_FLAGS += -DDISTRHO_PLUGIN_USES_MODGUI=1 -DDISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE=0xffff +endif + ifeq ($(WASM),true) BASE_FLAGS += -DNANOVG_GLES2=1 BASE_FLAGS += -msse -msse2 -msse3 -msimd128 @@ -256,7 +260,13 @@ CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/ComponentLibrary/ CORE_RESOURCES += template.vcv LV2_RESOURCES = $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).lv2/resources/%) -VST3_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst3/Contents/Resources/%) +VST3_RESOURCES = $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst3/Contents/Resources/%) + +# Install modgui resources if MOD build +ifeq ($(MOD_BUILD),true) +LV2_RESOURCES += $(TARGET_DIR)/$(NAME).lv2/modgui.ttl +LV2_RESOURCES += $(TARGET_DIR)/$(NAME).lv2/modgui +endif # Cardinal main variant should not use rtaudio fallback (it has CV ports) ifeq ($(CARDINAL_VARIANT),main) @@ -266,9 +276,9 @@ endif # Cardinal main variant is not available as VST2 due to lack of CV ports ifneq ($(CARDINAL_VARIANT),main) ifeq ($(MACOS),true) -VST2_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst/Contents/Resources/%) +VST2_RESOURCES = $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst/Contents/Resources/%) else -VST2_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst/resources/%) +VST2_RESOURCES = $(CORE_RESOURCES:%=$(TARGET_DIR)/$(NAME).vst/resources/%) endif endif @@ -290,6 +300,10 @@ ifeq ($(MOD_BUILD),true) $(TARGET_DIR)/$(NAME).lv2/resources/%.svg: ../Rack/res/%.svg ../../deps/svg2stub.py -@mkdir -p "$(shell dirname $@)" $(SILENT)python3 ../../deps/svg2stub.py $< $@ + +$(TARGET_DIR)/$(NAME).lv2/mod%: ../MOD/$(NAME).lv2/mod% + -@mkdir -p "$(shell dirname $@)" + $(SILENT)ln -sf $(abspath $<) $@ endif $(TARGET_DIR)/$(NAME).vst/resources/%: ../Rack/res/%