From 2f30886df4e68820851a86ad81b164383a0b4f1a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 06:34:11 +0700 Subject: [PATCH 1/7] feat(native): add isolated hand-painted JUCE mixer canvas with accurate fader/meter scales --- native/canvas-preview/NativeMixerCanvas.h | 450 ++++++++++++++++++++++ 1 file changed, 450 insertions(+) create mode 100644 native/canvas-preview/NativeMixerCanvas.h diff --git a/native/canvas-preview/NativeMixerCanvas.h b/native/canvas-preview/NativeMixerCanvas.h new file mode 100644 index 000000000..fb1bd095f --- /dev/null +++ b/native/canvas-preview/NativeMixerCanvas.h @@ -0,0 +1,450 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +// Native, hand-drawn JUCE Component. No HTML/WebView and no audio DSP. +// All public setters and callbacks must be called on the JUCE message thread. +namespace armix::native_canvas +{ +struct ChannelState +{ + juce::String name; + float gainDb = 0.0f; + float pan = 0.0f; // -1 left, 0 centre, +1 right + float meterLDb = -100.0f; + float meterRDb = -100.0f; + bool muted = false; + bool solo = false; + bool clip = false; +}; + +class MixerCanvas final : public juce::Component +{ +public: + static constexpr std::size_t inputCount = 12; + static constexpr std::size_t channelCount = inputCount + 1; + std::function onGainChanged; + std::function onPanChanged; + std::function onMuteChanged; + std::function onSoloChanged; + + MixerCanvas() + { + const char* labels[] = { "MIC 1", "MIC 2", "MIC 3", "MIC 4", + "IN 5", "IN 6", "IN 7", "IN 8", + "IN 9", "IN 10", "IN 11", "IN 12", "MASTER" }; + for (std::size_t i = 0; i < channelCount; ++i) + channels[i].name = labels[i]; + setOpaque (true); + setMouseCursor (juce::MouseCursor::NormalCursor); + } + + // Source-labelled meter samples are supplied by the host. This prototype + // does not generate decorative/fake audio readings. + void setMeter (std::size_t i, float leftDb, float rightDb, bool clipped) + { + if (i >= channelCount) + return; + channels[i].meterLDb = finiteMeter (leftDb); + channels[i].meterRDb = finiteMeter (rightDb); + channels[i].clip = clipped; + repaint (boundsFor (i).toNearestInt()); + } + + void setGainDb (std::size_t i, float db) + { + if (i < channelCount && std::isfinite (db)) + { + channels[i].gainDb = std::clamp (db, minGainDb, maxGainDb); + repaint (boundsFor (i).toNearestInt()); + } + } + + void setPan (std::size_t i, float p) + { + if (i < channelCount && std::isfinite (p)) + { + channels[i].pan = std::clamp (p, -1.0f, 1.0f); + repaint (boundsFor (i).toNearestInt()); + } + } + + void setMute (std::size_t i, bool muted) + { + if (i < channelCount) + { + channels[i].muted = muted; + repaint (boundsFor (i).toNearestInt()); + } + } + + void setSolo (std::size_t i, bool solo) + { + if (i < channelCount) + { + channels[i].solo = solo; + repaint (boundsFor (i).toNearestInt()); + } + } + + void paint (juce::Graphics& g) override + { + g.fillAll (juce::Colour::fromRGB (14, 18, 23)); + g.setColour (juce::Colour::fromRGB (218, 225, 229)); + g.setFont (15.0f); + g.drawText ("ArSonMix / NATIVE MIXER CANVAS", 16, 8, 390, 28, + juce::Justification::centredLeft); + g.setColour (juce::Colour::fromRGB (119, 139, 150)); + g.setFont (11.0f); + g.drawText ("JUCE preview | UI only | meters require a native source", + 408, 9, getWidth() - 420, 26, juce::Justification::centredRight); + for (std::size_t i = 0; i < channelCount; ++i) + paintStrip (g, i); + } + + void mouseDown (const juce::MouseEvent& e) override + { + const int hit = channelAt (e.position); + if (hit < 0) + return; + activeChannel = hit; + selected = static_cast (hit); + dragMode = DragMode::none; + const auto i = selected; + const auto r = boundsFor (i); + const auto p = panBounds (r); + const auto f = faderBounds (r); + const auto mute = buttonBounds (r, false); + const auto solo = buttonBounds (r, true); + + if (mute.contains (e.position)) + { + channels[i].muted = !channels[i].muted; + if (onMuteChanged) onMuteChanged (i, channels[i].muted); + } + else if (solo.contains (e.position)) + { + channels[i].solo = !channels[i].solo; + if (onSoloChanged) onSoloChanged (i, channels[i].solo); + } + else if (p.expanded (0.0f, 6.0f).contains (e.position)) + { + dragMode = DragMode::pan; + dragStart = e.position; + dragStartValue = channels[i].pan; + } + else if (f.expanded (19.0f, 13.0f).contains (e.position)) + { + // Relative dragging: clicking the track NEVER teleports the thumb. + dragMode = DragMode::gain; + dragStart = e.position; + dragStartValue = channels[i].gainDb; + } + repaint(); + } + + void mouseDrag (const juce::MouseEvent& e) override + { + if (activeChannel < 0) + return; + const auto i = static_cast (activeChannel); + if (dragMode == DragMode::gain) + { + const float pixels = std::max (1.0f, faderBounds (boundsFor (i)).getHeight()); + const float candidate = std::clamp (dragStartValue - + ((e.position.y - dragStart.y) / pixels) * (maxGainDb - minGainDb), + minGainDb, maxGainDb); + if (std::abs (candidate - channels[i].gainDb) > 0.001f) + { + channels[i].gainDb = candidate; + if (onGainChanged) onGainChanged (i, candidate); + repaint (boundsFor (i).toNearestInt()); + } + } + else if (dragMode == DragMode::pan) + { + const auto width = std::max (1.0f, panBounds (boundsFor (i)).getWidth()); + float candidate = std::clamp (dragStartValue + + ((e.position.x - dragStart.x) / width) * 2.0f, -1.0f, 1.0f); + if (std::abs (candidate) < 0.035f) + candidate = 0.0f; + if (std::abs (candidate - channels[i].pan) > 0.001f) + { + channels[i].pan = candidate; + if (onPanChanged) onPanChanged (i, candidate); + repaint (boundsFor (i).toNearestInt()); + } + } + } + + void mouseUp (const juce::MouseEvent&) override + { + activeChannel = -1; + dragMode = DragMode::none; + } + + void mouseDoubleClick (const juce::MouseEvent& e) override + { + const auto hit = channelAt (e.position); + if (hit < 0) + return; + const auto i = static_cast (hit); + const auto r = boundsFor (i); + if (faderBounds (r).expanded (19.0f, 13.0f).contains (e.position)) + { + setGainDb (i, 0.0f); + if (onGainChanged) onGainChanged (i, 0.0f); + } + else if (panBounds (r).contains (e.position)) + { + setPan (i, 0.0f); + if (onPanChanged) onPanChanged (i, 0.0f); + } + } + + void mouseWheelMove (const juce::MouseEvent& e, + const juce::MouseWheelDetails& wheel) override + { + const int hit = channelAt (e.position); + if (hit < 0 || wheel.deltaY == 0.0f) + return; + const auto i = static_cast (hit); + const auto r = boundsFor (i); + if (! faderBounds (r).expanded (19.0f, 15.0f).contains (e.position)) + return; + const float newDb = std::clamp (channels[i].gainDb + wheel.deltaY * 2.0f, + minGainDb, maxGainDb); + setGainDb (i, newDb); + if (onGainChanged) onGainChanged (i, newDb); + } + +private: + enum class DragMode { none, gain, pan }; + static constexpr float minGainDb = -60.0f; + static constexpr float maxGainDb = 10.0f; + std::array channels {}; + std::size_t selected = 0; + int activeChannel = -1; + DragMode dragMode = DragMode::none; + juce::Point dragStart; + float dragStartValue = 0.0f; + + static float finiteMeter (float dB) noexcept + { + return std::isfinite (dB) ? std::clamp (dB, -100.0f, 6.0f) : -100.0f; + } + + juce::Rectangle boundsFor (std::size_t i) const noexcept + { + const float left = 10.0f, gap = 2.0f, masterWidth = 146.0f; + const float width = static_cast (getWidth()); + const float usable = std::max (980.0f, width) - 20.0f + - masterWidth - inputCount * gap; + const float stripWidth = usable / static_cast (inputCount); + const float x = i == inputCount + ? left + inputCount * (stripWidth + gap) + : left + static_cast (i) * (stripWidth + gap); + return { x, 45.0f, i == inputCount ? masterWidth : stripWidth, + std::max (470.0f, static_cast (getHeight()) - 54.0f) }; + } + + static juce::Rectangle panBounds (juce::Rectangle r) noexcept + { + return { r.getX() + 10.0f, r.getY() + 45.0f, + r.getWidth() - 20.0f, 17.0f }; + } + + static juce::Rectangle buttonBounds (juce::Rectangle r, bool solo) noexcept + { + const float width = (r.getWidth() - 22.0f) * 0.5f; + return { r.getX() + 8.0f + (solo ? width + 6.0f : 0.0f), + r.getY() + 71.0f, width, 25.0f }; + } + + static juce::Rectangle faderBounds (juce::Rectangle r) noexcept + { + const float top = r.getY() + 268.0f; + return { r.getX() + r.getWidth() * 0.49f - 3.0f, top, 6.0f, + std::max (80.0f, r.getBottom() - 66.0f - top) }; + } + + static float gainY (juce::Rectangle fader, float gainDb) noexcept + { + return fader.getBottom() - (gainDb - minGainDb) / + (maxGainDb - minGainDb) * fader.getHeight(); + } + + int channelAt (juce::Point p) const noexcept + { + for (std::size_t i = 0; i < channelCount; ++i) + if (boundsFor (i).contains (p)) return static_cast (i); + return -1; + } + + static void drawButton (juce::Graphics& g, juce::Rectangle b, + const juce::String& text, bool lit, juce::Colour on) + { + const auto base = lit ? on : juce::Colour::fromRGB (43, 48, 56); + g.setGradientFill (juce::ColourGradient (base.brighter (0.12f), b.getTopLeft(), + base.darker (0.28f), b.getBottomLeft(), false)); + g.fillRoundedRectangle (b, 2.5f); + g.setColour (lit ? on.brighter (0.30f) : juce::Colour::fromRGB (91, 97, 105)); + g.drawRoundedRectangle (b.reduced (0.5f), 2.5f, 1.0f); + g.setColour (juce::Colours::white.withAlpha (lit ? 1.0f : 0.86f)); + g.setFont (10.0f); + g.drawText (text, b.toNearestInt(), juce::Justification::centred); + } + + static void drawMeter (juce::Graphics& g, juce::Rectangle b, + float level, bool clipped) + { + g.setColour (juce::Colour::fromRGB (5, 9, 13)); + g.fillRoundedRectangle (b, 1.2f); + const float t = std::clamp ((level + 60.0f) / 60.0f, 0.0f, 1.0f); + const float full = b.getHeight(), bottom = b.getBottom(); + // Independent 0..-60 dB meter axis, NOT the +10..-60 fader axis. + for (int band = 0; band < 3; ++band) + { + const float from = band == 0 ? 0.0f : band == 1 ? 0.72f : 0.94f; + const float to = band == 0 ? 0.72f : band == 1 ? 0.94f : 1.0f; + const float visible = std::clamp (t - from, 0.0f, to - from); + if (visible <= 0.0f) continue; + const auto colour = band == 0 ? juce::Colour::fromRGB (29, 185, 95) + : band == 1 ? juce::Colour::fromRGB (237, 185, 41) + : juce::Colour::fromRGB (229, 67, 67); + g.setColour (colour); + g.fillRect (b.getX() + 1.0f, bottom - (from + visible) * full, + b.getWidth() - 2.0f, visible * full); + } + g.setColour (clipped ? juce::Colour::fromRGB (238, 56, 51) + : juce::Colour::fromRGB (60, 71, 79)); + g.fillRect (b.getX(), b.getY() - 7.0f, b.getWidth(), 4.0f); + } + + void paintStrip (juce::Graphics& g, std::size_t i) + { + const auto r = boundsFor (i); + const auto& ch = channels[i]; + const bool master = i == inputCount; + const auto accent = master ? juce::Colour::fromRGB (218, 69, 65) + : juce::Colour::fromHSV ( + std::fmod (0.55f + static_cast (i) * 0.075f, 1.0f), + 0.58f, 0.86f, 1.0f); + g.setGradientFill (juce::ColourGradient ( + juce::Colour::fromRGB (38, 43, 51), r.getTopLeft(), + juce::Colour::fromRGB (24, 28, 35), r.getBottomLeft(), false)); + g.fillRoundedRectangle (r, 3.0f); + g.setColour (i == selected ? juce::Colour::fromRGB (238, 169, 60) + : juce::Colour::fromRGB (72, 81, 91)); + g.drawRoundedRectangle (r.reduced (0.75f), 3.0f, i == selected ? 1.5f : 0.8f); + + g.setColour (accent); + g.fillRect (r.getX() + 2, r.getY() + 2, r.getWidth() - 4, 3.0f); + + // Top dB readout and pan are separately controlled. + g.setColour (juce::Colour::fromRGB (9, 14, 18)); + g.fillRoundedRectangle (r.getX() + 8, r.getY() + 10, r.getWidth() - 16, 28, 2.5f); + g.setColour (juce::Colour::fromRGB (89, 223, 224)); + g.setFont (14.0f); + g.drawText (juce::String (ch.gainDb, 1) + " dB", + juce::Rectangle {r.getX() + 8, r.getY() + 10, + r.getWidth() - 16, 28}.toNearestInt(), + juce::Justification::centred); + + const auto pan = panBounds (r); + g.setColour (juce::Colour::fromRGB (9, 12, 16)); + g.fillRoundedRectangle (pan, 3.0f); + g.setColour (juce::Colour::fromRGB (76, 96, 109)); + g.drawLine (pan.getX() + 7, pan.getCentreY(), + pan.getRight() - 7, pan.getCentreY(), 2.0f); + const float centre = pan.getCentreX(); + g.setColour (juce::Colour::fromRGB (97, 132, 142)); + g.drawLine (centre, pan.getY() + 2, centre, pan.getBottom() - 2, 1.0f); + const float px = centre + ch.pan * (pan.getWidth() * 0.5f - 11.0f); + g.setColour (juce::Colour::fromRGB (198, 209, 214)); + g.fillRoundedRectangle (px - 4.5f, pan.getY() + 1.0f, 9, pan.getHeight() - 2, 2); + + drawButton (g, buttonBounds (r, false), "MUTE", ch.muted, + juce::Colour::fromRGB (177, 45, 48)); + drawButton (g, buttonBounds (r, true), "SOLO", ch.solo, + juce::Colour::fromRGB (182, 144, 26)); + + // Six explicitly unassigned native FX placeholders. Do not pretend + // they route audio; real inserts require the host's DSP/graph adapter. + g.setFont (9.0f); + for (int slot = 0; slot < 6; ++slot) + { + const juce::Rectangle fx (r.getX() + 8, r.getY() + 109.0f + slot * 24.0f, + r.getWidth() - 16, 21); + g.setColour (juce::Colour::fromRGB (17, 27, 37)); + g.fillRoundedRectangle (fx, 2.0f); + g.setColour (juce::Colour::fromRGB (47, 67, 82)); + g.drawRoundedRectangle (fx, 2.0f, 0.7f); + g.setColour (juce::Colour::fromRGB (127, 146, 160)); + g.drawText ("FX " + juce::String (slot + 1) + " EMPTY", + fx.toNearestInt(), juce::Justification::centred); + } + + const auto f = faderBounds (r); + g.setColour (juce::Colour::fromRGB (8, 10, 13)); + g.fillRoundedRectangle (f.expanded (3, 0), 3.0f); + // Fader labels: physical dB position aligns with cap's black index line. + for (float db : { 10.0f, 0.0f, -10.0f, -20.0f, -30.0f, + -40.0f, -50.0f, -60.0f }) + { + const float y = gainY (f, db); + g.setColour (juce::Colour::fromRGB (113, 125, 132)); + g.drawLine (f.getRight() + 8, y, f.getRight() + 13, y, 1.0f); + g.setFont (9.5f); + g.drawText (juce::String (static_cast (db)), + juce::Rectangle (juce::roundToInt (f.getRight() + 16), + juce::roundToInt (y - 7), 24, 14), + juce::Justification::centredLeft); + } + + const float capY = gainY (f, ch.gainDb); + const juce::Rectangle cap (f.getCentreX() - 15.0f, capY - 11.0f, 30, 22); + const auto capBase = master ? juce::Colour::fromRGB (201, 76, 70) + : juce::Colour::fromRGB (176, 189, 199); + g.setGradientFill (juce::ColourGradient (capBase.brighter (0.26f), cap.getTopLeft(), + capBase.darker (0.43f), + cap.getBottomLeft(), false)); + g.fillRoundedRectangle (cap, 2.7f); + g.setColour (juce::Colour::fromRGB (34, 39, 44)); + g.drawRoundedRectangle (cap, 2.7f, 1.0f); + g.setColour (juce::Colour::fromRGB (15, 19, 21)); + g.fillRect (cap.getX() + 2, capY - 1, cap.getWidth() - 4, 2.0f); + + // Independent vertical meter lane (0..-60 dB; no shared scale). + const juce::Rectangle meter (r.getX() + 8, f.getY(), master ? 10.0f : 11.0f, + f.getHeight()); + drawMeter (g, meter, ch.meterLDb, ch.clip); + if (master) + drawMeter (g, meter.translated (13.0f, 0), ch.meterRDb, ch.clip); + g.setColour (juce::Colour::fromRGB (110, 124, 131)); + g.setFont (9.0f); + g.drawText (master ? "L R" : "VU", r.getX() + 5, f.getY() - 17, 40, 13, + juce::Justification::centredLeft); + g.setColour (juce::Colour::fromRGB (110, 124, 131)); + g.drawText ("0", juce::roundToInt (meter.getX()), juce::roundToInt (meter.getY() - 27), + 20, 11, juce::Justification::centredLeft); + g.drawText ("-60", juce::roundToInt (meter.getX()), + juce::roundToInt (meter.getBottom() + 6), 30, 11, + juce::Justification::centredLeft); + + const juce::Rectangle footer (r.getX() + 3, r.getBottom() - 42, + r.getWidth() - 6, 35); + g.setColour (accent.darker (0.45f)); + g.fillRoundedRectangle (footer, 2.0f); + g.setColour (juce::Colours::white); + g.setFont (12.0f); + g.drawFittedText (ch.name, footer.toNearestInt(), + juce::Justification::centred, 1); + } +}; +} // namespace armix::native_canvas From 0f8b5f13f0532cbb7cc9895e5f16a7c7cf933bf2 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 06:35:22 +0700 Subject: [PATCH 2/7] feat(native): add independent JUCE mixer preview app --- native/canvas-preview/main.cpp | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 native/canvas-preview/main.cpp diff --git a/native/canvas-preview/main.cpp b/native/canvas-preview/main.cpp new file mode 100644 index 000000000..02b467b9a --- /dev/null +++ b/native/canvas-preview/main.cpp @@ -0,0 +1,40 @@ +#include "NativeMixerCanvas.h" +#include +#include + +namespace { +class MixerWindow final : public juce::DocumentWindow +{ +public: + MixerWindow() + : juce::DocumentWindow ("ArSonMix - Native JUCE Mixer Canvas", + juce::Colour::fromRGB (14, 18, 23), + juce::DocumentWindow::closeButton) + { + setUsingNativeTitleBar (true); + setContentOwned (new armix::native_canvas::MixerCanvas(), true); + setResizable (true, false); + setResizeLimits (1200, 680, 2560, 1600); + centreWithSize (1440, 820); + setVisible (true); + } + void closeButtonPressed() override + { + if (auto* app = juce::JUCEApplication::getInstance()) + app->systemRequestedQuit(); + } +}; +class CanvasPreviewApplication final : public juce::JUCEApplication +{ +public: + const juce::String getApplicationName() override { return "ArSonMix Native Mixer Canvas"; } + const juce::String getApplicationVersion() override { return "0.1.0"; } + bool moreThanOneInstanceAllowed() override { return false; } + void initialise (const juce::String&) override { window = std::make_unique(); } + void shutdown() override { window.reset(); } + void systemRequestedQuit() override { quit(); } +private: + std::unique_ptr window; +}; +} +START_JUCE_APPLICATION (CanvasPreviewApplication) From e8eb9e611dfa19633e153d65d54531aeb3cd7b33 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 06:35:24 +0700 Subject: [PATCH 3/7] build(native): add isolated JUCE canvas target --- native/canvas-preview/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 native/canvas-preview/CMakeLists.txt diff --git a/native/canvas-preview/CMakeLists.txt b/native/canvas-preview/CMakeLists.txt new file mode 100644 index 000000000..c00870839 --- /dev/null +++ b/native/canvas-preview/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.22) +project(ARMixNativeMixerCanvasPreview VERSION 0.1.0 LANGUAGES C CXX) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if (NOT DEFINED JUCE_ROOT) + message(FATAL_ERROR "Pass -DJUCE_ROOT=/path/to/JUCE (8.0.15 or newer)") +endif() + +# Independent preview; leaves production WebView2 and real-time audio untouched. +add_subdirectory("${JUCE_ROOT}" "${CMAKE_BINARY_DIR}/juce") + +juce_add_gui_app(ARMixNativeMixerCanvasPreview + PRODUCT_NAME "ArSonMix Native Canvas Preview" + COMPANY_NAME "ArSonMix" + BUNDLE_ID "org.armix.nativecanvaspreview") + +target_sources(ARMixNativeMixerCanvasPreview PRIVATE + main.cpp NativeMixerCanvas.h) +target_link_libraries(ARMixNativeMixerCanvasPreview PRIVATE + juce::juce_gui_extra + juce::juce_recommended_config_flags + juce::juce_recommended_warning_flags) +target_compile_definitions(ARMixNativeMixerCanvasPreview PRIVATE + JUCE_WEB_BROWSER=0 JUCE_USE_CURL=0) From 008475877bdead30e2c4c95928cea8284e1ad178 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 06:36:47 +0700 Subject: [PATCH 4/7] tools: offer local browser canvas capture script --- tools/capture_ui24_canvas.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tools/capture_ui24_canvas.js diff --git a/tools/capture_ui24_canvas.js b/tools/capture_ui24_canvas.js new file mode 100644 index 000000000..43f36904d --- /dev/null +++ b/tools/capture_ui24_canvas.js @@ -0,0 +1,32 @@ +// Paste into DevTools Console on https://www.soundcraft.com/ui24-software-demo/mixer.html +// Download-only capture. No upload, no remote requests, no proprietary JS extraction. +(async function () { + const canvases = [...document.querySelectorAll("canvas")]; + const stamp = new Date().toISOString().replace(/[:.]/g, "-"); + const manifest = {url: location.href, timestamp: new Date().toISOString(), + dpr: window.devicePixelRatio, canvases: []}; + function save(blob, filename) { + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; a.download = filename; + document.body.appendChild(a); a.click(); a.remove(); + setTimeout(() => URL.revokeObjectURL(url), 10000); + } + for (const [i, c] of canvases.entries()) { + const r = c.getBoundingClientRect(); + const rec = {index:i, width:c.width, height:c.height, + x:r.x,y:r.y,cssWidth:r.width,cssHeight:r.height}; + try { + const blob = await new Promise((resolve,reject) => { + try { c.toBlob(resolve,"image/png"); } catch(e) { reject(e); } + }); + if (!blob) throw new Error("canvas cannot be exported"); + save(blob, "ui24-canvas-" + i + "-" + stamp + ".png"); + rec.capture = "downloaded"; rec.bytes = blob.size; + } catch (err) { rec.capture = "failed"; rec.error = String(err); } + manifest.canvases.push(rec); + } + save(new Blob([JSON.stringify(manifest,null,2)], {type:"application/json"}), + "ui24-canvas-manifest-" + stamp + ".json"); + console.table(manifest.canvases); +})(); From 6d55173af589dd9946aa5b4fe0526574864c2218 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 06:36:49 +0700 Subject: [PATCH 5/7] docs(native): report Soundcraft canvas findings, build and integration boundaries --- docs/ARD_NATIVE_JUCE_MIXER_CANVAS_20261027.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/ARD_NATIVE_JUCE_MIXER_CANVAS_20261027.md diff --git a/docs/ARD_NATIVE_JUCE_MIXER_CANVAS_20261027.md b/docs/ARD_NATIVE_JUCE_MIXER_CANVAS_20261027.md new file mode 100644 index 000000000..c9d021d5c --- /dev/null +++ b/docs/ARD_NATIVE_JUCE_MIXER_CANVAS_20261027.md @@ -0,0 +1,35 @@ +# Native JUCE canvas research and proof of concept (2026-10-27) + +Reference: https://www.soundcraft.com/ui24-software-demo/mixer.html + +## Technical findings +The Soundcraft Ui24 demo uses HTML5 Canvas. A rendered canvas is a pixel surface, not an exportable collection of JUCE widgets. PNG screenshots cannot restore drawing logic, hit regions, channel state, or DSP. The original Soundcraft page blocked direct server-side fetch (403), while the connected browser tab showed an HTML5 Canvas fallback. No exact live-page pixel parity or original asset inventory has been verified. + +## Implemented +- Separate, original JUCE paint-based MixerCanvas and standalone demo, not a copy of Soundcraft image/code assets. +- 12 input strips and master. Dedicated fader scale (+10 to -60 dB), separate meter scale (0 to -60 dB). Thumb index line matches gain position. +- Relative fader dragging without click-jump, double click to 0 dB, wheel adjustment, relative PAN dragging with centre detent, MUTE/SOLO toggles. +- Six visibly EMPTY FX placeholders per strip, explicitly not connected to VST3/audio DSP. +- Meter levels default dark/off until the native host supplies real data via setMeter. No fabricated signal. +- Production WebView2, the approved v0.8 layout, native audio callbacks, CSS and existing application build are untouched. + +## Build (C++20 / JUCE >= 8.0.15) + + cmake -S native/canvas-preview -B build/native-canvas -DJUCE_ROOT=C:/JUCE + cmake --build build/native-canvas --config Release --target ARMixNativeMixerCanvasPreview + +JUCE SDK / Windows compiler is not present in the analysis environment, so this initial PR has NOT been compile-tested or hardware-tested. + +## Obtain true pixel captures from the referenced website +Open the working Ui24 demo in Chrome/Edge. Once fully rendered, open DevTools Console and review/paste the source from tools/capture_ui24_canvas.js. It downloads the local canvas image(s) and a JSON manifest. Browser cross-origin tainting and WebGL restrictions may prevent export; errors are reported. Capturing a canvas does not convert it to native widgets. No third-party Soundcraft assets are bundled, and captures should stay as private local references unless redistribution permission is confirmed. + +## Further engineering before production +1. Compare obtained captures with native JUCE preview at 1440x820 and 1680x920, plus DPI 125/150%. +2. Implement a typed native message-thread command/state adapter. Never call JUCE GUI methods on DSP audio callback. +3. Bind real FX rows to VST catalog/state, authoritative bypass, real PAN/gain, preset recall and rollback. +4. Add real-meter coalescing with peak hold, clip latch and source labels. Do not invent signal readings. +5. Build/test on Windows JUCE; add hit-region, relative drag, fader/meter scale, resize and screenshot tests. +6. Require explicit replacement/design approval against the GUI v0.8 lock before integration. +7. Native multi-channel audio and hardware crackling P0 acceptance remain separate and incomplete. + +This prototype is NOT a byte-identical or pixel-perfect proprietary Soundcraft clone, a production VST mixer GUI, or an audio-ready 13-channel host. From 00f1a758e76ba6eeb64fc3c5dc0638447b4d5a60 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 06:38:16 +0700 Subject: [PATCH 6/7] fix(native canvas): draw independent meter ticks at exact 0 to -60 dB coordinates --- native/canvas-preview/NativeMixerCanvas.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/native/canvas-preview/NativeMixerCanvas.h b/native/canvas-preview/NativeMixerCanvas.h index fb1bd095f..29954b378 100644 --- a/native/canvas-preview/NativeMixerCanvas.h +++ b/native/canvas-preview/NativeMixerCanvas.h @@ -430,12 +430,13 @@ class MixerCanvas final : public juce::Component g.setFont (9.0f); g.drawText (master ? "L R" : "VU", r.getX() + 5, f.getY() - 17, 40, 13, juce::Justification::centredLeft); - g.setColour (juce::Colour::fromRGB (110, 124, 131)); - g.drawText ("0", juce::roundToInt (meter.getX()), juce::roundToInt (meter.getY() - 27), - 20, 11, juce::Justification::centredLeft); - g.drawText ("-60", juce::roundToInt (meter.getX()), - juce::roundToInt (meter.getBottom() + 6), 30, 11, - juce::Justification::centredLeft); + // Meter has its own accurate 0..-60 dB tick axis beside the VU lane. + for (float db : { 0.0f, -6.0f, -12.0f, -24.0f, -36.0f, -48.0f, -60.0f }) + { + const float y = meter.getBottom() - ((db + 60.0f) / 60.0f) * meter.getHeight(); + g.setColour (juce::Colour::fromRGB (105, 124, 131)); + g.drawLine (meter.getRight() + 1.0f, y, meter.getRight() + 4.0f, y, 1.0f); + } const juce::Rectangle footer (r.getX() + 3, r.getBottom() - 42, r.getWidth() - 6, 35); From bd4733e5d733652d2faf20f731ce99496b37ed6e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 27 Oct 2026 07:03:06 +0700 Subject: [PATCH 7/7] ci(native canvas): build and package Windows x64 JUCE preview executable --- .github/workflows/native-canvas-windows.yml | 72 +++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/native-canvas-windows.yml diff --git a/.github/workflows/native-canvas-windows.yml b/.github/workflows/native-canvas-windows.yml new file mode 100644 index 000000000..37175b2c2 --- /dev/null +++ b/.github/workflows/native-canvas-windows.yml @@ -0,0 +1,72 @@ +name: Native JUCE Canvas Preview (Windows x64) +on: + push: + branches: + - feature/native-juce-mixer-canvas-20261027 + paths: + - native/canvas-preview/** + - .github/workflows/native-canvas-windows.yml + workflow_dispatch: + pull_request: + paths: + - native/canvas-preview/** + - .github/workflows/native-canvas-windows.yml + +permissions: + contents: read + +jobs: + native-canvas-preview: + runs-on: windows-2022 + timeout-minutes: 35 + steps: + - name: Checkout ArSonMix prototype branch + uses: actions/checkout@v4 + - name: Checkout pinned JUCE 8.0.15 + uses: actions/checkout@v4 + with: + repository: juce-framework/JUCE + ref: 8.0.15 + path: third_party/JUCE + persist-credentials: false + - name: Configure independent JUCE native preview + shell: pwsh + run: | + cmake -S native/canvas-preview -B build/native-canvas -G "Visual Studio 17 2022" -A x64 -DJUCE_ROOT="${{ github.workspace }}/third_party/JUCE" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Build Windows x64 executable + shell: pwsh + run: | + cmake --build build/native-canvas --config Release --target ARMixNativeMixerCanvasPreview --parallel 2 + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Package inspected EXE and checksum + shell: pwsh + run: | + $exe = Get-ChildItem -Path build/native-canvas -Filter '*.exe' -Recurse -File | + Where-Object { $_.Name -like "*Native Canvas Preview*" -or $_.Name -like "*ARMixNativeMixerCanvasPreview*" } | + Select-Object -First 1 + if ($null -eq $exe) { + Get-ChildItem -Path build/native-canvas -Filter '*.exe' -Recurse | ForEach-Object { Write-Host $_.FullName } + throw "JUCE preview EXE was not found" + } + New-Item -ItemType Directory -Force -Path dist/native-canvas | Out-Null + Copy-Item $exe.FullName "dist/native-canvas/ArSonMix-Native-JUCE-Mixer-Canvas-Windows-x64.exe" + Get-FileHash "dist/native-canvas/ArSonMix-Native-JUCE-Mixer-Canvas-Windows-x64.exe" -Algorithm SHA256 | + Format-List | Out-String | Set-Content "dist/native-canvas/SHA256.txt" + Set-Content "dist/native-canvas/README.txt" @' + ArSonMix Native JUCE Mixer Canvas PREVIEW (Windows x64) + UI-only proof of concept; no audio engine, no VST hosting. + Fader, PAN, MUTE, SOLO are interactive; meters require real native input. + Does NOT replace the production ArSonMix GUI. + Original Soundcraft Ui24 canvas graphics/code are NOT included. + '@ + $len = (Get-Item "dist/native-canvas/ArSonMix-Native-JUCE-Mixer-Canvas-Windows-x64.exe").Length + Write-Host "Built executable size (bytes): $len" + if ($len -lt 102400) { throw "Executable unexpectedly small" } + - name: Upload Windows binary artifact + uses: actions/upload-artifact@v4 + with: + name: ArSonMix-Native-JUCE-Mixer-Canvas-Windows-x64 + path: dist/native-canvas/ + retention-days: 14 + if-no-files-found: error