new workflow, add windows support for vst, switch to pkg

This commit is contained in:
Boof2015
2026-06-01 18:27:33 -04:00
parent 281f84ec46
commit 5fe4a45df4
8 changed files with 180 additions and 16 deletions
+10 -1
View File
@@ -1,5 +1,14 @@
cmake_minimum_required(VERSION 3.22)
# macOS deployment target. Without an override, the build inherits the host SDK
# (e.g. 26 on a current Mac) which restricts the plugin to that macOS or newer.
# 11.0 (Big Sur) is a reasonable floor; well within JUCE 8's supported range.
# Override on the command line with -DCMAKE_OSX_DEPLOYMENT_TARGET=X.X — the FORCE
# is only applied when the value is empty/unset, so explicit overrides win.
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum macOS version supported" FORCE)
endif()
project(PrismPlugins VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
@@ -49,7 +58,7 @@ function(add_prism_scope TARGET PRODUCT PLUGIN_CODE SCOPE_DEFINE)
NEEDS_MIDI_INPUT FALSE
NEEDS_MIDI_OUTPUT FALSE
IS_MIDI_EFFECT FALSE
NEEDS_WEBVIEW2 FALSE # macOS uses WKWebView; flip on for Windows later
NEEDS_WEBVIEW2 TRUE # Windows: links Microsoft Edge WebView2. No-op elsewhere.
COPY_PLUGIN_AFTER_BUILD TRUE)
target_sources(${TARGET} PRIVATE
+40 -12
View File
@@ -1,9 +1,11 @@
# Prism Spectrum — DAW plugin POC
# Prism — DAW plugins
A proof-of-concept JUCE 8 plugin (VST3 / AU / Standalone, macOS) that renders Prism's
Spectrum scope inside a DAW. It **reuses Prism's existing C++ DSP** (`native/src/spectrum.cpp`,
`dsp_utils.cpp`) and the **existing React canvas UI** (`src/plugin-ui`, which imports
`src/renderer/visualizers/SpectrumAnalyzer.ts`).
JUCE 8 plugins (VST3 / AU / Standalone) that render Prism's scopes inside a DAW —
one plugin per scope: **spectrum, oscilloscope, vectorscope, spectrogram, VU meter,
loudness meter, waveform**. They **reuse Prism's existing C++ DSP** (`native/src/*.cpp`)
and the **existing React canvas UI** (`src/plugin-ui`, importing the unchanged
visualizers from `src/renderer/visualizers/`). Built for macOS and Windows; Linux
untested but should follow the same recipe.
## How it fits together
@@ -33,12 +35,13 @@ cmake -B plugin/build -S plugin -DCMAKE_BUILD_TYPE=Release # embeds the bundle (
cmake --build plugin/build --config Release
```
`COPY_PLUGIN_AFTER_BUILD` installs into your user plugin folders:
- AU: `~/Library/Audio/Plug-Ins/Components/Prism Spectrum.component`
- VST3: `~/Library/Audio/Plug-Ins/VST3/Prism Spectrum.vst3`
`COPY_PLUGIN_AFTER_BUILD` installs all seven plugins into your user plugin folders:
- AU: `~/Library/Audio/Plug-Ins/Components/Prism *.component`
- VST3: `~/Library/Audio/Plug-Ins/VST3/Prism *.vst3`
Run the **Standalone** (`plugin/build/.../Standalone/Prism Spectrum.app`) or load the
VST3/AU on a track in Ableton / FL / Logic / Reaper, play audio, and the spectrum animates.
Load any `Prism *` AU / VST3 on a track in Ableton / FL / Logic / Reaper (or run the
matching **Standalone** from `plugin/build/Prism*_artefacts/Release/Standalone/`),
play audio, and the scope animates.
(To use a local JUCE checkout instead of fetching: add `-DJUCE_PATH=/path/to/JUCE`.)
### UI development: dev-server mode (hot reload)
@@ -53,6 +56,29 @@ Edit React → the plugin window hot-reloads. The UI also runs in a plain browse
`http://localhost:5174` (no JUCE host → it shows a synthetic spectrum so the UI is
developable outside a DAW). Reconfigure without `-DPRISM_DEV_SERVER=ON` to go back to embedded.
## Build & run (Windows)
Prereqs: Visual Studio 2022 with the "Desktop development with C++" workload,
CMake ≥ 3.22, Node.js. Modern Win10 / Win11 ships with the Microsoft Edge WebView2
Runtime preinstalled; if it's missing, install the "Evergreen Standalone Installer"
from Microsoft.
```sh
npm install
npm run plugin-ui:build
cmake -B plugin\build -S plugin -G "Visual Studio 17 2022" -A x64
cmake --build plugin\build --config Release
```
`COPY_PLUGIN_AFTER_BUILD` targets the system VST3 folder
(`C:\Program Files\Common Files\VST3\Prism *.vst3`), which **needs admin
privileges**. Either run the `cmake --build` step from an elevated shell, or copy
the built bundles from `plugin\build\Prism*_artefacts\Release\VST3\` into your
user-local VST3 folder (`%LOCALAPPDATA%\Programs\Common\VST3\`) by hand — most
DAWs scan both.
Dev-server mode works the same as macOS: `-DPRISM_DEV_SERVER=ON` + `npm run plugin-ui:dev`.
## Notes
- **Refresh rate (macOS):** frames are emitted on `juce::VBlankAttachment` (synced to the
@@ -62,5 +88,7 @@ developable outside a DAW). Reconfigure without `-DPRISM_DEV_SERVER=ON` to go ba
`PreferPageRenderingUpdatesNear60FPSEnabled` feature on the live web view (no public API
exists; fine for a non-App-Store FOSS plugin). To diagnose, set `showFpsMeter` on
`<SpectrumScope/>` to overlay `render / data` fps.
- **Windows (later):** bump `NEEDS_WEBVIEW2 TRUE`; the DSP is already cross-platform. The
frame-rate workaround is macOS-only (WebView2 has its own rate behavior).
- **Windows:** `NEEDS_WEBVIEW2 TRUE` in CMake links Microsoft's Edge WebView2 runtime.
The macOS 120 Hz uncap (`Source/WebViewFrameRate.mm`, gated `if(APPLE)`) doesn't
apply — WebView2 has its own rate behavior; please report actual fps if it ever
feels low.
+10 -1
View File
@@ -172,10 +172,19 @@ void PrismSpectrumEditor::pushRestoreSettings()
void PrismSpectrumEditor::sendAppDefaults()
{
// macOS userApplicationDataDirectory is ~/Library, so append "Application Support".
// Resolve Prism's app-data dir to match Electron's userData per platform.
// macOS: userApplicationDataDirectory == ~/Library, so the Electron path is
// ~/Library/Application Support/prism (the extra subfolder only exists on mac).
// Windows/Linux: JUCE's userApplicationDataDirectory already points at the right
// per-platform config root (%APPDATA% / ~/.config), so no extra append needed.
#if JUCE_MAC
const auto appData = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory)
.getChildFile("Application Support")
.getChildFile("prism");
#else
const auto appData = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory)
.getChildFile("prism");
#endif
const auto docs = juce::File::getSpecialLocation(juce::File::userDocumentsDirectory);
const auto themesDir = docs.getChildFile("Prism Themes");
const auto profilesDir = docs.getChildFile("Prism Profiles");