diff --git a/.gitignore b/.gitignore index 9e15837..cff65f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.exe *.dll *.dylib +*.pkg *.so *.zip @@ -12,8 +13,13 @@ .kdev_include_paths .kdev4/ -bin/ -build/ -documentation.pdf -utils/inno/resources.iss -utils/inno/version.iss +.cache +compile_commands.json + +/bin/ +/build/ +/documentation.pdf +/jucewrapper/build/ +/jucewrapper/JUCE/ +/utils/inno/resources.iss +/utils/inno/version.iss diff --git a/Makefile b/Makefile index 722b384..f343080 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ # jucewrapper/CMakeList.txt `project` # src/CardinalCommon.cpp `CARDINAL_VERSION` # src/CardinalPlugin.cpp `getVersion` -VERSION = 22.07 +VERSION = 22.08 # -------------------------------------------------------------- # Import base definitions diff --git a/dpf b/dpf index 1cc5641..c9ce338 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 1cc5641ba765dcb22da32c66faf3a09f808bfb27 +Subproject commit c9ce3383797f398bb091d37525fd00ef7047afc7 diff --git a/jucewrapper/CMakeLists.txt b/jucewrapper/CMakeLists.txt index 73c7cb2..b9144bb 100644 --- a/jucewrapper/CMakeLists.txt +++ b/jucewrapper/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(Cardinal VERSION 22.07) +project(Cardinal VERSION 22.08) add_subdirectory(JUCE) diff --git a/patches/init/wasm.vcv b/patches/init/native.vcv similarity index 95% rename from patches/init/wasm.vcv rename to patches/init/native.vcv index 61b752a..4ea97ee 100644 --- a/patches/init/wasm.vcv +++ b/patches/init/native.vcv @@ -12,7 +12,7 @@ "data": { "filepath": "", "lang": "None", - "etext": "Welcome to Cardinal!\n\nThis is the Web/Wasm variant\nIt has 2 audio outputs, enabled by default.\nUse Engine menu to enable input and/or MIDI.\n\nA basic VCO + ADSR + VCA is the default patch\n\n", + "etext": "Welcome to Cardinal!\n\nThis is the Native Audio/MIDI variant.\nIt has 2 audio outputs, enabled by default.\nUse Engine menu to enable input and/or MIDI.\n\nA basic VCO + ADSR + VCA is the default patch\n\n", "width": 23 }, "pos": [ diff --git a/plugins/Cardinal/src/plugincontext.hpp b/plugins/Cardinal/src/plugincontext.hpp index b0f1f79..f48b2a8 100644 --- a/plugins/Cardinal/src/plugincontext.hpp +++ b/plugins/Cardinal/src/plugincontext.hpp @@ -36,6 +36,7 @@ static constexpr const uint32_t kModuleParameters = 24; enum CardinalVariant { kCardinalVariantMain, kCardinalVariantFX, + kCardinalVariantNative, kCardinalVariantSynth, }; diff --git a/src/Cardinal/DistrhoPluginInfo.h b/src/Cardinal/DistrhoPluginInfo.h index ed73c57..32dfb19 100644 --- a/src/Cardinal/DistrhoPluginInfo.h +++ b/src/Cardinal/DistrhoPluginInfo.h @@ -18,9 +18,10 @@ #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED #define DISTRHO_PLUGIN_INFO_H_INCLUDED -#define CARDINAL_VARIANT_MAIN 1 -#define CARDINAL_VARIANT_FX 0 -#define CARDINAL_VARIANT_SYNTH 0 +#define CARDINAL_VARIANT_MAIN 1 +#define CARDINAL_VARIANT_FX 0 +#define CARDINAL_VARIANT_NATIVE 0 +#define CARDINAL_VARIANT_SYNTH 0 #define CARDINAL_NUM_AUDIO_INPUTS 8 #define CARDINAL_NUM_AUDIO_OUTPUTS 8 diff --git a/src/CardinalCommon.cpp b/src/CardinalCommon.cpp index 558b628..5f3f4ef 100644 --- a/src/CardinalCommon.cpp +++ b/src/CardinalCommon.cpp @@ -57,7 +57,7 @@ # include #endif -const std::string CARDINAL_VERSION = "22.07"; +const std::string CARDINAL_VERSION = "22.08"; namespace rack { diff --git a/src/CardinalFX/DistrhoPluginInfo.h b/src/CardinalFX/DistrhoPluginInfo.h index c70b915..34bd556 100644 --- a/src/CardinalFX/DistrhoPluginInfo.h +++ b/src/CardinalFX/DistrhoPluginInfo.h @@ -18,9 +18,10 @@ #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED #define DISTRHO_PLUGIN_INFO_H_INCLUDED -#define CARDINAL_VARIANT_MAIN 0 -#define CARDINAL_VARIANT_FX 1 -#define CARDINAL_VARIANT_SYNTH 0 +#define CARDINAL_VARIANT_MAIN 0 +#define CARDINAL_VARIANT_FX 1 +#define CARDINAL_VARIANT_NATIVE 0 +#define CARDINAL_VARIANT_SYNTH 0 #define CARDINAL_NUM_AUDIO_INPUTS 2 #define CARDINAL_NUM_AUDIO_OUTPUTS 2 diff --git a/src/CardinalNative/DistrhoPluginInfo.h b/src/CardinalNative/DistrhoPluginInfo.h index 5cb1e33..e42972f 100644 --- a/src/CardinalNative/DistrhoPluginInfo.h +++ b/src/CardinalNative/DistrhoPluginInfo.h @@ -18,9 +18,10 @@ #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED #define DISTRHO_PLUGIN_INFO_H_INCLUDED -#define CARDINAL_VARIANT_MAIN 0 -#define CARDINAL_VARIANT_FX 1 -#define CARDINAL_VARIANT_SYNTH 0 +#define CARDINAL_VARIANT_MAIN 0 +#define CARDINAL_VARIANT_FX 0 +#define CARDINAL_VARIANT_NATIVE 1 +#define CARDINAL_VARIANT_SYNTH 0 #define CARDINAL_NUM_AUDIO_INPUTS 2 #define CARDINAL_NUM_AUDIO_OUTPUTS 2 diff --git a/src/CardinalPlugin.cpp b/src/CardinalPlugin.cpp index b87e308..5eb1e95 100644 --- a/src/CardinalPlugin.cpp +++ b/src/CardinalPlugin.cpp @@ -52,10 +52,10 @@ # include "extra/SharedResourcePointer.hpp" #endif -#ifdef DISTRHO_OS_WASM -# define CARDINAL_TEMPLATE_NAME "init/wasm.vcv" -#elif CARDINAL_VARIANT_FX +#if CARDINAL_VARIANT_FX # define CARDINAL_TEMPLATE_NAME "init/fx.vcv" +#elif CARDINAL_VARIANT_NATIVE +# define CARDINAL_TEMPLATE_NAME "init/native.vcv" #elif CARDINAL_VARIANT_SYNTH # define CARDINAL_TEMPLATE_NAME "init/synth.vcv" #else @@ -188,11 +188,12 @@ struct Initializer } } - if (asset::systemDir.empty() || ! system::exists(asset::systemDir)) + if (asset::systemDir.empty() || ! system::exists(asset::systemDir) || ! system::exists(asset::bundlePath)) { #ifdef CARDINAL_PLUGIN_SOURCE_DIR // Make system dir point to source code location as fallback asset::systemDir = CARDINAL_PLUGIN_SOURCE_DIR DISTRHO_OS_SEP_STR "Rack"; + asset::bundlePath.clear(); // If source code dir does not exist use install target prefix as system dir if (!system::exists(system::join(asset::systemDir, "res"))) @@ -683,12 +684,12 @@ protected: uint32_t getVersion() const override { - return d_version(0, 22, 7); + return d_version(0, 22, 8); } int64_t getUniqueId() const override { - #if CARDINAL_VARIANT_MAIN + #if CARDINAL_VARIANT_MAIN || CARDINAL_VARIANT_NATIVE return d_cconst('d', 'C', 'd', 'n'); #elif CARDINAL_VARIANT_FX return d_cconst('d', 'C', 'n', 'F'); @@ -704,7 +705,7 @@ protected: void initAudioPort(const bool input, uint32_t index, AudioPort& port) override { - #if CARDINAL_VARIANT_FX || CARDINAL_VARIANT_SYNTH + #if CARDINAL_VARIANT_FX || CARDINAL_VARIANT_NATIVE || CARDINAL_VARIANT_SYNTH if (index < 2) port.groupId = kPortGroupStereo; #endif diff --git a/src/CardinalSynth/DistrhoPluginInfo.h b/src/CardinalSynth/DistrhoPluginInfo.h index c11268a..b4ba9a6 100644 --- a/src/CardinalSynth/DistrhoPluginInfo.h +++ b/src/CardinalSynth/DistrhoPluginInfo.h @@ -18,9 +18,10 @@ #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED #define DISTRHO_PLUGIN_INFO_H_INCLUDED -#define CARDINAL_VARIANT_MAIN 0 -#define CARDINAL_VARIANT_FX 0 -#define CARDINAL_VARIANT_SYNTH 1 +#define CARDINAL_VARIANT_MAIN 0 +#define CARDINAL_VARIANT_FX 0 +#define CARDINAL_VARIANT_NATIVE 0 +#define CARDINAL_VARIANT_SYNTH 1 #define CARDINAL_NUM_AUDIO_INPUTS 0 #define CARDINAL_NUM_AUDIO_OUTPUTS 2 diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index 7e78b43..1d13bd5 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -346,6 +346,21 @@ lv2: $(LV2_RESOURCES) vst2: $(VST2_RESOURCES) vst3: $(VST3_RESOURCES) +# -------------------------------------------------------------- +# Extra rules for macOS app bundle + +$(TARGET_DIR)/Cardinal.app/Contents/Info.plist: ../../utils/macOS/Info_JACK.plist $(TARGET_DIR)/Cardinal.app/Contents/Resources/distrho.icns + -@mkdir -p $(shell dirname $@) + cp $< $@ + +$(TARGET_DIR)/CardinalNative.app/Contents/Info.plist: ../../utils/macOS/Info_Native.plist $(TARGET_DIR)/CardinalNative.app/Contents/Resources/distrho.icns + -@mkdir -p $(shell dirname $@) + cp $< $@ + +$(TARGET_DIR)/%.app/Contents/Resources/distrho.icns: ../../utils/distrho.icns + -@mkdir -p $(shell dirname $@) + cp $< $@ + # -------------------------------------------------------------- # Extra rules for wasm resources diff --git a/src/PluginContext.hpp b/src/PluginContext.hpp index 9874464..558260f 100644 --- a/src/PluginContext.hpp +++ b/src/PluginContext.hpp @@ -41,6 +41,7 @@ static constexpr const uint kModuleParameters = 24; enum CardinalVariant { kCardinalVariantMain, kCardinalVariantFX, + kCardinalVariantNative, kCardinalVariantSynth, }; @@ -74,6 +75,8 @@ struct CardinalPluginContext : rack::Context { variant(kCardinalVariantMain), #elif CARDINAL_VARIANT_FX variant(kCardinalVariantFX), + #elif CARDINAL_VARIANT_NATIVE + variant(kCardinalVariantNative), #elif CARDINAL_VARIANT_SYNTH variant(kCardinalVariantSynth), #else diff --git a/src/override/MenuBar.cpp b/src/override/MenuBar.cpp index 59e4cce..1b2326e 100644 --- a/src/override/MenuBar.cpp +++ b/src/override/MenuBar.cpp @@ -661,13 +661,11 @@ struct EngineButton : MenuButton { } if (supportsMIDI()) { - const bool enabled = isMIDIEnabled(); std::string rightText; - if (enabled) + if (isMIDIEnabled()) rightText = CHECKMARK_STRING; - menu->addChild(createMenuItem("Enable MIDI", rightText, [enabled]() { - if (!enabled) - requestMIDI(); + menu->addChild(createMenuItem("Enable/Reconnect MIDI", rightText, []() { + requestMIDI(); })); } diff --git a/utils/create-macos-installer.sh b/utils/create-macos-installer.sh index 4530f9d..a465d2d 100755 --- a/utils/create-macos-installer.sh +++ b/utils/create-macos-installer.sh @@ -9,13 +9,12 @@ else exit fi -rm -rf res -rm -rf au -rm -rf lv2 -rm -rf vst2 -rm -rf vst3 +rm -rf res jack native au lv2 vst2 vst3 +mkdir jack native au lv2 vst2 vst3 + +mv Cardinal.app jack/CardinalJACK.app +mv CardinalNative.app native/CardinalNative.app -mkdir au lv2 vst2 vst3 mv *.component au/ mv *.lv2 lv2/ mv *.vst vst2/ @@ -31,6 +30,18 @@ pkgbuild \ --root "${PWD}/res/" \ ../dpf-cardinal-resources.pkg +pkgbuild \ + --identifier "studio.kx.distrho.plugins.cardinal.jack" \ + --install-location "/Applications/" \ + --root "${PWD}/jack/" \ + ../dpf-cardinal-jack.pkg + +pkgbuild \ + --identifier "studio.kx.distrho.plugins.cardinal.native" \ + --install-location "/Applications/" \ + --root "${PWD}/native/" \ + ../dpf-cardinal-native.pkg + pkgbuild \ --identifier "studio.kx.distrho.plugins.cardinal.components" \ --install-location "/Library/Audio/Plug-Ins/Components/" \ diff --git a/utils/distrho.icns b/utils/distrho.icns new file mode 100644 index 0000000..fd96fc6 Binary files /dev/null and b/utils/distrho.icns differ diff --git a/utils/inno/win32.iss b/utils/inno/win32.iss index 5109bd3..863ab3d 100644 --- a/utils/inno/win32.iss +++ b/utils/inno/win32.iss @@ -16,13 +16,14 @@ OutputDir=. UsePreviousAppDir=no [Types] -Name: "normal"; Description: "Normal installation (recommended)"; +Name: "full"; Description: "Full installation"; Name: "custom"; Description: "Custom installation"; Flags: iscustom; [Components] Name: resources; Description: "Resources"; Types: normal custom; Flags: fixed; Name: carla; Description: "Carla/Ildaeil host tools"; Types: normal; -Name: jack; Description: "Standalone (requires JACK)"; Types: custom; +Name: jack; Description: "Standalone (JACK)"; Types: custom; +Name: native; Description: "Standalone (Native)"; Types: custom; Name: lv2; Description: "LV2 plugin"; Types: normal; Name: vst2; Description: "VST2 plugin"; Types: normal; Name: vst3; Description: "VST3 plugin"; Types: normal; @@ -46,6 +47,8 @@ Source: "..\..\carla\build\Carla\resources\lib\*.*"; DestDir: "{commoncf32}\Card Source: "..\..\carla\build\Carla\resources\lib\PyQt5\*.*"; DestDir: "{commoncf32}\Cardinal\Carla\resources\lib\PyQt5"; Components: carla; Flags: ignoreversion; ; jack Source: "..\..\bin\Cardinal.exe"; DestDir: "{app}"; Components: jack; Flags: ignoreversion; +; native +Source: "..\..\bin\CardinalNative.exe"; DestDir: "{app}"; Components: native; Flags: ignoreversion; ; lv2 Source: "..\..\bin\Cardinal.lv2\*.*"; DestDir: "{commoncf32}\LV2\Cardinal.lv2"; Components: lv2; Flags: ignoreversion; Source: "..\..\bin\CardinalFX.lv2\*.*"; DestDir: "{commoncf32}\LV2\CardinalFX.lv2"; Components: lv2; Flags: ignoreversion; @@ -58,4 +61,5 @@ Source: "..\..\bin\CardinalFX.vst3\Contents\x86-win\CardinalFX.vst3"; DestDir: " Source: "..\..\bin\CardinalSynth.vst3\Contents\x86-win\CardinalSynth.vst3"; DestDir: "{commoncf32}\VST3\CardinalSynth.vst3\Contents\x86-win"; Components: vst3; Flags: ignoreversion; [Icons] -Name: "{commonprograms}\Cardinal"; Filename: "{app}\Cardinal.exe"; IconFilename: "{app}\distrho.ico"; WorkingDir: "{app}"; Comment: "Virtual modular synthesizer plugin"; Components: jack; +Name: "{commonprograms}\Cardinal (JACK)"; Filename: "{app}\Cardinal.exe"; IconFilename: "{app}\distrho.ico"; WorkingDir: "{app}"; Comment: "Virtual modular synthesizer plugin (JACK variant)"; Components: jack; +Name: "{commonprograms}\Cardinal (Native)"; Filename: "{app}\CardinalNative.exe"; IconFilename: "{app}\distrho.ico"; WorkingDir: "{app}"; Comment: "Virtual modular synthesizer plugin (Native variant)"; Components: native; diff --git a/utils/inno/win64.iss b/utils/inno/win64.iss index eb0d191..ac37772 100644 --- a/utils/inno/win64.iss +++ b/utils/inno/win64.iss @@ -17,13 +17,14 @@ OutputDir=. UsePreviousAppDir=no [Types] -Name: "normal"; Description: "Normal installation (recommended)"; +Name: "full"; Description: "Full installation"; Name: "custom"; Description: "Custom installation"; Flags: iscustom; [Components] Name: resources; Description: "Resources"; Types: normal custom; Flags: fixed; Name: carla; Description: "Carla/Ildaeil host tools"; Types: normal; -Name: jack; Description: "Standalone (requires JACK)"; Types: custom; +Name: jack; Description: "Standalone (JACK)"; Types: custom; +Name: native; Description: "Standalone (Native)"; Types: custom; Name: lv2; Description: "LV2 plugin"; Types: normal; Name: vst2; Description: "VST2 plugin"; Types: normal; Name: vst3; Description: "VST3 plugin"; Types: normal; @@ -47,6 +48,8 @@ Source: "..\..\carla\build\Carla\resources\lib\*.*"; DestDir: "{commoncf64}\Card Source: "..\..\carla\build\Carla\resources\lib\PyQt5\*.*"; DestDir: "{commoncf64}\Cardinal\Carla\resources\lib\PyQt5"; Components: carla; Flags: ignoreversion; ; jack Source: "..\..\bin\Cardinal.exe"; DestDir: "{app}"; Components: jack; Flags: ignoreversion; +; native +Source: "..\..\bin\CardinalNative.exe"; DestDir: "{app}"; Components: native; Flags: ignoreversion; ; lv2 Source: "..\..\bin\Cardinal.lv2\*.*"; DestDir: "{commoncf64}\LV2\Cardinal.lv2"; Components: lv2; Flags: ignoreversion; Source: "..\..\bin\CardinalFX.lv2\*.*"; DestDir: "{commoncf64}\LV2\CardinalFX.lv2"; Components: lv2; Flags: ignoreversion; @@ -59,4 +62,5 @@ Source: "..\..\bin\CardinalFX.vst3\Contents\x86_64-win\CardinalFX.vst3"; DestDir Source: "..\..\bin\CardinalSynth.vst3\Contents\x86_64-win\CardinalSynth.vst3"; DestDir: "{commoncf64}\VST3\CardinalSynth.vst3\Contents\x86_64-win"; Components: vst3; Flags: ignoreversion; [Icons] -Name: "{commonprograms}\Cardinal"; Filename: "{app}\Cardinal.exe"; IconFilename: "{app}\distrho.ico"; WorkingDir: "{app}"; Comment: "Virtual modular synthesizer plugin"; Components: jack; +Name: "{commonprograms}\Cardinal (JACK)"; Filename: "{app}\Cardinal.exe"; IconFilename: "{app}\distrho.ico"; WorkingDir: "{app}"; Comment: "Virtual modular synthesizer plugin (JACK variant)"; Components: jack; +Name: "{commonprograms}\Cardinal (Native)"; Filename: "{app}\CardinalNative.exe"; IconFilename: "{app}\distrho.ico"; WorkingDir: "{app}"; Comment: "Virtual modular synthesizer plugin (Native variant)"; Components: native; diff --git a/utils/macOS/Info_JACK.plist b/utils/macOS/Info_JACK.plist new file mode 100644 index 0000000..40d6d66 --- /dev/null +++ b/utils/macOS/Info_JACK.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Cardinal + CFBundleIconFile + distrho.icns + CFBundleIdentifier + Cardinal + NSHighResolutionCapable + + NSRequiresAquaSystemAppearance + + NSLocalNetworkUsageDescription + Cardinal requires network permissions for remote OSC control. + + diff --git a/utils/macOS/Info_Native.plist b/utils/macOS/Info_Native.plist new file mode 100644 index 0000000..bfc67c1 --- /dev/null +++ b/utils/macOS/Info_Native.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + CardinalNative + CFBundleIconFile + distrho.icns + CFBundleIdentifier + CardinalNative + NSHighResolutionCapable + + NSRequiresAquaSystemAppearance + + NSLocalNetworkUsageDescription + Cardinal requires network permissions for remote OSC control. + NSMicrophoneUsageDescription + Cardinal requires microphone permissions for audio input. + + diff --git a/utils/macOS/package.xml.in b/utils/macOS/package.xml.in index ccd08bc..381a28b 100644 --- a/utils/macOS/package.xml.in +++ b/utils/macOS/package.xml.in @@ -9,6 +9,12 @@ dpf-cardinal-resources.pkg + + dpf-cardinal-jack.pkg + + + dpf-cardinal-native.pkg + dpf-cardinal-components.pkg @@ -23,6 +29,8 @@ + + diff --git a/utils/macOS/welcome.txt b/utils/macOS/welcome.txt index 3fa7d29..e8ed845 100644 --- a/utils/macOS/welcome.txt +++ b/utils/macOS/welcome.txt @@ -2,13 +2,13 @@ Cardinal is a free and open-source virtual modular synthesizer plugin. It is based on the popular VCV Rack but with a focus on being a fully self-contained plugin version. Cardinal provides 3 plugin variants - "main", Synth and FX. -They are all equivalent in performance and behaviour, with only the IO and metadata that changes. - +They are all equivalent in performance and behaviour. FX and Synth variants both have 2 audio outputs, while "main" has 8. All variants have MIDI input and output support. -This package provides the AU, LV2, VST2 and VST3 audio plugins for macOS. +This package provides the AU, LV2, VST2 and VST3 audio plugins, plus standalones for both JACK and native audio/MIDI. Notes: - - Due to AU and VST2 not supporting CV ports, the main variant is not available for these formats. - - The VST3 version is in progress, already part of the build but still experimental. + - Due to AU and VST2 not supporting CV ports, the main variant is not available for these formats + - The VST3 version is in progress, Synth and FX variants work well, main variant is known to have issues + - The standalones are intentionally very barebones in terms of system integration, prefer to use the plugin versions if you can