Yesterday, I spent a long time learning how to use MusicBrainz Picard. Today, I discovered beets on Reddit. So, I decided to install it on Windows.
Note: This assumes you have chocolatey installed.
choco install -y python
python -m ensurepip --upgrade
python -m pip install --upgrade pip
pip install beets
beet # type this to make sure everything’s in order.Now just type beet at the command prompt to use it. Read the documentation for more information.
Also, download beets.reg and modify it for your system to add a Windows shell extension that imports tracks into your beets database.
- Note: The shell extension only works on directories.
- Verify that the shell extension is installed by running:
reg query HKCR\Directory\shell\beets /sNow read through the documentation.
https://beets.readthedocs.io/en/stable/guides/main.html
pip install pyacoustid
pip install pylast
pip install requests
pip install beets[fetchart,lyrics,lastgenre]
pip install beautifulsoup4
pip install beets-copyartifacts3 # copies non-music files when importing
Do NOT install the chromaprint Python module.
The beautifulsoup4 requires a Google API key for retrieving lyrics.
Download https://github.com/acoustid/chromaprint/releases/download/v1.5.1/chromaprint-fpcalc-1.5.1-windows-x86_64.zip
Unzip fpcalc.exe to %localappdata%\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
Make sure the above directory is in your path.
winget install GStreamer
Add GStreamer to your path, e.g., E:\gstreamer\1.0\msvc_x86_64\binYou may also get prompted to update pip:
[notice] A new release of pip available: 22.3.1 -> 23.0
[notice] To update, run: pip install --upgrade pipFind your configuration file using:
beet config -pEdit your configuration file using:
beet config -eChange the first path below to a directory where you’d like to keep your music. Then, for library, choose a good place to keep a database file that keeps an index of your music. (The config’s format is YAML. You’ll want to configure your text editor to use spaces, not real tabs, for indentation. Also, ~ means your home directory in these paths, even on Windows.)
directory: ~/OneDrive/Music
library: ~/OneDrive/beets/data/musiclibrary.dbThe default configuration assumes you want to start a new organized music folder (that directory above) and that you’ll copy cleaned-up music into that empty folder using beets’ import command (see below). But you can configure beets to behave many other ways:
To keep your current directory structure and to not correct files’ tags: leave files completely unmodified on your disk. (Corrected tags will still be stored in beets’ database, and you can use them to do renaming or tag changes later.) Put this in your config file:
directory: ~/OneDrive/Music
library: ~/OneDrive/beets/data/musiclibrary.db
import:
move: yes
write: yes
format_item: $albumartist - $album - $track - $title.$format ($bitrate)
paths:
default: $albumartist/$album%aunique{}/$albumartist - $album%aunique{} - $track - $title
plugins: embedart fetchart info lastgenre lyrics copyartifacts
embedart:
remove_art_file: yes
#set_fields:
# encoder: "Exact Audio Copy (Secure mode)"
# comments: "Purchased on CD."Importing Your Library
To take the fast, un-autotagged path, just say:
$ beet import -A /my/huge/mp3/library
Note that you just need to add -A for “don’t autotag”.
Adding More Music
If you’ve ripped or… otherwise obtained some new music, you can add it with the beet import command, the same way you imported your library. Like so:
$ beet import ~/some_great_album
This will attempt to autotag the new album (interactively) and add it to your library. There are, of course, more options for this command—just type beet help import to see what’s available.
Seeing Your Music
If you want to query your music library, the beet list (shortened to beet ls) command is for you. You give it a query string, which is formatted something like a Google search, and it gives you a list of songs. Thus:
$ beet ls the magnetic fields
To import all of the files in the current directory, I tried:
beet import -A .
Now running beet ls showed this:
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Gambler (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Slide It In (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Slow An’ Easy (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Love Ain’t No Stranger (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Give Me More Time (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Standing in the Shadow (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Hungry for Love (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – All or Nothing (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Spit It Out (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Guilty of Love (UK Mix) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Need Your Love So Bad (Single B-Side) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Gambler (7′ Eddie Kramer Mix 1983) [2019 Remaster]
Whitesnake – Slide It In: The Ultimate Edition (2019 Remaster) (Disc 2 – Original UK Mix) – Guilty of Love (7′ Eddie Kramer Mix 1983) [2019 Remaster]
And beet stats showed this:
Tracks: 13
Total time: 50.6 minutes
Approximate total size: 343.0 MiB
Artists: 1
Albums: 1
Album artists: 1
To list all files containing “love”:
beet ls love
To list all files other than those containing “love” (at cmd.exe):
beet ls ^^love
To do the same in PowerShell:
beet ls ^love
Override my “don’t update tags” setting when importing:
beet import -w .
Show tags as written to files (uses the info plugin):
beet info whitesnake
beet import -W: when autotagging, don’t write new tags to the files themselves (just keep the new metadata in beets’ database)
Album Art
pip install requests
Then add fetchart and embedart to plugins.
Note: if there is already a cover.jpg file in this folder, it may not download new art and then write it into your file.
Lyrics
pip install requests
Then add lyrics to plugins.
Genre
pip install pylast
After you have pylast installed, enable the lastgenre plugin in your configuration.
Importing Tracks
- Using “K” for keep both when you are adding tracks to an albums creates a second directory for the album. Don’t use this!
Set Specific Fields
beet modify whitesnake encoder="Exact Audio Copy (Secure mode)"
beet modify whitesnake comments="Purchased on CD/DVD on 06/13/2020 from Amazon."
beet modify press play month="05"
beet modify press play day="12"
Note that Tag&Rename seems to set the month and day fields to “00” when you update the comments field.
Update Album Art from a Local File
beet embedart -f .\img008.jpg wild fire
Note that you must have the EmbedArt plugin installed for this to work.
Search for File Type
beet stats format:MP3
beet stats format:FLAC
Search for Bitrate
beet stats bitrate:128000
beet list format:MP3 bitrate:128000
Search and Display Specific Fields
beet ls press play -f '$title $mb_albumid'
beet ls press play -f '$title $month $day'
Show More Verbose Information
beet -vv
beet import --search-id c2d7051b-a367-4367-b0a0-a7746db2d9da .
beet remove whitesnake slide it in ultimate
beet info albumartist:whitesnake track:1
beet remove -p whitesnake slide it in ultimate
Update Your Database to Remove Deleted Files
beet update The Beatles 1962-1966
Remove a Custom Field (Created by Accident)
beet modify duran duran Singles 1986-1995 comment!Add to the existing comments field for a single file
$comments = beet ls tonic track:13 -f '$comments'
$comments
Amazon.com Song ID: 211724784
beet modify tonic track:13 comments="$comments`n`nPurchased on 12/19/2020 from Amazon for `$1.29."Add to the existing comments field for multiple files
1..((beet ls "final rip off").count) | % { `
$comment = beet ls "final rip off" track:$_ -f '$comments' `
beet modify -y "final rip off" track:$_ comments="$comment`n`nPurchased in MP3 format from Amazon.com on 11/06/2022 for `$5.99.`nAlso owned on CD, but last four tracks of disc 1 were bad." `
}