I’m slowly starting to work on what will likely end up being ListenBrainz Radio: A prompt based music playlist generator which doesn’t actually use AI.
Inspired by last.fm’s artist radio and tag radio, I really want to be able to give a prompt like this and have a playlist generated for me:
And then get a playlist that is a blend of that artist and the tags downtempo and/or trip-hop.
My question: For the tags, what should the default behavior be? Should this prompt return tracks that have BOTH (AND) downtempo and trip-hop tags or tracks that have EITHER (OR) the of those two tags? This is about the default behaviour – once this is decided I will work out a syntax that allows the user to specify the non-default behavior.
Caveats: This syntax is for an API level interface – only devs will ever need to use this interface. For end users we’ll create a much more user friendly interface that keeps MBIDs out of the user’s face.
AND feels more natural to me, that’s how searches typically work, in my experience. I don’t do much programming or development myself tho, so this probably won’t affect me much
either way, it might be good to allow both AND and OR operators. I feel like that’s natural as well
also, I’m hoping that this feature will also allow any folksonomy tag, not just genres? I’d love to use this to create a #Brony radio or #groovy radio
Each element, unless shorthand, should be in the “prefix:value:suffix” style.
That said, lets see how to express AND and OR in this case. Lets assume for a moment, I wanted to have a radio that had two separate tag streams and one uses AND the other OR. Your suggested !AND notation gets a bit tricky here – does it refer to the following element, or all elements that follow it, until a !OR is seen?
One way to make it unambiguous is to directly attach the operation to the element. This could work:
But, for the question I really asked: which is default? AND or OR? What is the most natural thing that people expect it would be. I said AND, monkey said OR.
I think that’s very clear, but I could live with pretty much anything as long as I knew the rules / format for the request.
Chuckling, sort of like myself and @UltimateRiff having different preferences. Again, I can go either way just as long as I know how the default is set.
That was my feeling as well. OR by default brings in too many tracks and dilutes the whole playlist – but that might be because I intuitively understand the underlying data and thus am not a good end user.
Yep. In this context, there is no difference between tag or genre. Genre MBIDs can be specified with the genre: term. And my proposed way to express this is as follows:
AND should be the default usage. But as soon as any option it’s documented, it’s fine.
I would suggest to allow complex queries, like…
#trip-hop AND (#Electronic OR #Chill)
As far as I have understood your replies, this should be equal to this (?):
‘tag:(trip-hop):and tag:(Electronic Chill):or’
But not sure how it would work as soon as you add more levels. Also support for NOT or negating an operator would be required.
Now, not sure if all that can be translate to Lucene at all. Queries like that are present on mp3Tag, foobar2000, musicbee, beets, etc. In the long term, they would allow to greatly enhance playlist creation.
I would add another operator, which would greatly simplify usage for complex queries. Combinatory Or. i.e. check at least any X tags are matched.
tag:(Electronic Chill Downtempo):orX
tag:(Electronic Chill Downtempo):or2
Which would be equal to
tag:(Electronic Chill) OR tag:(Chill Downtempo) OR tag:(Electronic Downtempo)
Note how that operator can greatly simplify queries as soon as you add +3 values. Imagine trying to match 4 from 5 tags.
Great – I’d love some feedback on this work. Next time you’re in IRC, please PM me your email – I have new popularity datasets to share with you, if you’re interested.
And yes, the equivalence you wrote is correct.
As far as lucene – this isn’t going to get translated to lucene syntax, but into postgres SQL queries – I was just commenting that that syntax is similar.
And I totally see your desire to make these expressions fully boolean logic capable. Once I dove into what would be required to make it all happen (recursive descent parser and serious mental gymnastics of transforming boolean logic into SQL queries) I decided to keep it simple for now. Last.fm only allows listening to one tag for its tag radio (from what I can tell), so this is going far beyond their capabilities.
Our advisors (formerly last.fm staff) have also advised us that tag radio is useful, but artist radio is vastly more important – that is what most people used at last.fm. I am not sure how much people will use full boolean logic for tags, so I opted to have a simple setup as described above. If it turns out to be a hit and people are clamoring for full boolean logic, can implement that then.
Further to this, I think that most people are more used to search engine type parsing where the terms are somehow weighted by the most matches to the earliest terms entered, thus still including an item if not all terms are matched (albeit at a lower ranking in the return list). Sort of a fuzzy combination of AND and OR. I’m not sure this is appropriate or desired (or even feasible) for this application, so I’m happy defaulting to either AND or OR.
Why is someone entering two or more tags or artists?
They wish the radio to be more diverse. If you connect these entries with a logical AND, the result will be the opposite. The radio is less diverse and contains only those few tracks with both tags. With artists it would be close to empty. The default is not so important, if the user has an option to change the behaviour but from my point of view the logical OR connection is the better default.
If a user enters ‘cyberpunk’ + ‘furry’ or ‘united states’ + ‘black metal’ I feel it’s not expected to get completely disparate music - e.g. a track list with half black metal, half music from the united states.
Agree though that AND would have to be supplemented with OR. But surely tracks with all tags would be hitting the sweet spot?
Even if only the first result is united states blackened furry cyberpunk I feel like that’s super powerful. I guess I’m still thinking it should include both AND and OR but with different weightings.
I’m hoping an upcoming feature is to be able to include subgenres then? like if you specify metal with genre:[metal MBID]:subgenres it would also pull in Power Metal, Black Metal, and Blackened Death Metal. I’d imagine this could work if you specify it as a tag too, tag:(metal):subgenres.
I may make a ticket for this tonight, if that’s not in the plan…
edit: one thing @aerozol mentioned when he shared the link with the Discord server is it doesn’t seem to work well if the recordings aren’t properly tagged… I also see this as a fairly major issue, at least until we can add recording tags directly from ListenBrainz (a feature I’ve seen in several of the redesign mockups). perhaps we could later expand the tags it looks for to include releases/release groups?
OK, after much tweaking, testing and rewriting I finally have something that I show off here for some testing. Take a look at the current version of LB-Radio here:
This prompt will play 3 parts from artist “Pretty Lights”, 2 parts from the tag “trip hop” and 1 part from the artist “Morcheeba” with no tracks from similar artists.
This will play 2 parts from tag “deep house” on medium mode, 1 part from tag “metal” on hard mode and 2 parts from artists “Blümchen” on easy mode. And serve for a fair amount of ipod whiplash.
Please take a look and see if you find any bugs or clear improvements that ought to be made. Please keep in mind that this is far from ready to go into production and it intended for community testing. We’ll create a much nicer interface for this later, but right now this is what we’re using to test the underlying tech we’ve created. (without AI, at that!)
Questions, comments? Post them here for the time being. Happy playing!
Ah - now I got it. When entering a prompt like “tag:(deep house):2”, it’s working. “single value” was a bit misleading for me.
Thank you for this “toy”! An interesting way to generate playlists. The similiarity of Glenn Gould, Bob Dylan, and Johnny Cash is something very new to me!