Skip to content

Smart Playlists

Smart playlists populate themselves automatically based on rules you define. Instead of manually adding tracks, you describe the kind of music you want and brūhi builds the list from your library.

[Screenshot: Smart Playlist rule builder — condition groups, Hard/Soft toggle, field selector, operator, value, sort options, limit controls]
  1. Open the Playlists workspace tab.
  2. Click New Smart Playlist (the wand icon).
  3. Name it and press Enter.
  4. The editor opens in Rules view by default.

Smart playlists appear in the same list as regular playlists, with a wand icon to distinguish them.

Each smart playlist is defined by one or more condition groups. Each group contains conditions linked by AND or OR logic. Groups themselves are also evaluated together.

Each individual condition has a mode:

ModeEffect
HardActs as a filter — if the condition fails, the track is excluded entirely
SoftActs as a scorer — the track is not excluded, but matched tracks rise higher in the sorted results

Soft conditions have a configurable weight (default 1.0). Higher weight means more influence on the score rank.

FieldTypeNotes
TitleText
ArtistText
AlbumText
GenresTag listA track can have multiple genres
YearNumber
Duration (seconds)Number
Days since addedNumber (virtual)Calculated from import date
BPMNumber
Musical KeyTextCamelot notation (e.g. 8B) or standard
EnergyNumber 0–1Spectral energy level
Mood TagsTag liste.g. upbeat, melancholy, tense
ExplicitBooleantrue / false
Custom TagsTag listUser-defined tags applied in the library
CategoryText (virtual)Matches by file path prefix
OperatorApplies to
containsText, tag list fields
not containsText, tag list fields
isText, number, key, boolean fields
is notText, number, key, boolean fields
is one ofText, tag list — comma-separated values
is not one ofText, tag list — comma-separated values
greater thanNumber fields
less thanNumber fields
betweenNumber fields (min and max)

Jazz tracks added in the last 30 days:

[Hard] Genres contains "Jazz"
[Hard] Days since added less than 30

Uptempo tracks for a drive show, preferring high energy:

[Hard] BPM greater than 120
[Hard] Duration between 180 and 360
[Soft] Energy greater than 0.7 (weight 2.0)

Any Miles Davis or John Coltrane:

[Hard] Artist is one of "Miles Davis, John Coltrane"

Explicit-free tracks from a set of genres:

[Hard] Genres is one of "Pop, R&B, Hip-Hop"
[Hard] Explicit is false

After conditions are evaluated, brūhi sorts the resulting tracks:

SortDescription
RandomShuffled on each evaluation
ScoreSoft-condition score descending — best matches first
AlphabeticalBy track title, A–Z
By ArtistA–Z by artist name
By BPMAscending or descending BPM
By EnergyAscending or descending energy level
By yearOldest or newest first
By date addedMost recently imported first
By durationShortest or longest first
LimitDescription
Max tracksStop after N tracks
Max durationStop when total playtime reaches N minutes

Both limits are applied after sorting.

The Playback Behaviour panel controls how smart playlists are used at runtime (scheduling and automation):

Prevent the same track or artist from appearing too soon after a previous play.

SettingDescription
Track repeat windowSuppress a track for N minutes after it was last played
Artist repeat windowSuppress all tracks by the same artist for N minutes

Repeat windows use an in-memory play history. The history persists for the life of the process (Desktop session or Cloud server process).

When Prefer harmonic is enabled, brūhi uses the Camelot Wheel to select the next track. From the filtered pool it picks a track whose musical key is compatible with the last-played key.

Compatible key relationships on the Camelot Wheel:

  • Same key (same number + same mode letter)
  • Adjacent on the wheel (±1 in number, same mode letter)
  • Relative major/minor (same number, A ↔ B)

For example, if the last track played was in 8B (C major), harmonically compatible keys are 7B, 9B, and 8A.

If no harmonically compatible track exists in the pool, a random track is selected as a fallback.

Click Preview Matches to see which tracks from your library would be included right now, without loading the playlist to a deck. Use this to validate your rules before scheduling.

Click the Script toggle to switch from the Rules view to the Script editor. Your rules are not converted automatically; Script mode and Rules mode are independent.

Example script for a 20-track jazz shuffle:

tracks = library.search("genre:Jazz").shuffle().limit(20)
playlist.set(tracks)

See brūhi Script for the full language reference.

Smart playlists are evaluated when:

  1. You click Preview Matches or load the playlist to a deck.
  2. The scheduler or automation rule triggers the playlist.
  3. On brūhi startup (Desktop), playlists are re-evaluated against the current library state.

Changes to your library (new imports, deletions) are reflected the next time the smart playlist is evaluated.

Smart playlist rules are stored in the SQLite database alongside regular playlists. Both types appear together in the playlist list with different icons.