The catalog: facts that follow the track¶
The catalog is one SQLite file of facts about tracks: Energy, Valence, playlists, grids, ratings,
themes, rhythms. A track is named by its Spotify ID (spotify:<id>), else its ISRC (isrc:<code>),
else a digest of its audio that ignores tags (audio:<kind>:<sha1>). The catalog stores no file paths
and no library ids, so the same file brings any Mixxx library, on any machine, to the same values.
Tools that compute something write it into the catalog; only sync touches Mixxx.
Every fact has a kind, label (a person said so), measured (a tool computed it) or guess, and a
source. When sources disagree, a label wins over a measurement, a measurement over a guess, and within
a kind the newest fact wins. Playlists are the exception: a track is in every playlist any source puts
it in.
The default catalog is ~/.local/share/forro/catalog.sqlite (on Windows, untested:
%LOCALAPPDATA%\forro\catalog.sqlite), or catalog in the config file. Every command takes
--catalog PATH. A catalog written by a newer forro-beats with a newer format is refused.
forro catalog-import-playlists "Forró em Vinil.csv=#vinil" "Forró em BH.csv=#bh"
forro catalog-import-values essentia_values.csv --source essentia-calibrated
forro catalog-import-mixxx-grids --db ~/.mixxx/mixxxdb.sqlite
forro catalog-import-themes ../forro-themes/out
forro catalog-import-rhythms annotations/rhythms.csv
forro catalog-import-plays "Spotify Extended Streaming History"
forro catalog-import-facts from-forro-dj.csv
forro catalog-export-facts all.csv --field energy valence
forro catalog-status
| Command | Facts | Kind, source |
|---|---|---|
catalog-import-playlists CSV=TAG... |
playlist (#tag) per track of a playlist CSV; a CSV is the whole playlist, so tracks no longer in it lose that tag in the catalog |
label, playlist:<tag> |
catalog-import-values CSV |
energy, valence from columns path, energy, valence (0 to 100); the file is named by its tags, else its audio digest |
measured, --source (default essentia-calibrated) |
catalog-import-mixxx-grids |
grid: the forro-beats grids stored in a library (read only) |
measured, mixxx-grid |
catalog-import-themes DIR_OR_CSV... |
theme, theme_secondary from forro-themes *_themes.csv |
guess, forro-themes |
catalog-import-rhythms CSV |
rhythm from columns track_id, rhythm, date, path |
label, by-ear |
catalog-import-plays DIR_OR_JSON... |
plays per Spotify track id: the plays of at least 30 s in the Streaming_History_Audio_*.json files of a Spotify Extended Streaming History. The history is the whole snapshot, so importing a newer one replaces the counts. Only counts, artist and title are stored: no times, devices or IP addresses |
measured, spotify-streaming-history |
catalog-import-facts CSV... |
any field, from the facts CSV below | as in the file |
catalog-import-exportify, the old name of catalog-import-playlists, still works; facts it stored under the old source exportify:<tag> are removed the next time that tag is imported, so importing each playlist again moves a catalog to playlist:<tag>.
Playlist CSVs¶
The playlist CSVs come from Chosic's
Spotify Playlist Analyzer: paste a playlist's link
or ID there, and export its songs as CSV. One file per playlist; the file name does not matter, the tag
is what follows = on the command line. The same files feed mixxx-tags and mixxx-features
(Other commands).
A file has one row per track and these columns:
#,Song,Artist,BPM,Camelot,Energy,Added At,Duration,Popularity,Genres,Parent Genres,Album,Album Date,Dance,Acoustic,Instrumental,Valence,Speech,Live,Loud (Db),Key,Time Signature,Spotify Track Id,Label,ISRC,Explicit
forro-beats reads Spotify Track Id and ISRC to find the track, Artist and Song to name it, and
Energy and Valence (only mixxx-features); it ignores the other columns. A row with neither a
Spotify ID nor an ISRC is counted and skipped.
Spotify streaming history¶
catalog-import-plays reads the Extended Streaming History from Spotify's download of your personal
data:
- In your Spotify account, open the Privacy settings and go to "Download your data".
- Tick "Extended streaming history" and request it.
- Spotify emails a download link later; Spotify says it can take up to 30 days.
- Unzip the download. The folder (
Spotify Extended Streaming History) holds theStreaming_History_Audio_*.jsonfiles; pass the folder or the files.
The history holds much more than plays (times, devices, IP addresses); forro-beats stores only the play count per track, with its artist and title.
The facts CSV¶
The format other programs (forro-dj, say) use to hand facts to the catalog, and what
catalog-export-facts writes. UTF-8, comma-separated, quoted as RFC 4180, with this header:
spotify_id,isrc,field,value,kind,source,source_version,created_at
4pM0pt6j9F1qBQjGsU3Y2X,BRR120500146,energy,46,measured,essentia-calibrated,,2026-11-27T21:00:00Z
4pM0pt6j9F1qBQjGsU3Y2X,,playlist,"""#bh""",label,playlist:#bh,,2026-11-27T21:00:00Z
,BRUM72003960,rating,4,label,forro-dj,0.3.0,2026-11-27T21:00:00+01:00
spotify_id: the 22-character track id (aspotify:track:URI oropen.spotify.comlink also works).isrc: the ISRC. A row needs at least one of them; the track is keyed by the Spotify ID when there is one.field: one of the fields below, or a name of your own (lower case, digits,_), which is stored but not synced.value: JSON. Numbers bare (46), strings in double quotes ("#bh", which CSV quoting turns into"""#bh"""), objects for grids.kind:label,measuredorguess.source: who made the fact; a source has one fact per track and field, so importing again replaces it.source_version: optional, e.g. a model name.created_at: ISO 8601; without an offset it is UTC. Within a kind, the newest wins.
A file with any invalid row is not imported at all; the errors give the line numbers. Facts known only by an audio digest have no Spotify ID or ISRC and are left out of an export.
| Field | Value |
|---|---|
energy, valence |
integer 0 to 100, the scale mixxx-features writes |
playlist |
a tag such as "#bh"; one per source |
rating |
integer 1 to 5 |
plays |
integer, 0 or more |
theme, theme_secondary, rhythm |
string |
grid |
{"version": "BeatMap-1.0" or "BeatGrid-2.0", "sample_rate", "lag_frames", "bpm", "bpm_lock" (0/1), "sub_version", "frames": [...]} for a BeatMap or "first_frame" for a BeatGrid; frames as Mixxx stores them, lag_frames the decoder offset of the file they were measured on (see The MP3 offset), null when unknown |