Skip to content

[FEATURE] Preset Manager - #664

Open
jesusaviladev wants to merge 3 commits into
sdatkinson:mainfrom
jesusaviladev:feature/preset-manager
Open

[FEATURE] Preset Manager#664
jesusaviladev wants to merge 3 commits into
sdatkinson:mainfrom
jesusaviladev:feature/preset-manager

Conversation

@jesusaviladev

@jesusaviladev jesusaviladev commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Adds a local preset system that lets users save and recall the current model, IR,
and EQ/volume settings under a named preset.

Closes #252
Closes #428

Motivation

#252 asked for a way to group model, IR, and EQ/volume params under a named
preset that can be saved and recalled. #428 asked for a generic local
persistence layer (JSON file under the app's Application Support / AppData
path) as infrastructure for exactly this kind of feature, plus others
mentioned in that issue (default paths, one-time messages) that this PR
doesn't attempt to solve.

Design decisions

  • Local JSON storage, not VST3's native preset system. The plugin also
    ships as a standalone app, where VST3 native presets don't apply, so a
    self-contained format made more sense than coupling to the host's preset
    mechanism.
  • PresetManager is fully decoupled from NeuralAmpModeler. It's a new,
    self-contained class that only knows about a plain PresetData struct
    (name, model path, IR path, and a param name -> value map) — it doesn't
    include NeuralAmpModeler.h or know about the parameter enum. Integration
    in NeuralAmpModeler.cpp is limited to two private methods
    (CollectCurrentState() / ApplyPreset()) that translate between the
    plugin's live state and PresetData, using the existing
    GetParam()->Value() / SetParamValue() API.
  • Storage location: presets.json under AppSupportPath() (existing
    WDL/iPlug2 helper), so path resolution is already cross-platform without
    extra code.
  • Existing dependency reused: uses nlohmann::json, already vendored in
    the repo — no new dependency added.
  • Unserialization.cpp is untouched. That file handles state the host
    serializes into the DAW project, which is a separate concern from this
    local persistence layer.
  • The UI control follows the same message-passing pattern
    (SendArbitraryMsgFromUI / message tags) already used elsewhere in
    NeuralAmpModeler.cpp, rather than introducing a new pattern.

What's included

  • Save / load / delete named presets (model, IR, EQ params, volume params)
  • Duplicate name handling (replaces existing preset with the same name)
  • Atomic writes with in-memory rollback if a disk write fails
  • Cross-platform: updated both the macOS .xcodeproj and the Windows
    .vcxproj (app and vst3 targets) to include the new files

What's intentionally out of scope

  • AAX target wasn't updated — I don't have the Avid SDK to build/verify
    it, so I left NeuralAmpModeler-aax.vcxproj untouched rather than guess.
    Happy to add it if someone can verify the AAX build.
  • Other [FEATURE] Persisted information #428 use cases (default model/IR paths, one-time messages) — the
    storage format could be extended for these later, but this PR only
    implements what's needed for presets.
  • No unit tests yet for PresetManager — it's designed to be testable in
    isolation (the base path is injected via constructor), so this could be a
    quick follow-up if useful.

Testing

  • Compiles clean on macOS (Xcode) and Windows.
  • Manually verified end-to-end on both platforms: save a preset, close the
    plugin/app, reopen, load the preset, confirm model/IR/EQ/volume values are
    restored correctly.
  • Ran the VST3 SDK Validator against the compiled .vst3 on Windows:
    47/47 tests passed, no new/removed/renamed parameters detected.
  • Haven't been able to run the Validator on macOS yet — I don't have
    access to a Mac at the moment. The macOS build was compiled and manually
    tested as noted above, just not run through the formal validator. Happy to
    do that once I have access again, or if CI already covers it, that works
    too.
NAM

PR Checklist

  • Did you format your code using forrmat.bash?
  • Does the VST3 plugin pass all of the unit tests in the VST3PluginTestHost? (Download it as part of the VST3 SDK here.)
    • Windows
    • macOS
  • Does your PR add, remove, or rename any plugin parameters? If yes...
    • Have you ensured that the plug-in unserializes correctly?
    • Have you ensured that older versions of the plug-in load correctly? (See Unserialization.cpp.)
  • Does your PR add or remove any graphical assets? If yes, are they defined in config.h and added in the two required locations in main.rc?mat.bash`]

jesusaviladev and others added 3 commits July 28, 2026 14:00
…sdatkinson#428)

Introduces PresetManager, a plugin-agnostic class that persists named
presets (model path, IR path, EQ/volume params) as JSON under the
plugin's app-support directory, with atomic writes and
duplicate/corruption-safe error handling.

Wires it into NeuralAmpModeler via a new "Presets" button: save the
current state as a preset, load or delete an existing one from a popup
menu. Saving under a name that already exists asks for confirmation
before overwriting. Applying a preset that was saved without a model or
IR unloads the current one, so loading a preset always reproduces the
state it captured rather than leaving the previous file behind. A failed
disk write rolls back the in-memory change so the preset list never
diverges from what's actually persisted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUjbC9Vj8wD6UAkLW5QjG4
Adds PresetManager.cpp/.h to every macOS target and to the Windows app
and VST3 projects. The Windows AAX project is intentionally left out:
that build targets Pro Tools only and is not produced by CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUjbC9Vj8wD6UAkLW5QjG4
Fixes formatting violations per CONTRIBUTING.md: C-style cast spacing,
message box call wrapping, and preset param map layout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Persisted information [FEATURE] Presets/Patches system for NAM

1 participant