This is my guide for generating playlists for your local music library using ListenBrainz and the [troi recommendation engine](https://github.com/metabrainz/troi-recommendation-playground). troi is still being developed and the [official documentation](https://troi.readthedocs.io/en/latest/) isn't great so I figured documenting my process might help others who are interested. I've tried this both with local folders on my Debian server and with my Navidrome library from my Macbook so I will do my best to explain both. There are a few requirements 1. Your music must be tagged with MusicBrainz. I use [beets](https://beets.io/) for this but you can also use the MusicBrainz [desktop client](https://picard.musicbrainz.org/downloads/). 2. You need a [ListenBrainz](https://listenbrainz.org) account. Data can be imported from Last.fm or Libre.fm if you have it. # Install troi Install troi and nmslib with pip ``` pip install troi pip install nmslib-metabrainz ``` If you're on a managed python install use pipx and add the virtual environment to your PATH (don't forget to reload) ``` pipx install troi pipx inject troi nmslib-metabrainz export PATH="$PATH":"$HOME/.local/bin" source ~/.zshrc ``` # Configure troi Create a folder for your troi configuration files. I used `~/.config/troi`. Create a file `config.py` in your configuration folder using the example format below. Edit `DATABASE_FILE` and `MUSIC_DIRECTORIES` to match your setup. If you're using a Subsonic library (like Navidrome) you can fill in `SUBSONIC_HOST` with your instance url, `SUBSONIC_USER` and `SUBSONIC_PASSWORD` with your login and `SUBSONIC_PORT` with 443 (this is the only port that I could get to work with my docker setup) ``` ini # Where to find the database file # If path is passed with -d flag, this list is ignored. DATABASE_FILE = "/users/sillyhatsonly/.config/troi/troi-db.db" # To connect to a Subsonic API SUBSONIC_HOST = "https://music.myserver.dev" # include http:// or https:// SUBSONIC_USER = "admin" SUBSONIC_PASSWORD = "thisisnotmypassword" SUBSONIC_PORT = 443 # List of music directories to scan by default # If paths are passed to scan command, this list is ignored. # Invalid directories are skipped. MUSIC_DIRECTORIES = [ 'My/Music/Directory 1', 'My/Music/Directory 2', ] ``` # Create your music database Now create the database, scan the local directories specified in `config.py` and pull ListenBrainz tag/popularity metadata for all files. If you're using a Subsonic library run `troi db subsonic` instead of `troi db scan` ``` bash # create database troi db create # scan music directories troi db scan # pull music metadata troi db metadata ``` # Generate playlists Generate playlists for your local library using ListenBrainz Radio Local. Specify a mode which sets how closely the resulting playlist will meet the prompt (easy/medium/hard from closest to furthest) and an entity reference either *artist* or *tag*. More details in the docs: [LB Prompt Radio Reference](https://troi.readthedocs.io/en/latest/lb_radio.html#lb-radio) ``` bash # tracks by Thou and similar artists troi lb-radio easy 'artist:(thou)' -m <playlist-name>.m3u # tracks tagged 'jazz' and tracks tagged 'hip-hop' troi lb-radio medium 'tag:(jazz)::or tag:(hip-hop)' # tracks tagged both 'indie rock' and 'experimental' troi lb-radio medium 'tag:(indie rock, experimental)' ``` Another option is to generate weekly recommendations playlists for your ListenBrainz account ``` bash # -m flag saves to the specified m3u playlist troi weekly-jams <username> -m <playlist-name>.m3u # -u flag uploads the playlist via Subsonic API troi weekly-jams <username> -u ``` # Automate weekly playlists You can automate weekly playlists with a script. I wrote a script that scans my music directory, removes missing files, generates a playlist, and saves it locally as an m3u ``` bash #!/bin/sh # scan music directory and pull metadata using the database in our troi config folder troi db scan 'My/Music/Directory 1' -q -d '/users/sillyhatsonly/.config/troi/troi-db.db' troi db metadata 'My/Music/Directory 1' -q -d '/users/sillyhatsonly/.config/troi/troi-db.db' # clean up the database and remove any missing files troi db cleanup --remove -q -d '/users/sillyhatsonly/.config/troi/troi-db.db' # generate weekly playlist and save locally to m3u troi weekly-jams <username> -d '/users/sillyhatsonly/.config/troi/troi-db.db' -y -q -m /users/sillyhatsonly/music/playlists/weekly-$(date +%Y%m%d).m3u ``` Then set it up to run weekly as a cron job. ______ That's all I've done so far. Hopefully this makes sense. I welcome comments or questions. If anyone else has been using troi with their local music libraries I'd love to hear about your experience. Playlist generation was the one feature I really missed when I stopped using streaming platforms so I'm excited about this tool!

46
2
What's the easiest way to host a music colletion (FLAC)?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    sillyhatsonly
    Now 100%

    Streaming my own music was the reason I got into self-hosting in the first place and I’ve been satisfied with Navidrome for over a year now. My preference is to stream via an app on my phone but I’ve made accounts for a couple friends and they stream happily on multiple devices using the browser interface.

    2
  • How to get started with pirating music (mp3s)?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    sillyhatsonly
    Now 100%

    As stated, my reason is that I was paying Spotify more money for less music and I was unhappy with that. You pointed out yourself that musicians barely get by in the streaming era so I would rather support them on Bandcamp (I know it has it’s own issues) or buying physical media whenever possible rather than pirating. Streaming platforms may make music you want to listen to seemingly affordable and accessible but that’s not the case for everyone. This is my personal experience.

    1
  • How to get started with pirating music (mp3s)?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    sillyhatsonly
    Now 100%

    it’s easier to just sub to something like Apple Music… literally $110/yr for all the music that exists.

    As others have stated, not all music exists on every streaming platform. That alone is enough of a reason for me. I recently canceled my longtime Spotify subscription because the price kept increasing while my library kept decreasing. I actually don’t pirate music when I can help it because I’d rather support artists on Bandcamp or purchasing physical media directly. If I can’t do that then I head to Soulseek!

    3
  • Can we get a FAVORITE ALBUMS roll call going?
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    sillyhatsonly
    Now 100%

    Hard to narrow down favorites because my feelings change often, but these 5 have been in rotation most often lately (in no particular order)

    And I'll say that I don't necessarily think these are the best albums ever... I don't think I could ever make up my mind about that! Looking forward to seeing everyone else's picks.

    4
  • Right up until the firewall blocks it at least
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    sillyhatsonly
    Now 100%

    GIMP is fine but who can find me replacements for After Effects and Premiere Pro? I need software for video editing/motion graphics and these are the two apps keeping me shackled to Adobe for now…

    1
  • News / Splatfest: Results are in for the Fluffiness Splatfest
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    sillyhatsonly
    Now 100%

    I was convinced that bunnies would win until I realized the Grizzco/bearcub conspiracy that was taking place lol

    All in all I had fun, this was my 2nd Splatfest and it was rough getting beaten by better players every game but I managed to get 21 snails so I can’t be too upset.

    2
  • I'm trying to reign in my iOS camera roll and I figured it would be easier on desktop. Turns out the Photos app suuuuuuucks. All I want is to categorize photos by tag or folder and then remove them from the main view. Albums are nice in theory but they're an extra click/tap away from the home screen and don't hide photos from the camera roll. Is there a better way to do this?

    22
    13

    cross-posted from: https://lemmy.blahaj.zone/post/1312795 > ![](https://lemmy.blahaj.zone/pictrs/image/Dg2SZ6JdIu.png) > > [*Image description: A screenshot of the lemmy.blahaj.zone front page with a custom userstyle applied. The userstyle features a dark gray background with medium gray text and brightly-colored accents of purple, pink, orange, and cyan. The right sidebar cards are a light shade of gray with lighter gray text, pink buttons, and orange links*] > > A few weeks ago I decided to try my hand at bringing my favorite theme to Lemmy and [this userscript](https://userstyles.world/style/10759/draculemmy-a-dracula-theme-for-lemmy) was born. It's still in the early stages so there are some wrinkles to iron out, but I just pushed a big update with better contrast, style fixes, and streamlined code. > > I've received several requests to turn it into a native Lemmy theme but have no idea how to do that. If anyone has any tips on theming, interest in collaborating, or a Lemmy instance where I could test a native theme, hit me up! You can find all the code [here on Codeberg](https://codeberg.org/sillycodeonly/DracuLemmy).

    120
    10

    cross-posted from: https://lemmy.blahaj.zone/post/1312795 > ![](https://lemmy.blahaj.zone/pictrs/image/Dg2SZ6JdIu.png) > > [*Image description: A screenshot of the lemmy.blahaj.zone front page with a custom userstyle applied. The userstyle features a dark gray background with medium gray text and brightly-colored accents of purple, pink, orange, and cyan. The right sidebar cards are a light shade of gray with lighter gray text, pink buttons, and orange links*] > > A few weeks ago I decided to try my hand at bringing my favorite theme to Lemmy and [this userscript](https://userstyles.world/style/10759/draculemmy-a-dracula-theme-for-lemmy) was born. It's still in the early stages so there are some wrinkles to iron out, but I just pushed a big update with better contrast, style fixes, and streamlined code. > > I've received several requests to turn it into a native Lemmy theme but have no idea how to do that. If anyone has any tips on theming, interest in collaborating, or a Lemmy instance where I could test a native theme, hit me up! You can find all the code [here on Codeberg](https://codeberg.org/sillycodeonly/DracuLemmy).

    18
    3

    ![](https://lemmy.blahaj.zone/pictrs/image/Dg2SZ6JdIu.png) [*Image description: A screenshot of the lemmy.blahaj.zone front page with a custom userstyle applied. The userstyle features a dark gray background with medium gray text and brightly-colored accents of purple, pink, orange, and cyan. The right sidebar cards are a light shade of gray with lighter gray text, pink buttons, and orange links*] A few weeks ago I decided to try my hand at bringing my favorite theme to Lemmy and [this userscript](https://userstyles.world/style/10759/draculemmy-a-dracula-theme-for-lemmy) was born. It's still in the early stages so there are some wrinkles to iron out, but I just pushed a big update with better contrast, style fixes, and streamlined code. I've received several requests to turn it into a native Lemmy theme but have no idea how to do that. If anyone has any tips on theming, interest in collaborating, or a Lemmy instance where I could test a native theme, hit me up! You can find all the code [here on Codeberg](https://codeberg.org/sillycodeonly/DracuLemmy).

    27
    2

    When adding a new task in iOS there’s a toolbar at the bottom with icons to include date, location, flag, or an image. Is there a way to add a priority tag without having to tap the Details icon to go into a separate menu? I like prioritizing my reminders but I hate having to take that extra step.

    14
    5

    cross-posted from: https://lemmy.blahaj.zone/post/927840 > [*Image description: A white fountain pen with a silver clip on the cap and a silver zebra stripe band around the middle lies on a blue dotted grid desk pad.*] > > I impulse bought a Pilot Metropolitan (F) about a month ago and have had the *worst* experience so far. First it took 3 days of experimenting (squeezing the cartridge, flushing, cleaning, shaking, incessant scribbling) to get it to write at all. Then I noticed the nib was a bit off-center in the feed so I aligned it and it wrote pretty well for a while. This morning I grabbed it to take some notes and it won't start, even after a flush with water and re-seating the cartridge. This isn't my first fountain pen (not even my first Pilot!) but I'm really disappointed because the Metro seems to be such a popular recommendation as a solid, inexpensive starter pen. Did I get a dud?

    2
    3

    [*Image description: A white fountain pen with a silver clip on the cap and a silver zebra stripe band around the middle lies on a blue dotted grid desk pad.*] I impulse bought a Pilot Metropolitan (F) about a month ago and have had the *worst* experience so far. First it took 3 days of experimenting (squeezing the cartridge, flushing, cleaning, shaking, incessant scribbling) to get it to write at all. Then I noticed the nib was a bit off-center in the feed so I aligned it and it wrote pretty well for a while. This morning I grabbed it to take some notes and it won't start, even after a flush with water and re-seating the cartridge. This isn't my first fountain pen (not even my first Pilot!) but I'm really disappointed because the Metro seems to be such a popular recommendation as a solid, inexpensive starter pen. Did I get a dud?

    40
    15

    I have a rudimentary understanding of how my home network operates, but I'd like to know more. What resources would you recommend for a beginner to learn how computer networking works, network infrastructures, different protocols, etc? I'm not looking to get into enterprise networking but I couldn't find another community to post this question so I apologize if it's irrelevant!

    28
    6

    ![](https://lemmy.blahaj.zone/pictrs/image/T1dpmphfjT.png) Decided to try my hand at bringing my favorite theme to Lemmy. It's very rough right now but I figured I would share with the community. You can install it in Stylus [here](https://userstyles.world/style/10759/draculemmy) to test. I welcome all feedback and suggestions!

    142
    35
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearNI
    [Walmart / US] Xenoblade Chronicles 3 - $44.97 (25% off, lowest price ever) [Physical]

    **Link:** https://www.walmart.com/ip/Xenoblade-Chronicles-3/966594493 **Deku Deals price tracker:** https://www.dekudeals.com/items/xenoblade-chronicles-3 Physical copy, free shipping with lowest price ever according to Deku Deals

    1
    0
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearSI
    Now
    12 77

    sillyhatsonly

    lemmy.blahaj.zone