traktorBeetsIntegration
traktorBeetsIntegration copied to clipboard
Beet + Traktor integration: sync custom tags and import utils
Traktor custom tags: Beets Integration
This project is an integration between Beets and Traktor that helps manage Traktor libraries.
Warning: this was developped and used only on MacOs, I doubt this project is compatible with Windows. This project comes with no guarantees: I recommend backing-up your files.
Core features (detailed in Features):
- enable usage of custom tags in Traktor through auto-generated playlists
- auto-generate comments on Traktor tracks to help you visualize custom tags
- sync tags between Traktor and Beets
- utils to easily import your Traktor library into Beets' library
- utils to prompt pre-configured custom tags to easily tag your tracks
- auto-import "m3u" playlists folders in Traktor (useful when using the
smartPlaylists
Beets plugin)
Planned features:
- multi-value metadata support
- create an issue if you have a feature request ;)
Feel free to contribute with PRs/issues !
See it in action !
Created a quick Youtube video in addition to this doc to show the workflow: here's the link.
Install
This projects was developed pipenv
+ python 3.8
.
git clone https://github.com/16pierre/traktorPlaylistExport
cd traktorPlaylistExport
pipenv install
Configuration
cp locations.json.template locations.json
cp scanner_tags.json.template scanner_tags.json
- Edit
locations.json
to specify where yourTraktor
collection.nml
file is etc. - Edit
scanner_tags.json
to specify the different custom tags you want to use & playlists you want to generate - For import utils: edit
Beets
config: setimport.link: yes
(see below)
Usage
Sync Traktor<->Beets
pipenv run sync
Utils: tag scanner
Helps you scan your tracks with tags specified in scanner_tags.json
.
You can also use beet modify
, but most of the time I find it more convenient to use the scanner to avoid typos.
pipenv run scan
pipenv run scan artist:Daft Punk
etc.
Utils: import helper
Helps you import your Traktor
library inside Beets
. See below for more explanation, this is not trivial.
pipenv run import
Features
Sync Beets<->Traktor
In this section, let's assume that tracks are imported in both Beets
and Traktor
,
and that they both use the same file paths.
The core idea here is the link between Traktor
's playlists and Beets
metadata. Let's take a few examples.
Say I configured scanner_tags.json
with:
{
"_playlists": [
["mood"],
["energy"],
["mood", "energy"]
],
"mood": ["dark", "joyful"],
"energy": ["1", "2", "3", "4", "5"]
}
This will create 3 kinds of playlists in Traktor
:
- one for each
mood
:mood: dark
... - one for each
energy
:energy: 1
... - one for each
(mood, energy)
couple:mood: dark, energy: 1
With this system, we can unambiguously link Beets metadata
to Traktor playlists
;
this link is the core mechanism behind the sync:
- Editing a tag in
Beets
will update the matchingTraktor
playlists - Adding a track to a
Traktor
playlist will update the corresponding tags inBeets
Extra mechanisms:
- you can use the star rating system in
Traktor
, it's synced with therating
tag inBeets
. - to help you visualize the metadata in
Traktor
, the sync writes comments on the Track to list the custom tags (warning: this will override existing comments, will be fixed, issue: https://github.com/16pierre/traktorPlaylistExport/issues/1)
Help import Traktor library into Beets
Configuration required
Note: this util requires using beet import
with symlinks. You therefore need to configure Beets
like this:
import:
link: yes
For more details, see Beets docs.
Why add utils for imports
In order for the sync to work properly, you need to have imported the tracks in both Traktor
and Beets
.
Importing Beets
' library in Traktor
is easy: you can simply setup the Traktor
default music directories to include Beets
' folder.
The issue is rather importing Traktor
's library in Beets
:
- if you copy the files to
Beets
, you'd end up with useless duplicates - if you move the files to
Beets
, you'd need to relocate all the tracks - running
beet import
is not easy if the files in yourTraktor
library are not centralized
That's why I implemented some utils for this use case.
How these utils work
Let's see what happens step by step when running pipenv run import
(this also happens when running pipenv run sync
):
- Import whatever you want in
Traktor
, you can also sort your tracks in playlists like explained above: this will be tagged later even if your tracks are not imported inbeets
yet -
Automatic: find all tracks imported in
Traktor
but not inBeets
- Automatic: symlink these files to a temporary directory organized by album
-
Manual action required:
beet import
in the temporary directory. Warning: you need to configureimport.link = yes
inBeets
config - Manual action required: close Traktor if opened.
- At this point, we have a double symlink:
beet_library -> temporary folder -> original track
-
Automatic: detects that tracks have been imported in
Beets
thanks to the symlinks. -
Automatic: delete symlinks, move the original files to
beet_library
, and updateTraktor
library to point tobeet_library
instead of the original files. - You can reopen Traktor now :)