Skip to content

Fix spectrum nyquist mapping v0.1.1 - #4

Closed
Muimi272 wants to merge 5 commits into
masterfrom
fix-spectrum-nyquist-mapping-v0.1.1
Closed

Muimi272 wants to merge 5 commits into
masterfrom
fix-spectrum-nyquist-mapping-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:58

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 dB + per-bin spectrum assumptions in WaveformView are incompatible with the existing JavaFX spectrum producer, likely breaking visualization for the JavaFX backend.

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

Pull request overview

This PR updates the audio spectrum pipeline to map spectrum bins to frequency correctly (up to Nyquist), and bumps the project version to 0.1.1 for release packaging.

Changes:

  • Extend VisualizationFrame to carry maxFrequencyHz and propagate Nyquist (sampleRate / 2) from the JavaSound engine into the UI.
  • Rework JavaSound spectrum generation to return per-bin linear amplitudes, and update WaveformView to perform logarithmic frequency banding plus a dB-based display projection.
  • Bump release/version metadata from 0.1.0 to 0.1.1 in Maven and the release workflow.
File summaries
File Description
src/main/java/club/muimi/kimusic/view/component/WaveformView.java Consume per-bin spectrum + Nyquist, remap to log-frequency bands, and render using dB normalization.
src/main/java/club/muimi/kimusic/service/playback/VisualizationFrame.java Add maxFrequencyHz to carry Nyquist through the visualization pipeline.
src/main/java/club/muimi/kimusic/service/playback/JavaSoundPlaybackEngine.java Compute calibrated per-bin linear amplitudes and attach Nyquist when publishing frames.
pom.xml Version bump to 0.1.1.
.github/workflows/release.yml Update packaged artifact names and jpackage app version to 0.1.1.
Review details
  • Files reviewed: 5/5 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 +168 to +171
float raw = (float) (spectrum[index] * displayScale);
double db = 20 * Math.log10(raw + 1e-12);
double normalized = (db + 120) / 120;
double magnitude = Math.max(0.025, Math.min(1.0, normalized));
@Muimi272 Muimi272 closed this Aug 25, 2026
@Muimi272
Muimi272 deleted the fix-spectrum-nyquist-mapping-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