Repository navigation
feat(plugins): read the audible tap for Lua modes - #738
konstantindenerz wants to merge 2 commits into
Conversation
A Lua visualizer got its bands from the latest tap. That window moves only when the device takes samples. With the default 250 ms buffer it jumps 125 ms about every 128 ms (measured on macOS) and stands still in between, 125 to 250 ms ahead of the sound. Only the last 46 ms of each jump reach the FFT, so a plugin that reacts to the beat sees a kick early or not at all. The Lua driver now asks for the audible tap, as ClassicPeak and the raw-sample modes do. The bands follow the sound that plays and are new on every tick. The arguments of render are unchanged. Verified with make check (fmt, vet, tests).
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The first commit tested the analysis spec of the Lua driver. Which tap the model then reads was only tested for built-in modes. TestVisualizerSelectsAudibleTap now has a plugin mode: without the change it reads the latest tap and fails. The docs said the bands belong to the sound that plays now. That holds for the selected visualizer. A plugin in a layout pane gets the bands of the selected visualizer, as before, and the docs say so now. Verified with make check (fmt, vet, tests).
Summary
Lua visualizers got their bands from the latest tap. That window moves only
when the audio device takes samples: with the default 250 ms buffer it jumps
125 ms about every 128 ms (measured on macOS) and stands still in between,
125 to 250 ms ahead of the sound. Only the last 46 ms of each jump reach the
FFT, so a plugin that reacts to the beat sees a kick early or not at all.
The Lua driver now reads the audible tap, as ClassicPeak and the raw-sample
modes do. The bands follow the sound that plays and are new on every tick.
The arguments of
renderare unchanged.This came up while porting the Wormhole mode from #737 to a plugin, as
suggested there.
Screenshots / video
None. The change shows only in a plugin that reacts to the beat.
How to test
make buildcliamp plugins install konstantindenerz/cliamp-plugin-wormholeWormholewithCtrl+Vand compare with main:on main the tunnel misses kicks, with this change one ring leaves per kick.
Checklist
make checkpassesdocs/andsite/index.htmlupdated for user-facing changesSummary by CodeRabbit