Automatic genre using musicnn

I recenly downloaded musicbranz picard si that i coud update my Plex server that his all my music. Before i tried MBP. I had ran across a very intriguing python module called musicnn. It clamed snaned the audio file to determin the Genre. I couldn’t ever get it to work as development stopped in 2019. Im not that strong in python unfortunately. So two question…How does MBP determine genre? Is it possible to integrate musicnn into MBP?

1 Like

The built-in genre functionality in Picard gets the genres from MusicBrainz genres. But there are also plugins to get genres from e.g. last.fm, wikidata or (the soon to be cancelled) AcousticBrainz.

Yes, I think this would make a nice plugin. But I wouldn’t put my hopes too high in regards of the quality. The AcousticBrainz project was an attempt to use machine learning approaches to determine things like e.g. genre from analysing the audio. It used several different trained models to do so. As I was told it worked ok for some genres, but honestly it was rather useless for the music I tried it with.

UPDATE: Actually packaging this into a single plugin will not be easily doable. It has the typical dependencies defined you’d expect from such a project (tensorflow, numpy and librosa) and all in all that adds nearly 1.6 GB in dependencies that would need to be bundled, some of them platform dependent. Picard’s current plugin system does not really support this well. Also musicnn does not run out of the box due to some version conflict with the dependencies.

3 Likes

@alastairp, @rob You might be interested in this, but maybe you know about these models already. I did not test this much, but tried it on 3 or 4 files I have currently right here, all in the rock genre. What I immediatelly notice is that it does actually tag them with things like “rock”, “alternative”, “guitar”, “indie”, “loud”. The AB models usually failed badly in the rock / metal genres and seem to be heavily biased on electronic music.

3 Likes

Interesting indeed, but I am pretty skeptical of these things now, so I am not really inclined to spend a lot of my time on it. But if the Picard team sees any value in playing with it, I would be very interested in watching this unfold.

3 Likes