Skip to content

feat(plugins): read the audible tap for Lua modes - #738

Open
konstantindenerz wants to merge 2 commits into
bjarneo:mainfrom
konstantindenerz:feat/plugin-audible-tap
Open

konstantindenerz wants to merge 2 commits into
bjarneo:mainfrom
konstantindenerz:feat/plugin-audible-tap

Conversation

@konstantindenerz

@konstantindenerz konstantindenerz commented Nov 19, 2026 •

Copy link
Copy Markdown

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 render are 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

  1. make build
  2. cliamp plugins install konstantindenerz/cliamp-plugin-wormhole
  3. Play a track with a steady kick, pick Wormhole with Ctrl+V and compare with main:
    on main the tunnel misses kicks, with this change one ring leaves per kick.

Checklist

  • make check passes
  • docs/ and site/index.html updated for user-facing changes

Summary by CodeRabbit

  • Bug Fixes
    • Lua visualizers now analyze the audible audio, so their spectrum reflects the sound currently playing.
  • Documentation
    • Clarified that visualizer spectrum bands represent the current sound and are eased between analyses.
    • Clarified that visualizers receive different spectrum bands depending on context: in a layout pane, the bands come from the selected visualizer.

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).
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Lua visualizer analysis now uses the audible tap with the default spectrum-band count. Tests check analysis and tap selection. Documentation describes the sources of visualizer bands.

Changes: Lua Visualizer Analysis

Layer / File(s) Summary
Analysis specification and validation
ui/vis_lua.go, ui/vis_lua_test.go, ui/visualizer_driver_test.go, ui/model/tick_test.go, docs/plugins.md, site/index.html
luaModeDriver.AnalysisSpec returns the default spectrum-band count and VisTapAudible. Tests check audible-tap analysis and tap selection for Lua visualizers. Documentation describes the bands supplied to selected visualizers and layout panes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • bjarneo/cliamp#652: Adds Lua pane APIs whose pane visualizers share primary FFT analysis and receive raw samples. This PR documents the related layout-pane band source.

Suggested reviewers: bjarneo, gjermundgaraba

Merge Risk: Minimal · up to 6cf3e

Lua visualizer plugins now follow the sound currently playing, matching the built-in modes. The change is small, tested, and documented, and I found no merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(plugins): read the audible tap for Lua modes" matches the main change. The raw summary shows the Lua visualizer driver now reads the audible tap (luaModeDriver.AnalysisSpec sets VisTap…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat(plugins): read the audible tap for Lua modes" matches the main change. The raw summary shows the Lua visualizer driver now reads the audible tap (luaModeDriver.AnalysisSpec sets VisTapAudible for Lua modes), with matching tests and docs. The title is specific and short, and it names the plugin scope and the tap change. It does not cover the docs or the layout-pane clarification, which is expected for a title.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9ed4e962-0d66-4090-9eb3-72203f817adc
Commits

Reviewing files that changed from the base of the PR and between 441a449 and 6cf3e26.

Files selected for processing: 2

  • docs/plugins.md
  • ui/model/tick_test.go

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

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).

This branch has not been deployed

No deployments
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.

1 participant