Skip to content

Feature/apple music lyrics viewer - #2469

Open
HrishikeshBhandarkar wants to merge 21 commits into
maxrave-dev:devfrom
HrishikeshBhandarkar:feature/apple-music-lyrics-viewer
Open

HrishikeshBhandarkar wants to merge 21 commits into
maxrave-dev:devfrom
HrishikeshBhandarkar:feature/apple-music-lyrics-viewer

Conversation

@HrishikeshBhandarkar

@HrishikeshBhandarkar HrishikeshBhandarkar commented Sep 6, 2026 •

Copy link
Copy Markdown

Apple Music Lyrics Experience, Accompanist Engine & Duet Alignment

What this PR does

Brings a comprehensive Apple Music-grade lyrics experience to SimpMusic, powered by a high-performance Compose lyrics layout engine, 60Hz/120Hz monotonic smooth clock interpolation, multi-agent duet left/right alignment, dynamic typography scaling, breathing dots for instrumental breaks, and dedicated unsynced lyrics presentation.


Highlights & Key Features

  1. High-Performance Karaoke & Line-Synced Engine (KaraokeLyricsView)

    • Built on a decoupled lyrics rendering architecture with spring physics (SpringPlacementModifierNode).
    • Syllable-by-syllable text wiping for rich-synced tracks with custom cubic Bézier & Newton polynomial easing transitions.
    • Dual-line composite layout item for main vocals and background accompaniment / backing vocals.
    • Dynamic font size and layout calculator (LyricsLayoutCalculator) adapting text sizes across line lengths.
  2. Apple Music Duet & Multi-Agent Alignment

    • Maps Voice 1 (v1 / lead) to Left alignment and Voice 2 (v2, v2000 / duet partner or sample vocals) to Right alignment.
    • Translations (line.translation) dynamically align with the corresponding singer (left under Voice 1, right under Voice 2).
    • Order-independent tag parsing ([bg], [v2], [v1]) in LyricsAdapter.
  3. 60Hz / 120Hz Monotonic Smooth Clock Interpolation

    • Eliminates stutter caused by periodic player polling (e.g. 250ms–500ms intervals).
    • Interpolates frame-by-frame on Android's Choreographer VSync signal using withInfiniteAnimationFrameMillis.
    • Strictly monotonic: advances continuously with a gentle 8% spring catch-up, while snapping instantly on user seeks or track changes (>500ms difference).
    • Draws inside the Canvas DrawScope without recomposing the UI tree on frame updates.
  4. Instrumental Breathing Dots Indicator

    • Displays animated pulsing dots during instrumental intros (>7s) and bridge interludes so users know exactly when vocals resume.
  5. Display Options & Translation Support

    • Quick lyrics menu to toggle translations, romanization, and original scripts on the fly.
    • Seamlessly integrated with SharedViewModel's lyrics and AI translation pipeline.

Commits in this PR (21 commits)

  1. 6165a119 feat(core): update core submodule with lyrics timeline update time
  2. 9718a7e6 feat(lyrics): add cubic bezier and newton polynomial interpolation easing curves
  3. b28c66aa feat(lyrics): add spring placement modifier for fluid lyric line repositioning
  4. 24441d05 feat(lyrics): add brush and color utilities for dynamic lyric text highlighting
  5. b714d6f6 feat(lyrics): add multiplatform string width calculation utilities
  6. 4006c801 feat(lyrics): implement breathing dots indicator for instrumental breaks and intros
  7. 0ea2792d feat(lyrics): add dynamic lyrics layout and font size calculator
  8. acf85e89 feat(lyrics): implement line-synced text rendering with smooth scale transitions
  9. e1144e75 feat(lyrics): implement syllable-by-syllable karaoke text wipe animation
  10. bcaec698 feat(lyrics): add main and accompaniment line composite layout item
  11. e5398e2a feat(lyrics): implement high-performance KaraokeLyricsView composable with spring physics
  12. c73e617c feat(lyrics): add LyricsAdapter domain transformer for word timestamps and backing vocals
  13. b2bc105b feat(theme): add SF Pro typography and translation icon resources for Apple Music lyrics
  14. 2c46b06e feat(player): add AppleMusicShared typography, styling tokens and translation menus
  15. 9fb2512c feat(player): integrate KaraokeLyricsView and monotonic smooth clock in AppleMusicLyricsView
  16. dcb976f9 feat(lyrics): add dedicated UnsyncedLyricsLineItem with full user scroll control
  17. e503ad5d fix(lyrics): cleanly terminate active line state and auto-scroll when track reaches completion
  18. bf49d3d2 build(deps): integrate accompanist lyrics-core library and configure compiler opt-ins
  19. 1d1a2fd6 fix(player): initialize lyrics and translation flows before init block to prevent NPE
  20. 865f79fc feat(lyrics): improve v1/v2 duet alignment and tag parsing resilience
  21. 37dd62d7 chore(core): update core submodule pointer with TTML parser support

Targeted Branch

  • Base: maxrave-dev/SimpMusic:dev
  • Head: HrishikeshBhandarkar/SimpMusic:feature/apple-music-lyrics-viewer

Screen Recordings

Before (Word-by-word Old Version) After (Apple Music Engine )
Screenrecorder-2026-09-06-21-09-51-179.mp4
Screenrecorder-2026-09-06-21-08-39-284.mp4

Verification & Testing

  • JVM Tests: :composeApp:jvmTest passed (BUILD SUCCESSFUL), verifying LyricsAdapterTest word timestamps, backing vocals handling, romanization heuristics, and v1/v2 duet placements.
  • Android Compilation: :androidApp:compileDebugKotlin compiled cleanly with 0 errors.

Checklist

  • I wrote or personally reviewed every line of this change
  • I tested it on Android and/or Desktop (Tested on Android device via ./gradlew :androidApp:compileDebugKotlin and JVM via ./gradlew :composeApp:jvmTest)

@HrishikeshBhandarkar
HrishikeshBhandarkar marked this pull request as draft September 6, 2026 15:18
@HrishikeshBhandarkar
HrishikeshBhandarkar marked this pull request as ready for review September 6, 2026 15:49
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