### Clone and Install Dependencies Source: https://github.com/henley04/sxseditor/wiki/Developer-Guide Initial setup commands to clone the repository and install required Node.js packages. ```bash git clone https://github.com/Henley04/SXSEditor.git cd SXSEditor npm install ``` -------------------------------- ### Install Nexus SDK Source: https://github.com/henley04/sxseditor/blob/master/draft/q37-1.html Commands to install the Nexus SDK using npm, yarn, or pnpm. ```bash npm install @nexus/sdkyarn add @nexus/sdkpnpm add @nexus/sdk ``` -------------------------------- ### Install Dependencies Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/build.html Install project dependencies from the repository root. ```bash npm install ``` -------------------------------- ### Start Development Mode Source: https://github.com/henley04/sxseditor/wiki/Developer-Guide Command to launch the application with hot reloading enabled. ```bash npm start ``` -------------------------------- ### Package Application Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/build.html Commands for creating lite or full application packages, and generating installers. ```bash npm run package:lite ``` ```bash npm run package ``` ```bash npm run make ``` -------------------------------- ### Initialize Nexus Client in JavaScript Source: https://github.com/henley04/sxseditor/blob/master/draft/q37-1.html Setup the Nexus client using an API key and region configuration. ```javascript import { NexusClient } from '@nexus/sdk'; const nexus = new NexusClient({ apiKey: process.env.NEXUS_API_KEY, region: 'us-east-1', timeout: 5000, }); // Ready to use! const user = await nexus.users.get('user_123'); console.log(user); ``` -------------------------------- ### Run Packaging Commands Source: https://github.com/henley04/sxseditor/blob/master/docs/wiki/Developer-Guide.md Use these npm scripts to package the application for the current platform or generate distributable installers. ```bash npm run package # Package for current platform npm run package:lite # Package without ONNX models (for testing) npm run make # Create distributables (.exe, .zip, .deb) ``` -------------------------------- ### Package and Distribute SXSEditor Source: https://github.com/henley04/sxseditor/wiki/Developer-Guide Commands to build the application for the current platform and generate distributable installers. ```bash npm run package # Package for current platform npm run make # Create distributables (.exe, .zip, .deb) ``` -------------------------------- ### Define a theme in .theme.json Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/themes.html Example structure of a theme configuration file. Tokens must follow the --[a-z0-9][a-z0-9-]* format. ```json { "id": "dark-aurora", "name": "Aurora Dark", "version": "1.0.0", "author": "SXSEditor", "isDark": true, "description": "默认暗色主题,复刻 SXSEditor 经典蓝紫风格", "tags": ["builtin", "dark", "default"], "extends": null, "tokens": { "--color-blue-500": "#4a7de0", "--bg-app": "#14141f", "--bg-panel": "#1a1a2a", "--fg-primary": "#e0e0f0", "--accent": "#5b8def", "--button-primary-bg": "var(--bg-button-primary)", ... } } ``` -------------------------------- ### Query Documents in Python Source: https://github.com/henley04/sxseditor/blob/master/draft/q37-1.html Example of fetching and filtering documents from a collection using the Python client. ```python from nexus import NexusClient client = NexusClient(api_key="your_key") # Fetch documents with filtering results = client.documents.query( collection="articles", filter={"status": "published"}, limit=10, sort={"created_at": "desc"} ) for doc in results: print(doc.title) ``` -------------------------------- ### Execute Single Test File Source: https://github.com/henley04/sxseditor/blob/master/CLAUDE.md Runs a specific test file using Mocha with required setup and a defined timeout. ```bash npx mocha --require ./test/setup.js "test/trackManager.test.js" --timeout 30000 ``` -------------------------------- ### Custom Theme Definition Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/themes.html Example of a theme configuration object that extends an existing theme and overrides specific tokens. ```json // Example: a custom theme extending dark-aurora { "id": "my-theme", "name": "My Theme", "extends": "dark-aurora", "tokens": { "--accent": "#a855f7", // override accent to purple "--bg-app": "#1a0a2a" // override app background // all other tokens inherited from dark-aurora } } ``` -------------------------------- ### GET /v1/documents Source: https://github.com/henley04/sxseditor/blob/master/draft/q37-1.html List all documents in a collection. ```APIDOC ## GET /v1/documents ### Description List all documents in a collection. ### Method GET ### Endpoint /v1/documents ``` -------------------------------- ### GET /v1/users/:id Source: https://github.com/henley04/sxseditor/blob/master/draft/q37-1.html Retrieve a user by their unique ID. ```APIDOC ## GET /v1/users/:id ### Description Retrieve a user by ID. ### Method GET ### Endpoint /v1/users/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the user. ``` -------------------------------- ### Language Persistence and Detection Source: https://github.com/henley04/sxseditor/blob/master/docs/index.html Utility functions to get, set, and detect the user's preferred language using localStorage and navigator settings. ```javascript function getLang(){var l=null;try{l=localStorage.getItem('sxs-lang');}catch(e){}return l;} function setLang(l){try{localStorage.setItem('sxs-lang',l);}catch(e){}} function detectLang(){ /* 优先使用用户保存的偏好;否则按浏览器语言推断 */ var saved=getLang();if(saved)return saved; var navLangs=navigator.languages&&navigator.languages.length?navigator.languages:[(navigator.language||navigator.userLanguage||'zh-CN')]; for(var i=0;i { nfe } ### Description Executes a single step of the diffusion sampling process. The solver determines when to call `evalDiffStep` and how to combine predictions into the `xt` delta. ### Parameters - **evalDiffStep** (Function) - Required - A function `(t, xtOverride?)` that returns a Promise containing `condPred` and `uncondPred`. - **combine** (Function) - Required - A function `(condPred, uncondPred)` that writes to `buffers.vBuf` and returns it. - **step** (Number) - Required - The current step index. - **totalSteps** (Number) - Required - The total number of steps in the diffusion process. - **xtData** (Object) - Required - The current state data. - **buffers** (Object) - Required - Caller-allocated buffers: `{ vBuf, deltaBuf, v1Buf, xPredBuf }`. ### Returns - **nfe** (Number) - The number of function evaluations performed in this step. ``` -------------------------------- ### Initialize Japanese Phoneme Embeddings Source: https://github.com/henley04/sxseditor/blob/master/tools.md Extends the model's embedding table with Japanese phonemes using L2 normalization and standard deviation calibration. ```powershell cd D:\Document\electron\SXSEditor\SoulX-Singer ; python train/lora_jp/init_embeddings.py --model_path "pretrained_models/SoulX-Singer/model.pt" --mapping "train/lora_jp/jp_phoneme_mapping.json" --phoneset "train/lora_jp/jp_phone_set.json" --output "outputs/lora_jp/init_embed.pt" --target_std 0.9 ``` -------------------------------- ### Compare FP32 and W8A8 accuracy Source: https://github.com/henley04/sxseditor/blob/master/tools.md Compares production FP32 models against optimized W8A8 models. ```powershell python compare_w8a8_fp32.py ``` -------------------------------- ### Register Built-in Theme Source: https://github.com/henley04/sxseditor/blob/master/docs/wiki/Developer-Guide.md Import the theme JSON file and add it to the BUILTIN_THEMES array in the index file. ```js import myTheme from './my-theme.theme.json'; export const BUILTIN_THEMES = [darkAurora, lightPaper, midnightAmber, acg, myTheme]; ``` -------------------------------- ### Quantize models with W8A8 INT8 v2 Source: https://github.com/henley04/sxseditor/blob/master/tools.md Executes the full quantization pipeline for ORT CPU and NPU-optimized outputs. ```powershell # Quantize all models with default model path python quantize_w8a8_v2.py # Quantize with custom model path python quantize_w8a8_v2.py --model-path "D:\Document\electron\SXSEditor\SoulX-Singer\pretrained_models\SoulX-Singer\model.pt" # Quantize specific models only python quantize_w8a8_v2.py --models diff_step,vocoder,preflow ``` -------------------------------- ### Exposed window.electronAPI members Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/architecture.html List of methods and event listeners exposed via the context bridge for IPC communication. ```javascript // Request-response (Promise-based) electronAPI.initSVSPipeline() // svs:init electronAPI.synthesizeSVS(data) // svs:synthesize electronAPI.getSettings() // settings:getSettings electronAPI.saveSettings(settings) // settings:saveSettings electronAPI.audioPlay(audioData, options) // audio:play // Fire-and-forget listeners (return unsubscribe fn) electronAPI.onSVSProgress(p => console.log(p)) // svs:progress electronAPI.onAudioEnded(() => replay()) // audio:ended electronAPI.onModelDownloadProgress(p => updateUI(p)) // WebNN — channel names whitelisted in preload to prevent arbitrary IPC electronAPI.webnnRespond(responseChannel, result) electronAPI.webnnProgress(progressChannel, data) // Theme sub-API electronAPI.themeAPI.apply(themeId, { scope }) // theme:apply electronAPI.themeAPI.list() // theme:list ``` -------------------------------- ### Process Model Diagram Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/architecture.html Visual representation of the interaction between the Main Process, Preload bridge, and Renderer processes. ```text ┌─────────────────────────────── Main Process (src/main.js) ───────────────────────────────┐ │ windowManager modelDownload svsIpc pitchMidiIpc │ │ singerIpc audioIpc dialogIpc resourceManagerIpc │ │ settingsIpc themeIpc webnnIpc splashManager │ │ security.js settings.js gpuInfo.js modelDir.js locale.js │ │ │ │ OnnxSVSPipeline ──► onnxruntime-node (DirectML / CPU) │ │ WebNN requests ──► forwarded to main window renderer via ipcMain ↔ ipcRenderer │ └──────────────────────────────────────────────────────────────────────────────────────────┘ ▲ IPC (ipcMain.handle / ipcRenderer.invoke) ▼ │ │ ┌── Preload (src/preload.js) ──── contextBridge.exposeInMainWorld('electronAPI', {...}) ───┐ │ All renderer code can ONLY touch window.electronAPI — no Node.js, no require. │ └───────────────────────────────────────────────────────────────────────────────────────────┘ ▲ ▼ ┌──────────────── Renderer Processes (one per window) ──────────────────────────────────────┐ │ main_window (src/renderer/) Multi-track timeline, project management │ │ fragment_editor (src/fragmentEditor/) Piano-roll editor, SVS preview │ │ singer_creator (src/singerCreator.js) Singer creation wizard │ │ audio_preprocess (src/audioPreprocess/) F0 / MIDI extraction UI │ │ settings (src/settings.js) Device, inference, audio config │ │ model_download (src/modelDownload.js) Chunked parallel download from ModelScope │ │ resource_manager (src/resourceManager.js) GPU/VRAM monitor, model load/unload │ │ splash (src/splash.js) Startup splash (packaged builds only) │ └───────────────────────────────────────────────────────────────────────────────────────────┘ ``` -------------------------------- ### Git Workflow Commands Source: https://github.com/henley04/sxseditor/wiki/Developer-Guide Standard commands for creating feature branches and running project tests. ```bash git checkout -b feature/amazing-feature ``` ```bash npm test ``` -------------------------------- ### Theme System Architecture Overview Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/themes.html Visual representation of the theme system components, including token catalog, manager, and DOM integration. ```text ┌─ tokenCatalog.js ─────────────────────────────────────────┐ │ TOKEN_CATALOG: { '--token-name': { layer, group, type, │ │ default, label } } │ │ buildDefaultTokens(): flat { name: value } from catalog │ │ Layers: 'global' | 'alias' | 'component' │ │ Types: 'color' | 'size' | 'motion' | 'shadow' | 'string' │ └────────────────────────────────────────────────────────────┘ │ defaults ▼ ┌─ themeManager.js (renderer) ───────────────────────────────┐ │ registry: Map(id -> { theme, source }) │ │ activate(id): flattenTheme(extends chain) → injectTokens │ │ mergeOverrides(patch): transient patch (not persisted) │ │ pushHistory / undo / redo: 20-step undo stack │ │ export(id) → JSON string; import(json) → theme object │ │ Events: 'theme-changed', 'theme-list-changed', │ │ 'theme-overwritten', 'theme-imported' │ └────────────────────────────────────────────────────────────┘ │ setProperty('--token', value) on documentElement ▼ ┌─ DOM :root ────────────────────────────────────────────────┐ │ All CSS in src/renderer.css consumes var(--token) │ │ Canvas 2D reads via canvasTheme.getCanvasColors() │ └────────────────────────────────────────────────────────────┘ ``` -------------------------------- ### Token Persistence Helpers Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/singer-market.html Utility functions for managing the session token file in the main process. ```javascript // singerMarketIpc.js — token persistence helpers function loadSession() { /* read userData/singer-market-token.json */ } function saveSession(s) { /* write with mode 0o600 */ } function clearSession() { /* unlink the file */ } function getToken() { return loadSession()?.token ?? null; } function withAuth(h) { /* injects Authorization: Bearer */ } ``` -------------------------------- ### Export diff_step FP32 ONNX Source: https://github.com/henley04/sxseditor/blob/master/tools.md Step 1 of the isolated export pipeline. ```powershell python export_step1_diffstep.py --model-path "D:\Document\electron\SXSEditor\SoulX-Singer\pretrained_models\SoulX-Singer\model.pt" --output-dir "D:\Document\electron\SXSEditor\onnx_models\int8\from_pytorch" ``` -------------------------------- ### themeManager API Methods Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/themes.html Methods available on the themeManager singleton for managing theme registry, activation, and history. ```APIDOC ## themeManager Methods ### register(themeObj) Adds a theme to the registry. ### registerBuiltins(arr) Registers an array of built-in themes. ### unregister(id) Removes a theme from the registry. Built-in themes cannot be removed. ### list() Returns an array of theme objects: `[{id, name, isDark, author, version, source}]`. ### activate(id, { scope }) Resolves the extends chain, injects tokens, and fires the theme-changed event. ### current() / currentTokens() Returns the active theme ID or the map of resolved tokens. ### export(id) / import(json) Serializes a theme to a JSON string or parses and registers a theme from JSON. ### mergeOverrides(patch) / clearOverrides() Applies or clears transient theme patches that are not persisted to localStorage. ### pushHistory() / undo() / redo() Manages a 20-step undo stack for editor theme history. ### on(eventName, handler) Subscribes to theme events. Returns an unsubscribe function. ### Events - 'theme-changed' - 'theme-list-changed' - 'theme-overwritten' - 'theme-imported' ``` -------------------------------- ### OnnxSVSPipeline API Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/inference-pipeline.html The OnnxSVSPipeline class manages the lifecycle of synthesis models, including initialization, hot-swapping of components, and audio synthesis execution. ```APIDOC ## Constructor: new OnnxSVSPipeline(modelDir, options) ### Description Initializes a new instance of the synthesis pipeline. ### Parameters - **modelDir** (string) - Required - Path to the model directory. - **options** (object) - Required - Configuration object: - **modelPrecision** (string) - Optional - 'fp32' | 'fp16' | 'int8' | 'int8-npu' - **deviceId** (number) - Optional - DML adapter index - **preferredDeviceType** (string) - Optional - 'npu' | 'webnn-gpu' - **inferenceProvider** (string) - Optional - 'ortnode' | 'ortweb' - **languageOverride** (string) - Optional - 'ja' | null ## Method: init() ### Description Loads all 9 sessions required for the pipeline. ## Method: swapLanguageModels(language) ### Description Hot-swaps the language models. ## Method: swapVocoder(vocoderType) ### Description Hot-swaps the vocoder component. ## Method: swapSifiganPrecision(precision) ### Description Updates the SiFiGAN precision setting. ## Method: synthesize(notes, bpm, options) ### Description Executes the synthesis process. ### Parameters - **notes** (any) - Required - Input notes. - **bpm** (number) - Required - Beats per minute. - **options** (object) - Optional - Synthesis options: - **nSteps** (number) - Optional - Default 32 - **cfg** (number) - Optional - Default 3.0 - **cfgRescale** (number) - Optional - Default 0.75 - **sampler** (string) - Optional - 'euler' | 'heun' | 'extrap' | 'stork2' - **autoShift** (any) - Optional - **pitchShift** (any) - Optional - **f0Envelope** (any) - Optional - **pitchCurveF0** (any) - Optional - **refAudioWavBuffer** (any) - Optional - Reference audio for prompt mel - **onProgress** (function) - Optional - Callback for 0-100 progress - **onChunkAudio** (function) - Optional - Callback for streaming vocoder chunks ## Method: dispose() ### Description Releases all loaded sessions. ``` -------------------------------- ### Repository Directory Structure Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/build.html High-level layout of the SXSEditor repository showing source, assets, and build configuration files. ```text SXSEditor/ ├── assets/ # App icons and images ├── docs/ # Documentation & official website (GitHub Pages) │ ├── css/ js/ images/ │ ├── user/ # User-facing docs │ ├── dev/ # Developer docs (this page) │ └── wiki/ # Wiki source markdown ├── onnx_models/ # ONNX model files (git-ignored, auto-downloaded) │ ├── fp16/ fp32/ int8/ # Precision subdirectories │ ├── ja/ # Japanese model variants │ └── preprocess/ # RMVPE & ROSVOT pitch detection models ├── scripts/ # Build helpers (generate-build-info.js) ├── src/ │ ├── main.js # Electron main process entry point │ ├── preload.js # contextBridge IPC API │ ├── main/ # Main process modules (windowManager, security, │ │ # settingsIpc, svsIpc, audioIpc, themeIpc, ...) │ ├── renderer/ # Main window renderer (timeline, project IO) │ ├── fragmentEditor/ # Fragment editor renderer (piano roll) │ ├── editor/ # Shared editor modules (trackManager, pianoRoll, │ │ # envelopeEditor, historyManager) │ ├── inference/ # Neural inference pipelines │ │ ├── pipeline/ # Main SVS pipeline (OnnxSVSPipeline) │ │ ├── webnn/ # WebNN NPU pipeline │ │ ├── rmvpePitchDetector.js │ │ ├── basicPitch.js │ │ └── phone_set.json # Phoneme vocabulary (2820 entries) │ ├── audio/ # AudioOutputManager (WASAPI), wavEncoder │ ├── themes/ # Theme system (builtins, manager, tokens) │ ├── i18n/ # Internationalization (en, zh-CN) │ └── utils/ # Shared utilities ├── test/ # Test suite (~33 files, 900+ cases) ├── forge.config.js # Electron Forge config (packaging, makers) ├── webpack.*.config.js # Webpack configs (main + renderer) └── package.json ``` -------------------------------- ### Manage UI State and Interactions Source: https://github.com/henley04/sxseditor/blob/master/draft/q37-1.html Handles language localization, theme toggling, code tab switching, clipboard copying, and sidebar navigation tracking. ```javascript All rights reserved.", "footer.privacy": "プライバシー", "footer.terms": "利用規約", "footer.cookies": "Cookie" } }; /* ------------------ Language Switching ------------------ */ let currentLang = localStorage.getItem('nexus-lang') || 'en'; function applyLanguage(lang) { currentLang = lang; localStorage.setItem('nexus-lang', lang); document.documentElement.lang = lang; document.querySelectorAll('[data-i18n]').forEach(el => { const key = el.getAttribute('data-i18n'); if (translations[lang] && translations[lang][key]) { el.textContent = translations[lang][key]; } }); document.querySelectorAll('[data-i18n-ph]').forEach(el => { const key = el.getAttribute('data-i18n-ph'); if (translations[lang] && translations[lang][key]) { el.setAttribute('placeholder', translations[lang][key]); } }); document.querySelectorAll('[data-lang-btn]').forEach(btn => { btn.classList.toggle('active', btn.getAttribute('data-lang-btn') === lang); }); } document.querySelectorAll('[data-lang-btn]').forEach(btn => { btn.addEventListener('click', () => applyLanguage(btn.getAttribute('data-lang-btn'))); }); /* ------------------ Theme Toggle ------------------ */ const themeToggle = document.getElementById('themeToggle'); const sunIcon = document.getElementById('sunIcon'); const moonIcon = document.getElementById('moonIcon'); function applyTheme(theme) { document.documentElement.setAttribute('data-theme', theme); localStorage.setItem('nexus-theme', theme); if (theme === 'dark') { sunIcon.style.display = 'block'; moonIcon.style.display = 'none'; } else { sunIcon.style.display = 'none'; moonIcon.style.display = 'block'; } } themeToggle.addEventListener('click', () => { const current = document.documentElement.getAttribute('data-theme'); applyTheme(current === 'dark' ? 'light' : 'dark'); }); /* ------------------ Code Tab Switching ------------------ */ document.querySelectorAll('[data-code-tab]').forEach(tab => { tab.addEventListener('click', () => { document.querySelectorAll('[data-code-tab]').forEach(t => t.classList.remove('active')); tab.classList.add('active'); const lang = tab.getAttribute('data-code-tab'); ['install-npm', 'install-yarn', 'install-pnpm'].forEach(id => { document.getElementById(id).classList.add('hidden'); }); document.getElementById('install-' + lang).classList.remove('hidden'); }); }); /* ------------------ Copy Buttons ------------------ */ document.querySelectorAll('.copy-btn').forEach(btn => { btn.addEventListener('click', () => { const target = btn.getAttribute('data-copy'); let text = ''; if (target === 'install') { const active = document.querySelector('[data-code-tab].active').getAttribute('data-code-tab'); text = document.getElementById('install-' + active).textContent; } else if (target === 'init') { text = document.getElementById('init-code').textContent; } else if (target === 'query') { text = document.getElementById('query-code').textContent; } navigator.clipboard.writeText(text).then(() => { const original = btn.textContent; btn.textContent = '✓ Copied'; btn.classList.add('copied'); setTimeout(() => { btn.textContent = original; btn.classList.remove('copied'); }, 1500); }); }); }); /* ------------------ Sidebar Active Link Tracking ------------------ */ const navLinks = document.querySelectorAll('.desktop-sidebar .nav-link[href^="#"]'); const tocLinks = document.querySelectorAll('.toc-link[href^="#"]'); function updateActiveLink() { let current = ''; document.querySelectorAll('section[id], div[id]').forEach(section => { const rect = section.getBoundingClientRect(); if (rect.top <= 150) current = section.id; }); navLinks.forEach(link => { link.classList.toggle('active', link.getAttribute('href') === '#' + current); }); tocLinks.forEach(link => { link.classList.toggle('active', link.getAttribute('href') === '#' + current); }); } window.addEventListener('scroll', updateActiveLink); /* ------------------ Mobile Menu ------------------ */ const mobileMenuBtn = document.getElementById('mobileMenuBtn'); const mobileMenu = document.getElementById('mobileMenu'); const mobileMenuClose = document.getElementById('mobileMenuClose'); const mobileNav = document.getElementById('mobileNav'); // Clone sidebar nav into mobile menu document.querySelectorAll('.desktop-sidebar .section-group').forEach(group => { const clone = group.cloneNode(true); mobileNav.appendChild(clone); }); mobileMenuBtn.addEventListener('click', () => mobileMenu.classList.add('open')); mobileMenuClose.addEventListener('click', () => mobileMenu.classList.remove('open')); /* ------------------ Initialize ------------------ */ const savedTheme = localStorage.getItem('nexus-theme') || 'light'; applyTheme(savedTheme); applyLanguage(currentLang); // Re-highlight code if (window.Prism) Prism.highlightAll(); ``` -------------------------------- ### Run Singer Market Tests Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/singer-market.html Execute the IPC proxy unit tests in isolation using the Mocha test runner. ```bash npx mocha --require ./test/setup.js "test/singerMarketIpc.test.js" --timeout 30000 ``` -------------------------------- ### Convert Models to NPU FP16 Source: https://github.com/henley04/sxseditor/blob/master/tools.md Runs the optimize_npu.py script to convert FP32 ONNX models to FP16 for NPU inference. ```powershell python optimize_npu.py ``` -------------------------------- ### Optimize ONNX Models with Olive Source: https://github.com/henley04/sxseditor/blob/master/tools.md Runs the optimize_onnx.py script to generate both INT8 and FP16 versions using Olive and onnxruntime. ```powershell python optimize_onnx.py ``` -------------------------------- ### Verify W8A8 accuracy Source: https://github.com/henley04/sxseditor/blob/master/tools.md Compares INT8 and FP32 ONNX model accuracy metrics. ```powershell python verify_w8a8_accuracy.py ``` -------------------------------- ### Optimize Models for NPU INT8 Deployment Source: https://github.com/henley04/sxseditor/blob/master/tools.md Runs the optimize_npu_int8.py script to replace unsupported operators and validate NPU compatibility. ```powershell python optimize_npu_int8.py ``` -------------------------------- ### Optimize Vocoder for DirectML Source: https://github.com/henley04/sxseditor/blob/master/tools.md Runs the optimize_vocoder_dml.py script to decompose incompatible operations for DirectML. ```powershell python optimize_vocoder_dml.py ``` -------------------------------- ### synth Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/testing-cli.html Runs a minimal synthesis process and outputs audio statistics. Supports custom output paths, diffusion steps, BPM, and note sequences. ```APIDOC ## synth ### Description Runs a minimal synthesis and prints audio stats (sample count, sample rate, duration, peak, and mean). By default, no file is written. ### Options - `--out ` (string) - Optional - Path to write the output WAV file. - `--steps ` (number) - Optional - Number of diffusion steps. - `--notes ` (string) - Optional - JSON string of notes to synthesize. - `--bpm ` (number) - Optional - Beats per minute for the synthesis. ``` -------------------------------- ### Generate Phoneme Mapping Source: https://github.com/henley04/sxseditor/blob/master/tools.md Creates a Japanese-to-source phoneme mapping JSON file required for embedding initialization. ```powershell cd D:\Document\electron\SXSEditor\SoulX-Singer ; python train/lora_jp/phoneme_mapping.py ``` -------------------------------- ### Generate Phoneme Duration Statistics Source: https://github.com/henley04/sxseditor/blob/master/docs/wiki/Developer-Guide.md Execute the generation script to create the phoneme duration JSON file, optionally filtering by minimum sample count. ```bash python build_en_phoneme_duration_stats.py python build_en_phoneme_duration_stats.py --min-samples 10 # filter low-frequency keys ``` -------------------------------- ### Run full INT8 export pipeline Source: https://github.com/henley04/sxseditor/blob/master/tools.md Executes the full export pipeline using isolated processes. ```powershell # Full pipeline with default paths python export_int8_pipeline.py # With custom model path and output directory python export_int8_pipeline.py --model-path "D:\Document\electron\SXSEditor\SoulX-Singer\pretrained_models\SoulX-Singer\model.pt" --output-dir "D:\Document\electron\SXSEditor\onnx_models\int8\from_pytorch" ``` -------------------------------- ### Export Model to ONNX for SXSEditor Source: https://github.com/henley04/sxseditor/blob/master/tools.md Exports fine-tuned preflow and JP embedding as ONNX files. Requires specifying the checkpoint, base model, and output directory. ```powershell cd D:\Document\electron\SXSEditor\SoulX-Singer ; python train/lora_jp/export_onnx.py --checkpoint "outputs/lora_jp/stage3/best.pt" --base_model "pretrained_models/SoulX-Singer/model.pt" --output_dir "onnx_models/fp16/JP" ``` -------------------------------- ### Define Theme Pack JSON Source: https://github.com/henley04/sxseditor/blob/master/docs/wiki/Developer-Guide.md The theme configuration file uses a JSON format to define metadata, inheritance, and CSS design tokens. ```json { "id": "my-cool-theme", "name": "My Cool Theme", "version": "1.0.0", "author": "Your Name", "isDark": true, "description": "A cool dark theme", "tags": ["dark", "blue"], "extends": "dark-aurora", "tokens": { "--color-blue-500": "#5b8def", "--bg-app": "#14141f", "--button-primary-bg": "var(--color-blue-500)" } } ``` -------------------------------- ### Singer Market Architecture Diagram Source: https://github.com/henley04/sxseditor/blob/master/docs/dev/singer-market.html Visual representation of the data flow between the Electron application, Cloudflare Workers, and storage services. ```text ┌────────────────────────────────────────────────────────────────┐ │ SXSEditor (Electron) │ │ │ │ singerMarket window (renderer) ◄──► singerMarketIpc (main) │ │ src/singerMarket.js + .html src/main/singerMarketIpc.js│ │ - toolbar / grid / dialogs - token persistence │ │ - window.electronAPI.singerMarket.* - multipart builder │ │ - never touches the network - Bearer header injection │ │ - native file pickers │ └────────────────────────────────┬───────────────────────────────┘ │ HTTPS (Node https module) ▼ ┌────────────────────────────────────────────────────────────────┐ │ Cloudflare Worker (singer-files) │ │ https://singer-files..workers.dev │ │ - router.js - lib/auth.js (sessions + API keys + rate) │ │ - lib/b2.js - lib/storage.js (B2 adapter) │ │ - lib/db.js - lib/quota.js (circuit breaker) │ │ - handlers/* - ui_user.js / ui_admin.js (inline SPAs) │ └──────────────┬─────────────────────┬───────────────────┬────────┘ │ │ │ ▼ ▼ ▼ ┌────────────┐ ┌──────────┐ ┌──────────┐ │ Backblaze │ │ D1 DB │ │ KV │ │ B2 bucket │ │singer_ │ │ rate- │ │singer-files│ │ files │ │ limit + │ │ (blobs) │ │ (8 tables)│ │ B2 cache │ └────────────┘ └──────────┘ └──────────┘ ```