Feature/midi automation#113
Merged
Merged
Conversation
…s to record automation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds MIDI-loop–based parameter automation for hosted VST plugins, including recording automation from MIDI CC and VST editor touches, playing it back on the audio thread, and rendering automation lanes in the loop UI. It also includes build/project plumbing updates, some input handling changes (global Insert key), and a few small UX cleanups.
Changes:
- Add automation lanes to
midi::MidiLoopand an audio-thread automation dispatch path inengine::Station. - Add automation record/learn/wire key handling plus editor-touch suppression logic in
midi::MidiRouter, with related tests. - Add automation lane visualization (new shaders + render path) and update project files/resources accordingly.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/JammaLib_Tests/src/vst/Vst2Plugin_Tests.cpp | Adds coverage for VST2 audioMasterAutomate touch publication behavior. |
| test/JammaLib_Tests/src/midi/VstEditorAutomationSuppression_Tests.cpp | Adds tests for editor-touch playback suppression table behavior. |
| test/JammaLib_Tests/src/midi/MidiRouterAutomationKey_Tests.cpp | Adds tests for Insert-based automation record key state handling. |
| test/JammaLib_Tests/src/midi/MidiAutomationLaneResolution_Tests.cpp | Adds tests for lane resolution/wiring/overwrite/phase anchor semantics. |
| test/JammaLib_Tests/src/engine/StationMidiInstrument_Tests.cpp | Adds end-to-end automation playback + suppression tests through Station. |
| test/JammaLib_Tests/JammaLib_Tests.vcxproj.filters | Registers new test sources in VS filters. |
| test/JammaLib_Tests/JammaLib_Tests.vcxproj | Registers new tests and updates vcpkg library dirs. |
| scripts/run-vst-editor-debug.ps1 | Removed (debug helper script cleanup). |
| scripts/bootstrap.cmd | Removed (unused/incorrect bootstrap stub). |
| JammaLib/src/vst/VstEditorWindowManager.cpp | Reuses/focuses existing editor window when reopening the same plugin. |
| JammaLib/src/vst/VstChain.h | Adds ContainsPlugin helper for ownership checks. |
| JammaLib/src/vst/Vst3Plugin.h | Adds IVstPlugin parameter API stubs (not yet wired for VST3 automation). |
| JammaLib/src/vst/Vst3Plugin.cpp | Implements VST3 parameter API stubs. |
| JammaLib/src/vst/Vst2Plugin.h | Adds parameter API + test host callback entry point. |
| JammaLib/src/vst/Vst2Plugin.cpp | Implements VST2 parameter API + publishes last-touched param on audioMasterAutomate. |
| JammaLib/src/vst/Vst.cpp | Defines the global last-touched parameter registry. |
| JammaLib/src/vst/IVstPlugin.h | Extends plugin interface with Set/GetParameter + last-touched registry declaration. |
| JammaLib/src/midi/MidiRouter.h | Adds automation key handling + suppression table APIs/state. |
| JammaLib/src/midi/MidiRouter.cpp | Implements automation learn/wire/delete, CC recording, editor-touch capture, suppression logic. |
| JammaLib/src/midi/MidiLoop.h | Adds automation lane data structures + phase anchor + automation APIs. |
| JammaLib/src/midi/MidiLoop.cpp | Implements automation lane point storage/interp, overwrite windows, seqlock snapshotting. |
| JammaLib/src/io/IoInputSubsystem.h | Adds global Insert key capture hook plumbing. |
| JammaLib/src/io/IoInputSubsystem.cpp | Implements low-level keyboard hook + Insert polling dispatch. |
| JammaLib/src/graphics/VstEditorWindow.h | Exposes plugin + editor HWND accessors for window manager. |
| JammaLib/src/graphics/MidiModel.h | Adds automation rendering state + loop back-pointer plumbing. |
| JammaLib/src/graphics/MidiModel.cpp | Implements automation “curtain” rendering using new shaders. |
| JammaLib/src/engine/Station.h | Adds automation dispatch structures + public rebuild/resolve/test hook APIs. |
| JammaLib/src/engine/Station.cpp | Runs automation dispatch on audio thread + builds/publishes dispatch list. |
| JammaLib/src/engine/Scene.h | Adds global Insert capture methods; minor header formatting change. |
| JammaLib/src/engine/Scene.cpp | Routes automation key handling through input subsystem; shuts down global capture. |
| JammaLib/src/engine/LoopTake.h | Adds OwnsPlugin helper for editor automation ownership resolution. |
| JammaLib/src/engine/LoopTake.cpp | Anchors MIDI loop phase on EndRecord + propagates MIDI loop sample rate. |
| JammaLib/JammaLib.vcxproj | Updates vcpkg include directories. |
| Jamma/src/Main.cpp | Validates saved window placement visibility; pumps global Insert capture each frame. |
| Jamma/resources/shaders/automation.vert | Adds automation lane vertex shader. |
| Jamma/resources/shaders/automation.frag | Adds automation lane fragment shader. |
| Jamma/resources/ResourceList.txt | Registers the new automation shader resource. |
| Jamma/Jamma.vcxproj.filters | Registers new shader content in VS filters. |
| Jamma/Jamma.vcxproj | Adds vcpkg lib dir + post-build DLL copies; deploys new shaders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+450
to
+452
| const bool active = _automationSource->IsAutomationLaneActive(lane); | ||
| const auto count = _automationSource->SnapshotAutomationLanePoints(lane, pts.data(), pts.size()); | ||
| if (!active && 0u == count) |
Comment on lines
+510
to
+514
| const auto& lane = _lanes[laneIdx]; | ||
| const auto count = lane.PointCount; | ||
| if (0u == count) | ||
| return 0.0f; | ||
|
|
Comment on lines
+502
to
+506
| _automationDispatchCount[back] = count; | ||
| // Release pairs with the audio thread's acquire load: makes all MIDI-thread | ||
| // writes to lane Points visible before the new list is consumed. | ||
| _automationDispatch.store(buf, std::memory_order_release); | ||
| _automationDispatchBack ^= 1u; |
Comment on lines
+128
to
+137
| static VstIntPtr HostCallbackForTest(AEffect* effect, | ||
| VstInt32 opcode, | ||
| VstInt32 index, | ||
| VstIntPtr value, | ||
| void* ptr, | ||
| float opt) | ||
| { | ||
| return HostCallback(effect, opcode, index, value, ptr, opt); | ||
| } | ||
|
|
| std::shared_ptr<IVstPlugin> MakePluginForPath(const std::wstring& path); | ||
|
|
||
| // Queue a plugin for destruction on the UI thread. | ||
| std::shared_ptr<IVstPlugin> MakePluginForPath(const std::wstring& path); // Queue a plugin for destruction on the UI thread. |
| actions::ActionResult _HandleUndo(); | ||
| void _SetQuantisation(unsigned int quantiseSamps, utils::Timer::QuantisationType quantisation); | ||
| void _SetMidiQuantisationGrain(unsigned int grainSamps, const char* source) | ||
| void _SetQuantisation(unsigned int quantiseSamps, utils::Timer::QuantisationType quantisation); void _SetMidiQuantisationGrain(unsigned int grainSamps, const char* source) |
…ints ahead of write position
…mutability after publication
Owner
Author
|
@copilot I've addressed the comments, do a final review of safety/performance/correctness before I merge |
Copilot stopped work on behalf of
malisimat due to an error
June 21, 2026 11:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new VST automation feature, allowing recording and playback of MIDI automation as part of MIDI loops.
Also introduces some general clean-up changes, including:
Jamma.vcxprojto include the main vcpkglibdirectories and added post-build steps to copy necessary DLLs (ogg.dll,vorbis.dll,vorbisenc.dll) to the output directory.automation.frag,automation.vert) for visualizing automation lanes.Main.cppto check if the saved window position is within the visible work area.