Skip to content

Smart Playlist

lpcornel edited this page May 13, 2026 · 5 revisions

Smart Playlist

Home

The Smart Playlist generates variety-optimized playlists using four tunable variables: track rating, days since last played, artist exclusion window, and Custom Artist groupings.

MusicLib main window screenshot


How the Algorithm Works

  1. Your library is divided into five rating groups (1★–5★)
  2. Each group has an age threshold (days). Tracks played more recently than the threshold are excluded
  3. Eligible tracks get a variance score — the further past the threshold, the higher the score
  4. Variance totals are used to assign proportional weights to each group — groups with more overdue tracks get more playlist slots
  5. When a track is selected, its effective artist enters a rolling exclusion window — that artist won't repeat until the window rolls past

Tuning Variables

Age Threshold by Rating Group

Set in Smart Playlist Panel → Configuration or via Settings → Smart Playlist.

Rating Suggested Starting Threshold Rationale
★ (1 star) 300–500 days Keep low-rated tracks rare
★★ 180–300 days
★★★ 90–180 days
★★★★ 45–90 days
★★★★★ 30–60 days Favorites cycle back quickly

Use Analyze → Preview to check eligible track counts and sample weights before generating.

Artist Exclusion Window

Number of unique effective-artist tracks that must play before an artist can repeat. Tune based on your library's unique artist count. Run Preview to see how your current window affects the pool.

Custom Artist Field

Use the Custom Artist column (Custom2 in the database) to group artist variants under one identity for exclusion purposes.

Example: If you have both Tom Petty and Tom Petty & The Heartbreakers, set Custom Artist to Petty on all his tracks. The exclusion window then treats them as one entry.

To set a Custom Artist: double-click the Custom Artist cell in Library View.

You can use any grouping scheme — e.g., set Rockabilly as Custom Artist on 30 tracks from different artists to treat them as a single entity.


Using the Panel

  1. Configuration — Set age thresholds, exclusion window, playlist size Smart Playlist panel screenshot

  2. Analyze → Preview — Review per-group stats: eligible tracks, unique artists, variance totals, sample breakdown Smart Playlist panel screenshot

  3. Generate — Enter a name → optionally check Load into PlayerGenerate Playlist Smart Playlist panel screenshot


CLI Usage

# Preview pool with current config
musiclib-cli smart-playlist analyze

# Preview with custom thresholds
musiclib-cli smart-playlist analyze -g 720,360,180,90,45

# Generate with defaults
musiclib-cli smart-playlist generate --load-player

# Generate with custom settings
musiclib-cli smart-playlist generate -p 100 -n "Evening Mix" -g 180,90,45,30,14

New Libraries (No Play History)

Tracks with no play record are treated as maximally overdue — every rated track is eligible, weighted by rating group. The playlist improves automatically as real play history accumulates.


Notes

  • Unrated tracks (0 stars) are excluded from the pool — rate tracks to include them
  • CLI flags override config values for that run only; they don't persist to musiclib.conf
  • If playlist name is never changed from the default "Smart Playlist", your player may show duplicate playlist tabs — rename or delete the old one

Clone this wiki locally