I’m trying to create smart playlists for running.
I can’t seem to figure out how I can make a smart playlist that gives me tracks that conform to multiple bpm ranges and mutiple genres. E.g. like
bpm: 89..91
OR
bpm 178..182
for
genre: electronica
OR
genre: hip\ hop
I’ve tried this (among others) but it doesn’t work
I’ve looked at readthedoc(s), @jakabadambalazs Github (for his wonderful plugin by the way but I don’t need to put my data on a media player, just need .3mu files) and experimented quite a lot but I always only got only part of the criterias returned in the m3u
I’d love to learn this. So my questions are.
How does one search multiple genre’s for multiple bpm ranges.
How is this search language called (so that I can research it further on the internet)?
Unfortunately or fortunately, this query language does not have a name. It is a whole-cloth beets invention, so the best name it has is “the beets query language,” and the canonical reference is the “Queries” page in the docs. It has grown organically over the years, and that page could certainly use more examples…
I knew there was a runner around here and not just boring computer nerds
It is quite funny you ask this because I was thinking exactly about this the other day. As for the goingrunning plugin is concerned, I think you hit on one of the the most critical point: the song selection (this is really what the whole plugin is about). At the moment it uses flavours that you can mix to extend your query definition:
However when two flavours contain the same field like bpm ranges (your case) or if in the above example I add rebel to my 10K training so that it will use use_flavours: [running, intensity_high, classic_rock, rebel] - the one will override the other - and in the current state I will lose genre rock to ska. This is one of the next things I’d like to solve by creating a “merging strategy”. It’s “just” a matter of time.
The goingrunning plugin will at one point generate playlist files (and probably an option to skip copying music files to external player).
@adrian - uhhh, I didn’t know you could do that! So, it would look something like this?
Thanks for this @adrian. I tried with square brackets but didn’t think of the round ones
Respect for creating the query language. Could be useful for so many more open source projects I guess.
Reading about your plugin made me really enthusiastic. I studied your page on Github page extensively and really liked the concept of being able to mix flavours and the fact that your plugin seems to be able to create lists of a specific duration.
I hope you’ll find the solution for the omitted criteria.
Great news that you have plans to make the plugin generate playlist files too. Can’t wait!
You know what, it looks like I was totally wrong about the parentheses thing. I thought we had implemented that, but we had not.
First things first, I would recommend testing out queries with the list command. So try beet ls bpm:89..91, bpm:178..182 or similar to see if the query does what you want. And only once you have figured out a query that does what you’re expecting, then you can try configuring the smartplaylist plugin.
For your use case, in the absence of parentheses I might recommend using query negation and the inverse range for the BPM. For example, ^bpm:..88 ^bpm:92..177 ^bpm:183...
For the genre part, you could use regular expression queries. For example, genre::(electronica|hip hop). Of course, you will need to quote that query term in your shell to preserve the parens, space, and pipe.
Thanks @adrian for your suggestion to test with list command. I do it every once in a while, but also often forget it.
You suggestion for query negation works nicely. I ran a beet ls -f "$(printf '$albumartist-$title $bpm')" ^bpm:..88 ^bpm:92..177 ^bpm:183..
and it output only tracks that fitted the criteria.
I discovered that the genre I was looking for was electronic and not electronica.
But even when doing a query with genre::(electronic|hip hop) like this:
beet ls "genre::(electronic|hip hop)"
I didn’t get any results. I tried many many variations. None of these did output any tracks.
Any idea why this wouldn’t result in a list with tracks that are either hip hop or electronic? I checked that I get results for each genre individually and that of course worked.
Wait no more ! The new release (v1.2.1) can now generate playlists and has an option to suppress file copying (i.e. create playlist only). Also, it now supports list format for individual fields, so you can easily do something like this: