Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Windows Native VST3 Host
on:
push:
branches: [ main, feature/p1-first-sound-windows, feature/p2-native-vst-catalog-fx-rack ]
branches: [ main, feature/p1-first-sound-windows, feature/p2-native-vst-catalog-fx-rack, feature/p2-daw-workflow-progress ]
pull_request:
workflow_dispatch:

Expand All @@ -27,6 +27,9 @@ jobs:
- name: Install WebView2 SDK for JUCE
shell: pwsh
run: nuget install Microsoft.Web.WebView2 -Version 1.0.3485.44 -OutputDirectory .deps -NonInteractive
- name: Validate native UI JavaScript
shell: pwsh
run: node --check web/bridge.js
- name: Configure Windows x64
shell: pwsh
run: >
Expand All @@ -46,13 +49,13 @@ jobs:
Where-Object { $_.Name -like "*AR*Mix*" -and $_.FullName -match 'Release' } |
Select-Object -First 1
if (-not $exe) { throw "ARMixConsole EXE not found" }
Copy-Item $exe.FullName "dist/AR-MIX-Studio-P2.exe"
Copy-Item $exe.FullName "dist/AR-MIX-Studio-P2-DAW.exe"
Copy-Item README.md "dist/README.md"
"P2 experimental: output muted until MONITOR ON; do not use during a public livestream without hardware tests." |
Out-File -FilePath dist/FIRST_SOUND_README.txt -Encoding utf8
- uses: actions/upload-artifact@v4
with:
name: AR-MIX-Studio-P2-Windows-x64
name: AR-MIX-Studio-P2-DAW-Workflow-Windows-x64
path: dist/
if-no-files-found: error
retention-days: 14
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ GitHub Actions: [Windows First Sound builds](https://github.com/masarray/arsonmi
The native Windows host supports **Scan VST3**, **Add Plugin Folder**, **Import VST3** and a persistent plugin catalog in user app-data. The FX Rack inside WebView2 now controls the **one native stereo audio path** with up to 8 real VST3 effects: add, bypass, reorder, remove and open plugin UI. The Windows audio setup dialog is also native, with saved device configuration.

All remaining UI preview channels and factory vocal presets are still visual; do not infer that they are running live audio. Legacy VST2 `.dll` is **not** supported or automatically treated as VST3. Plugin scanning uses a worker, but not yet a crash-isolated subprocess; avoid unknown plugins during a livestream. Read [P2 Hardware Trial](docs/P2_NATIVE_FX_RACK.md).

## P2 DAW UX improvement

Use MIX → Channel 1 ADD FX to select a real indexed VST3; PLUGINS opens Plugin Manager for scan/import only. Audio Setup now reports loading status and reuses the native selector window. Scan uses real candidate counters and indeterminate discovery stage. See [P2 DAW workflow guide](docs/P2_DAW_WORKFLOW.md).
34 changes: 34 additions & 0 deletions docs/P2_DAW_WORKFLOW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# P2 DAW Workflow & Progress UX — Windows Trial

## What changed

- **Mixer-first add:** click **ADD FX** directly on channel 1. The FX selector opens an indexed VST3 catalog with search and categories. Click **+ ADD** to insert into the real native chain; existing mixer insert buttons open plugin editors. Do not confuse the other 11 visual channel strips with native I/O.
- **Plugin Manager:** **PLUGINS** in the toolbar opens plugin administration. System scan, custom folder scan and individual `.vst3` import exist exclusively here, not inside the effects picker.
- **Real scanning progress:** while finding `.vst3` candidates the total is unknown (animated indeterminate bar). Once the scanner has enumerated candidate modules, the bar becomes determinate using **processed candidate count / total candidates**. It shows current module and effects found; no invented percentages.
- **Audio Setup progress:** opening from toolbar or SETUP immediately shows a busy dialog while JUCE initializes the selector. First-open ASIO driver enumeration may still take time. The app reports actual setup construction time in milliseconds; the native audio setup window is reused for later opens.
- **Background:** VST3 scan runs on a dedicated worker. Metadata discovery can still run untrusted third-party plugin code; there is no crash isolation in this version.
- **Monitor safety:** scanning and chain structural changes require MONITOR OFF. Live bypass uses atomic flags in the native engine.

## Quick trial

1. Download and unzip **AR-MIX-Studio-P2-DAW-Workflow-Windows-x64** from a successful GitHub Actions run.
2. Launch the EXE and click **AUDIO SETUP**. Observe a graphical progress indicator; configure your ASIO or WASAPI input/output. Close settings, then reopen to verify faster cached window reuse.
3. Click **PLUGINS** and **SCAN STANDARD FOLDERS**. Watch the scan change from discovery (indeterminate) to candidate inspection (% with real totals). Import a single .vst3 with **IMPORT INDIVIDUAL .VST3** or add a folder if needed.
4. Return to **MIX**, click **ADD FX** on Channel 1, search the catalog, and choose **+ ADD**. The effect should appear in the real channel rack. Click the inserted plugin to open its native editor.
5. With monitoring off, build your chain. Enable monitoring only after you have wired headphones at low volume and have a stable driver setup.

## Known limits

- First ASIO driver enumeration may still be slow or blocked by an external driver. Reporting an indeterminate busy state is honest; claiming a fake numeric percentage is not. Timing data supports the next performance audit.
- Scanner currently loads third-party plugin metadata in the application process. Crashes/hangs remain possible.
- The catalog indexes VST3 only. VST2 *.dll loading is unsupported.
- P2 is one native Channel 1 input path with up to eight serial stereo VST3 effects, not a complete 12-channel live mixer.
- GUI and scanner features compile in Windows CI but hardware scan/audio/editor behavior must be validated on a physical Windows PC.

## Acceptance

- Windows CI GREEN including `node --check web/bridge.js`, C++ Release build and RT tests.
- Opening Audio Setup displays busy feedback immediately; subsequent opens use the cached native window.
- Plugin Manager displays real progress with total after discovery.
- ADD FX on mixer opens selector without navigation to manager.
- No fake scan percentages, no plugin scan operations accidentally triggered from FX selection.
83 changes: 70 additions & 13 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ class PluginEditorWindow final : public juce::DocumentWindow
void closeButtonPressed() override { setVisible (false); }
};

class AudioSetupWindow final : public juce::DocumentWindow
{
public:
explicit AudioSetupWindow (juce::AudioDeviceManager& manager)
: juce::DocumentWindow ("AR MIX — ASIO / WASAPI Setup",
juce::Colour (0xff14212a), allButtons)
{
setUsingNativeTitleBar (true);
setResizable (true, true);
setResizeLimits (580, 430, 1300, 1000);
auto* selector = new juce::AudioDeviceSelectorComponent (
manager, 1, 2, 1, 2, false, false, false, false);
setContentOwned (selector, true);
centreWithSize (740, 590);
}
void closeButtonPressed() override { setVisible (false); }
};

class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer
{
public:
Expand All @@ -84,7 +102,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer
.withResourceProvider (assetFor))
{
settingsDirectory().createDirectory();
catalog_.onChanged = [this] { emitCatalog(); };
catalog_.onChanged = [this] { emitCatalog(); emitScanProgress(); };
setUsingNativeTitleBar (true);
setResizable (true, true);
setResizeLimits (1100, 650, 3840, 2160);
Expand All @@ -96,15 +114,16 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer
startupError_ = engine_.start (saved.get());
browser_.goToURL (juce::WebBrowserComponent::getResourceProviderRoot());
startTimerHz (12);
if (catalog_.entries().empty())
catalog_.scanDefaults();
// Defer initial scan until explicitly requested in Plugin Manager.
// Startup must not spend seconds enumerating third-party VST3 modules.
}

~ConsoleWindow() override
{
stopTimer();
catalog_.onChanged = nullptr;
editorWindow_.reset();
audioSetupWindow_.reset();
engine_.stop();
browser_.setVisible (false);
}
Expand All @@ -117,8 +136,10 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer
Browser browser_;
std::unique_ptr<juce::FileChooser> chooser_;
std::unique_ptr<PluginEditorWindow> editorWindow_;
std::unique_ptr<AudioSetupWindow> audioSetupWindow_;
juce::String startupError_, lastAudioXml_;
bool initialStateSent_ = false;
bool setupLaunching_ = false;
unsigned int timerTicks_ = 0;

void emitNotice (const juce::String& message, bool error = false)
Expand Down Expand Up @@ -158,18 +179,51 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer
engine_.setMasterMuted (bool (value));
}

void emitSetupPhase (const juce::String& phase, int elapsedMs = 0)
{
auto o = std::make_unique<juce::DynamicObject>();
o->setProperty ("phase", phase);
o->setProperty ("elapsedMs", elapsedMs);
if (browser_.loaded)
browser_.emitEventIfBrowserIsVisible ("arMixSetupProgress", juce::var (o.release()));
}

void emitScanProgress()
{
if (browser_.loaded)
browser_.emitEventIfBrowserIsVisible ("arMixScanProgress", catalog_.progress());
}

void showDeviceSetup()
{
juce::DialogWindow::LaunchOptions opts;
opts.dialogTitle = "AR MIX — ASIO / WASAPI Audio Setup";
opts.dialogBackgroundColour = juce::Colour (0xff14212a);
auto* selector = new juce::AudioDeviceSelectorComponent (
engine_.devices(), 1, 2, 1, 2, false, false, false, false);
selector->setSize (720, 560);
opts.content.setOwned (selector);
opts.useNativeTitleBar = true;
opts.resizable = true;
opts.launchAsync();
if (setupLaunching_) return;

// The native JUCE device list is cached after first construction:
// reopening the settings window avoids repeating full widget setup.
if (audioSetupWindow_ != nullptr)
{
audioSetupWindow_->setVisible (true);
audioSetupWindow_->toFront (true);
emitSetupPhase ("opened", 0);
return;
}

setupLaunching_ = true;
emitSetupPhase ("preparing");
const auto begin = juce::Time::getMillisecondCounter();
juce::Timer::callAfterDelay (150,
[safe = juce::Component::SafePointer<ConsoleWindow> (this), begin]
{
if (safe == nullptr) return;
safe->emitSetupPhase ("enumerating");
safe->audioSetupWindow_ =
std::make_unique<AudioSetupWindow> (safe->engine_.devices());
safe->audioSetupWindow_->setVisible (true);
safe->audioSetupWindow_->toFront (true);
safe->setupLaunching_ = false;
safe->emitSetupPhase ("opened",
static_cast<int> (juce::Time::getMillisecondCounter() - begin));
});
}

void chooseImport()
Expand Down Expand Up @@ -294,8 +348,11 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer
{
initialStateSent_ = true;
emitCatalog();
emitScanProgress();
emitChain();
}
if (catalog_.busy() && timerTicks_ % 3 == 0)
emitScanProgress();
// Persist configuration off the callback; cap XML serialization to ~3 s.
if (++timerTicks_ % 36 == 0)
{
Expand Down
55 changes: 52 additions & 3 deletions src/PluginCatalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,25 @@ class PluginCatalog final
const std::vector<CatalogEntry>& entries() const noexcept { return entries_; }
bool busy() const noexcept { return scanning_.load(); }
juce::String scanMessage() const { return scanMessage_; }
// Real scan counters. Enumeration has no known denominator; only report
// a percentage after candidate discovery has finished.
juce::var progress() const
{
auto result = std::make_unique<juce::DynamicObject>();
const auto phase = phase_.load (std::memory_order_acquire);
const auto total = total_.load (std::memory_order_relaxed);
result->setProperty ("active", busy());
result->setProperty ("phase", phase == 1 ? "discovering" :
phase == 2 ? "inspecting" : "done");
result->setProperty ("done", completed_.load (std::memory_order_relaxed));
result->setProperty ("total", total);
result->setProperty ("found", found_.load (std::memory_order_relaxed));
{
const juce::ScopedLock lock (progressLock_);
result->setProperty ("current", current_);
}
return juce::var (result.release());
}
Callback onChanged;

void addDirectory (const juce::File& folder)
Expand Down Expand Up @@ -146,6 +165,9 @@ class PluginCatalog final
#endif
std::vector<CatalogEntry> found;
juce::VST3PluginFormat format;
juce::StringArray allCandidates;
// 1. Enumerate candidates. Total cannot be estimated here.
owner_.phase_.store (1, std::memory_order_release);
for (const auto& requested : requested_)
{
if (threadShouldExit()) break;
Expand All @@ -159,11 +181,23 @@ class PluginCatalog final
}
else if (file.hasFileExtension (".vst3"))
candidates.add (requested);

for (const auto& path : candidates)
allCandidates.addIfNotAlreadyThere (path);
}

// 2. Inspect actual plugins; progress denominator is now real.
owner_.total_.store (allCandidates.size(), std::memory_order_relaxed);
owner_.phase_.store (2, std::memory_order_release);
for (int n = 0; n < allCandidates.size(); ++n)
{
if (threadShouldExit()) break;
const auto path = allCandidates[n];
{
const juce::ScopedLock lock (owner_.progressLock_);
owner_.current_ = juce::File (path).getFileName();
}
if (format.fileMightContainThisPluginType (path))
{
if (threadShouldExit()) break;
if (! format.fileMightContainThisPluginType (path)) continue;
juce::OwnedArray<juce::PluginDescription> descriptions;
format.findAllTypesForFile (descriptions, path);
for (int i = 0; i < descriptions.size(); ++i)
Expand All @@ -175,6 +209,12 @@ class PluginCatalog final
desc->uniqueId, i });
}
}
owner_.found_.store (static_cast<int> (found.size()), std::memory_order_relaxed);
owner_.completed_.store (n + 1, std::memory_order_release);
}
{
const juce::ScopedLock lock (owner_.progressLock_);
owner_.current_.clear();
}
#if JUCE_WINDOWS
if (SUCCEEDED (hr)) CoUninitialize();
Expand All @@ -198,6 +238,7 @@ class PluginCatalog final
[] (const CatalogEntry& a, const CatalogEntry& b)
{ return a.name.compareIgnoreCase (b.name) < 0; });
owner.scanMessage_ = "Scan complete: " + juce::String (results.size()) + " plugin variants inspected";
owner.phase_.store (0, std::memory_order_release);
owner.scanning_.store (false);
owner.save();
if (owner.onChanged) owner.onChanged();
Expand All @@ -208,6 +249,11 @@ class PluginCatalog final
void scan (const juce::StringArray& paths)
{
if (busy()) return;
completed_.store (0);
total_.store (0);
found_.store (0);
phase_.store (1);
{ const juce::ScopedLock lock (progressLock_); current_.clear(); }
scanning_.store (true);
scanMessage_ = "Scanning VST3 metadata (background)...";
if (onChanged) onChanged();
Expand Down Expand Up @@ -251,6 +297,9 @@ class PluginCatalog final
juce::StringArray customFolders_;
std::atomic<bool> alive_ { true }, scanning_ { false };
std::shared_ptr<std::atomic<bool>> lifetime_ = std::make_shared<std::atomic<bool>> (true);
mutable juce::CriticalSection progressLock_;
juce::String current_;
std::atomic<int> phase_ { 0 }, total_ { 0 }, completed_ { 0 }, found_ { 0 };
juce::String scanMessage_ = "Ready";
Scanner worker_;
};
Loading
Loading