Skip to content

Fix spectrum balance v0.1.1 - #3

Closed
Muimi272 wants to merge 4 commits into
masterfrom
fix-spectrum-balance-v0.1.1
Closed

Muimi272 wants to merge 4 commits into
masterfrom
fix-spectrum-balance-v0.1.1

Conversation

@Muimi272

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 25, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new bin-to-frequency projection in WaveformView hard-codes a 20kHz mapping even though playback output sample rate varies, causing incorrect band boundaries and inconsistent spectrum balance across devices/formats.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the audio spectrum visualization pipeline for v0.1.1 by moving more of the spectrum projection logic into the UI layer and bumping release versions accordingly.

Changes:

  • Reworked JavaSoundPlaybackEngine spectrum analysis to return per-FFT-bin calibrated linear amplitudes (instead of pre-bucketed bands).
  • Updated WaveformView to aggregate FFT bins into log-frequency bands and render magnitude/peaks using a dB-based normalization.
  • Bumped application version to 0.1.1 and updated release packaging workflow artifacts to match.
File summaries
File Description
src/main/java/club/muimi/kimusic/view/component/WaveformView.java Aggregates raw FFT bins into log-frequency bands and applies dB normalization for drawing.
src/main/java/club/muimi/kimusic/service/playback/JavaSoundPlaybackEngine.java Returns calibrated linear amplitudes for each usable FFT bin (consumer now handles banding/log scaling).
pom.xml Version bump to 0.1.1.
.github/workflows/release.yml Updates packaged artifact names and jpackage --app-version to 0.1.1.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +67 to +71
double toFrequency = 20.0 * Math.pow(1000.0, (double) (index + 1) / spectrum.length);
double binsPerHertz = values.length / 20000.0;
int from = Math.max(1, (int) Math.floor(fromFrequency * binsPerHertz));
int to = Math.min(values.length, Math.max(from + 1,
(int) Math.ceil(toFrequency * binsPerHertz)));
@Muimi272 Muimi272 closed this Aug 25, 2026
@Muimi272
Muimi272 deleted the fix-spectrum-balance-v0.1.1 branch August 25, 2026 19:31
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.

2 participants