Skip to content

Generator Codes

Every step in the smart playlist editor is stored as a short code. The Generator code box in the editor shows them, and you can type codes there directly. The steps update to match.

You don’t need codes to use smart playlists. This page is for anyone who prefers typing them.

Codes are separated by spaces and run left to right. A typical code:

  1. Picks the playlists to draw from (optional; otherwise all playlists are used).
  2. Takes tracks from them. At least one of these is required.
  3. Filters, sorts and limits them (optional).

These match the editor’s From, Take and Then rows.

You wantCode
All your loved tracksa l
Loved tracks from one playlists"My Playlist" a l
Loved tracks by one artista"Artist Name" l
10 random tracks from “Library”s"Library" a st n10
Every album, shuffleda ra
An hour of music, at most 2 tracks per artista st per-artist2 t60
Unplayed tracks by an artists"Library" a"Coldplay" pc<1
CodeExampleNotes
Playlists"Library"Add several to use several playlists. Without any, all playlists are used.
This playlistselfUses the playlist itself. Combine with auto and a sort to re-sort tracks as they’re imported. Filters with this are destructive.
ClearclrGoes back to using all playlists
CodeExampleNotes
All tracksa
Artista"Artist Name"Partial matches work, like a"arti"
Genreg"Rock"Partial match. g="Rock" matches the exact genre, and gm"Rock" matches one value of a multi-value genre.
Searchf"text"Like quick find: title, artist, album, composer, comment and file path. fs"text" matches the exact text, including spaces.
Folderp"Albums/Live"Matches part of the folder path
Labellb"Warp"Partial match. Use lb="Warp Records" for an exact label.
File typeext"flac"Matches the file extension

These take tracks from network sources. In the editor they’re under Take › + › Services.

CodeTakes
plexThe Plex library
jellyThe Jellyfin library
jelly"ID"A Jellyfin playlist, by its ID
airThe Airsonic library
tauThe Tauon Satellite playlist
tpl"ID"A Tidal playlist
tfa / tftTidal favourite albums / tracks
tar"ID"A Tidal artist
tmix"ID"A Tidal mix
CodeExampleNotes
Yeary>2015, y<2000, y=2016Also y>= and y<=
Ratingrat>3, rat=5In stars. rat keeps only rated tracks and norat only unrated ones.
Album ratingrata>4Also rata< and rata=
Play countpc>5, pc<1
Play timept>600Total time played, in seconds
Lengthd<3, d>10Track length, in minutes
Album lengthad>40In minutes
Recently modifiedm>30dModified in the last 30 days. m<30d is over 30 days ago.
Modified sincem>2024-01-01Also m<
Skipssk<1, sk>3Times skipped
Lovedl
Has lyricsly
On this daytodayReleased on today’s month and day
Hi-reshrOver 16-bit or over 48 kHz
CUE trackscuePart of a CUE sheet
Keep matchingff"text"Like f, but only keeps tracks already taken
Exclude matchingfx"text"Removes tracks that match
Commentcom"bandcamp"Text in the comment
Not in playlistpx"Archive"Removes any track that’s in that playlist
CodeWhat it sorts by
stShuffle tracks
raShuffle albums (sf also works)
y> / y<Year, newest / oldest first
rat> / rat<Rating, highest / lowest first
rata>Album rating, highest first
pt> / pt<Play time, most / least first
pa> / pa<Album play time, most / least first
d> / d<Length, longest / shortest first
ad> / ad<Album length, longest / shortest first
m> / m<Modified, newest / oldest first
ia> / ia<Imported, newest / oldest first
"Bitrate">Any column, by its exact title in the columns view. Use < to reverse.
tnTrack number within each album
pathFile path
ypaYear, within each artist (artists must already be grouped)
rv / rvaReverse the tracks / albums
CodeExampleNotes
Number of tracksn50Keep the first 50 tracks
Total timet60Stop at 60 minutes
Max per artistper-artist2At most 2 tracks per artist
CodeNotes
autoRegenerate the playlist when you open it and after importing music. This is the editor’s Auto update box.