Repository navigation
Conversation
There was a problem hiding this comment.
🟡 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
JavaSoundPlaybackEnginespectrum analysis to return per-FFT-bin calibrated linear amplitudes (instead of pre-bucketed bands). - Updated
WaveformViewto aggregate FFT bins into log-frequency bands and render magnitude/peaks using a dB-based normalization. - Bumped application version to
0.1.1and 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))); |
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.
No description provided.