Announcement

Collapse
No announcement yet.

[Announce] Music Similarity DSTM mixer

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by cpd73
    [Edit] I've added code to handle this. See docs/OtherConfig.md
    Thanks.

    I've updated my config.json file to add the the exclusions, as below:

    Code:
    {
     "paths":{
      "db":"M:\\My Music\\MusicSimilarity\\db",
      "local":"M:\\My Music\\FLAC"
      },
     "essentia": {
         "enabled": true,
         "highlevel": false,
         "bpm": 50,
         "loudness": 0.5,
         "filterkey": true,
         "filterattrib": true,
         "weight": 0.0
      },
      "minduration":30,
      "maxduration":1800,
      "excludegenres":[
         "Audiobook","Children's","Language Course","Meditative","Opera","Pronunciation Guide","Vocal","Other"
     ]
    }
    However, when I re-run the analysis, I can't see any difference - i.e. no logging of Excluded Genres or anything like that. As such, as there are still a handful of tracks for which the Essentia analysis fails, it's difficult for me to be sure if it's had an effect or not.

    (BTW - I just refreshed the lib folder again for this - but maybe I needed more?)

    If it's a simple question, I was just wondering what the following logging is about:

    Code:
    2022-01-09 17:54:11 D Numtracks = 30962
    2022-01-09 17:54:14 D Choosing 6 Indie track(s)
    2022-01-09 17:54:14 D Choosing 5 Rock track(s)
    2022-01-09 17:54:14 D Choosing 3 Electronic track(s)
    2022-01-09 17:54:15 D Choosing 3 Pop track(s)
    2022-01-09 17:54:15 D Choosing 2 Soundtrack track(s)
    2022-01-09 17:54:15 D Choosing 1 Classical track(s)
    2022-01-09 17:54:15 D Choosing 1 Progressive Rock track(s)
    2022-01-09 17:54:15 D Choosing 1 Jazz track(s)
    2022-01-09 17:54:16 D Choosing 1 Unknown track(s)
    2022-01-09 17:54:16 D Choosing 1 Folk-Rock track(s)
    2022-01-09 17:54:16 D Choosing 1 Easy Listening track(s)
    2022-01-09 17:54:16 D Choosing 1 Alternative track(s)
    2022-01-09 17:54:16 D Choosing 1 Hip-Hop track(s)
    2022-01-09 17:54:16 D Choosing 1 Folk track(s)
    2022-01-09 17:54:17 D Choosing 1 Christmas track(s)
    2022-01-09 17:54:17 D Choosing 1 Children's;Soundtrack track(s)
    2022-01-09 17:54:17 D Choosing 1 Rock; Soundtrack track(s)
    2022-01-09 17:54:17 D Choosing 1 Ambient track(s)
    2022-01-09 17:54:17 D Choosing 1 None track(s)
    2022-01-09 17:54:18 D Choosing another 968 tracks from DB
    2022-01-09 17:54:18 D Using subset (1000 of 30962) for setmusicstyle (chosen from meta db)
    2022-01-09 17:56:37 I Added 30962 tracks
    It appears to be selecting a sample of my library to determine a style. I'm just curious as to what this is for?
    Last edited by mruddo; 2022-01-09, 18:04.

    Comment


    • #47
      Originally posted by mruddo
      I've updated my config.json file to add the the exclusions, as below:

      Code:
      {
      ...
        "excludegenres":[
           "Audiobook","Children's","Language Course","Meditative","Opera","Pronunciation Guide","Vocal","Other"
       ]
      }
      However, when I re-run the analysis, I can't see any difference - i.e. no logging of Excluded Genres or anything like that.
      I've just tried with:

      Code:
       "excludegenres":["Pop", "Rock"]
      And I see the following during analysis:
      Code:
      2022-01-09 21:28:12 E Failed to analyze ABBA - Gold - Greatest Hits/01 Dancing Queen.mp3 (Excluding genre (Pop))
      Checked the DB, and no "Pop" tracks. (I tried with a subset of just 2 albums). So, for me, it's working.

      Originally posted by mruddo
      If it's a simple question, I was just wondering what the following logging is about:

      Code:
      2022-01-09 17:54:11 D Numtracks = 30962
      2022-01-09 17:54:14 D Choosing 6 Indie track(s)
      2022-01-09 17:54:14 D Choosing 5 Rock track(s)
      ...
      2022-01-09 17:54:18 D Choosing another 968 tracks from DB
      2022-01-09 17:54:18 D Using subset (1000 of 30962) for setmusicstyle (chosen from meta db)
      2022-01-09 17:56:37 I Added 30962 tracks
      Musly has a setjukeboxstyle function that is given a few (e.g. 1000) random tracks. It uses this to help with the similarity score - how exactly I'm not 100% sure, you would need to read the musly docs more, But, I thought (perhaps incorrectly) that rather than just random tracks I should have random tracks from each genre - with the number for a genre dependent upon which percentage of your library it is. You can, however, configure music-similarity to jsut choose random tracks - see docs/OtherConfig.md

      As stated before, this is not an area I know much about - so I really am just throwing things together to see what works.
      Last edited by cpd73; 2022-01-10, 09:21.
      Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

      Comment


      • #48
        Thanks for the info... I'll experiment a little more with exclusions when I can.

        Just an update on mixes though - as a trend I've noticed seems to indicate a bias towards artists at the tail end of the alphabet. My music is stored in folders by Artist then Album. So my analysis database is primarily organized A-Z with with "Various" covering compilations towards the end. (Not sure if the same applies to the Jukebox.)

        What I've noticed is that I'm getting a lot of tracks from the the last few letters. e.g. if I start a mix from...

        Code:
        Lana Del Rey - W, Z, V, W, W
        Tom Petty - W, V, Y, R, W, b
        ABBA - V, V, Y, V, V
        Chvrches - g, T, Z, W, Y
        DMA's - V, W, Y
        Jenny Lewis - W, V, S, V, W
        Ludwig van Beethoven - J, g, V, V, V
        Manic Street Preachers - W, Y
        Rolling Stones - Y, V, Y, b, W
        Weezer - W, V, Y, Y
        Obviously these are just one set of sample mixes - that I just generated while typing this post, but the trend is apparent in most - as I especially noticed a number of albums at with Various artists or Z artists coming up again and again. (I don't have many artists starting with "Z", so it becomes quite obvious.)

        As it's timbre based, the starting letter of the chosen artist should be relevant, but I picked a few random ones that demonstrate a reasonable variety of styles.

        In almost all cases above, "V" is "Various". Interestingly the 'g' and 'b' are unusal in that they're both lower case - so that could be a clue as to any sort being applied to result sets here. Most of my artists are capitalised, but there are a few exceptions.

        Comment


        • #49
          Originally posted by mruddo
          Just an update on mixes though - as a trend I've noticed seems to indicate a bias towards artists at the tail end of the alphabet.
          As stated on the music-similarity github page, Musly has a bug where all songs can get the same score. Hence why I added a --test commandline switch to music-similairty to test the Musly analysis. If this fails it usually just means recreating the jukebox. Passing --repeat will cause the test code to delete the jukebox on failure, recreate, and re-test until OK. This might not be your issue, but is worth checking. The order that the tracks are processed depends on the similarity order from Musly - my code simply iterates the list of tracks returned by Musly and applies some filtering.
          Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

          Comment


          • #50
            I don't think it's that. I've generally been testing the results, and did again just now..

            Code:
            M:\My Music\MusicSimilarity>.\music-similarity\music-similarity.py --log-level INFO --test
            2022-01-10 09:08:11 I Testing musly
            2022-01-10 09:08:15 I Loaded 30962 tracks
            2022-01-10 09:08:15 I Musly returned 50 different similarities for 50 tracks
            Test ended at  9:08:15.88 on 10/01/2022
            I've also just deleted and re-built the Jukebox (by running the test without one), and I still see the same behaviour.

            I'm wondering if it's got something to do with the size of the database now? I did not notice such issues with the smaller sample library, but it's almost as if it's now only selecting from a sub-set of any results.

            Comment


            • #51
              As discussed with @cpd73 It turns out the issue I had was down to my database file not containing all required meta fields, which was adversely impacting the matching and causing the majority of tracks to be disregarded.

              This was likely caused by my use of incorrect parameters when running the analysis script.

              My speculative explanation of the mixing behaviour was that the missing data meant it was unable to identify the best matches, so instead I ended up with a selection from the tail end of the database... but having re-run the analysis to add the missing meta fields, it's back to working well again.

              Comment


              • #52
                Originally posted by cpd73
                I've just tried with:

                Code:
                 "excludegenres":["Pop", "Rock"]
                And I see the following during analysis:
                Code:
                2022-01-09 21:28:12 E Failed to analyze ABBA - Gold - Greatest Hits/01 Dancing Queen.mp3 (Excluding genre (Pop))
                Checked the DB, and no "Pop" tracks. (I tried with a subset of just 2 albums). So, for me, it's working.
                I think in my case it's likely because all the genres I no longer wanted were already in the database - so perhaps it needs to look for any and remove them in some cases?

                That being the case, I tried to do this manually by deleting them from the database. This seemingly worked fine, and when re-running the analysis they were not re-added.

                I do however seem to have corrupted an index doing so:
                Code:
                2022-01-10 17:57:17 D Numtracks = 30500
                2022-01-10 17:57:28 D Choosing 297 Rock track(s)
                2022-01-10 17:57:29 D Choosing 277 Pop track(s)
                2022-01-10 17:57:29 D Choosing 121 Indie track(s)
                2022-01-10 17:57:29 D Choosing 40 Alternative track(s)
                2022-01-10 17:57:29 D Choosing 25 Soundtrack track(s)
                2022-01-10 17:57:29 D Choosing 23 Electronic track(s)
                2022-01-10 17:57:29 D Choosing 19 Folk-Rock track(s)
                2022-01-10 17:57:30 D Choosing 15 Progressive Rock track(s)
                2022-01-10 17:57:30 D Choosing 15 Folk track(s)
                2022-01-10 17:57:30 D Choosing 13 R&B track(s)
                2022-01-10 17:57:30 D Choosing 11 Jazz track(s)
                2022-01-10 17:57:30 D Choosing 10 Trip-Hop track(s)
                2022-01-10 17:57:31 D Choosing 9 Hip-Hop track(s)
                2022-01-10 17:57:31 D Choosing 9 Christmas track(s)
                2022-01-10 17:57:31 D Choosing 9 Dance track(s)
                2022-01-10 17:57:31 D Choosing 8 Rap track(s)
                2022-01-10 17:57:31 D Choosing 6 Country track(s)
                2022-01-10 17:57:31 D Choosing 5 Blues track(s)
                2022-01-10 17:57:32 D Choosing 5 Easy Listening track(s)
                2022-01-10 17:57:32 D Choosing 4 Classical track(s)
                2022-01-10 17:57:32 D Choosing 4 Children's track(s)
                2022-01-10 17:57:32 D Choosing 4 Latin track(s)
                2022-01-10 17:57:32 D Choosing 4 Musical track(s)
                2022-01-10 17:57:32 D Choosing 4 Ambient track(s)
                2022-01-10 17:57:33 D Choosing 4 Children's;Soundtrack track(s)
                2022-01-10 17:57:33 D Choosing 3 Soul track(s)
                2022-01-10 17:57:33 D Choosing 3 Lo-Fi track(s)
                2022-01-10 17:57:33 D Choosing 3 New Age track(s)
                2022-01-10 17:57:33 D Choosing 3 Jazz;Christmas track(s)
                2022-01-10 17:57:33 D Choosing 2 Swing track(s)
                2022-01-10 17:57:34 D Choosing 1 Classical;Children's track(s)
                2022-01-10 17:57:34 D Choosing 1 Punk track(s)
                2022-01-10 17:57:34 D Choosing 1 Techno track(s)
                2022-01-10 17:57:34 D Choosing 1 Dubstep track(s)
                2022-01-10 17:57:34 D Choosing 1 Funk track(s)
                2022-01-10 17:57:35 D Choosing 1 Ethnic track(s)
                2022-01-10 17:57:35 D Choosing 1 Blues;Christmas track(s)
                2022-01-10 17:57:35 D Choosing 1 Indian track(s)
                2022-01-10 17:57:35 D Choosing 1 Pop;Pop track(s)
                2022-01-10 17:57:35 D Choosing 1 Ska track(s)
                2022-01-10 17:57:35 D Choosing 1 Capoeira track(s)
                2022-01-10 17:57:36 D Choosing 1 Acid Jazz track(s)
                2022-01-10 17:57:36 D Choosing 1 Unknown track(s)
                2022-01-10 17:57:36 D Choosing 1 Children's;Pop track(s)
                2022-01-10 17:57:36 D Choosing 1 Soundtrack;Musical track(s)
                2022-01-10 17:57:36 D Choosing 1 Language Course track(s)
                2022-01-10 17:57:36 D Choosing 1 Accompaniment track(s)
                2022-01-10 17:57:37 D Choosing 1 New Wave track(s)
                2022-01-10 17:57:37 D Choosing 1 Rock;Christmas track(s)
                2022-01-10 17:57:37 D Choosing 1 Musical;Soundtrack track(s)
                2022-01-10 17:57:37 D Choosing 1 Metal track(s)
                2022-01-10 17:57:37 D Choosing 1 Country;Christmas track(s)
                2022-01-10 17:57:37 D Choosing 1 Pop;Christmas track(s)
                2022-01-10 17:57:38 D Choosing 1 Children's;Christmas track(s)
                2022-01-10 17:57:38 D Choosing 1 Celtic track(s)
                2022-01-10 17:57:38 D Choosing 1 Bluegrass track(s)
                2022-01-10 17:57:38 D Choosing 1 Rock; Soundtrack track(s)
                2022-01-10 17:57:38 D Choosing 1 Indie;Christmas track(s)
                2022-01-10 17:57:39 D Choosing 1 R&B;Soundtrack track(s)
                2022-01-10 17:57:39 D Choosing 1 Blues;Soundtrack track(s)
                2022-01-10 17:57:39 D Choosing 1 Trance track(s)
                2022-01-10 17:57:39 D Choosing 1 None track(s)
                2022-01-10 17:57:40 D Choosing another 15 tracks from DB
                2022-01-10 17:57:40 D Using subset (1000 of 30500) for setmusicstyle (chosen from meta db)
                Traceback (most recent call last):
                  File "M:\My Music\MusicSimilarity\music-similarity\music-similarity.py", line 33, in <module>
                    analysis.analyse_files(cfg, path, not args.keep_old, args.meta_only, args.force, jukebox_file)
                  File "M:\My Music\MusicSimilarity\music-similarity\lib\analysis.py", line 197, in analyse_files
                    mus.add_tracks(db_tracks, config['musly']['styletracks'], config['musly']['styletracksmethod'], trks_db)
                  File "M:\My Music\MusicSimilarity\music-similarity\lib\musly.py", line 268, in add_tracks
                    smtracks[i] = mtracks[style_tracks[i]]
                IndexError: invalid index
                I suspect that's because I now have index entries for genres and/or tracks that no longer exist... but I'm not sure where. I've dropped and re-created indexes in the db, but no luck yet... Can you provide any pointers please?

                Ta.
                Last edited by mruddo; 2022-01-10, 17:58.

                Comment


                • #53
                  Failed to open libmusly.so

                  I want the high-level analysis that is only available from the Linux-based Essentia. Lacking a Linux system (beyond my music-playing and serving Pis), I am using Windows 10 that has Windows Subsystem for Linux (WSL) installed; WSL allows Windows users to run Linux natively within Windows. Noticing that Craig uses Ubuntu, I chose Ubuntu 20.4 (from the Microsoft Store). So far so good.

                  Next, I configured Ubuntu to mount a network drive and then edited config.json with the paths for music-similarity.

                  I ran the analyse feature and here's the output. Things looks fine until Failed to open Musly shared library. The file is present and executable (shown below).

                  Code:
                  prabbit@system1:/mnt/g/music_cleaning/tools/music-similarity$ ./music-similarity.py --analyse /mnt/f/flac_mp3/lossless/Abba -l DEBUG
                  2022-01-10 12:14:09 D musly.lib set to linux/x86-64/libmusly.so
                  2022-01-10 12:14:09 D essentia.extractor set to /mnt/g/music_cleaning/tools/music-similarity/linux/x86-64/essentia_streaming_extractor_music
                  2022-01-10 12:14:09 D essentia.highlevel set to True
                  2022-01-10 12:14:09 I Found: /mnt/g/music_cleaning/tools/music-similarity/linux/x86-64/essentia_streaming_extractor_music
                  2022-01-10 12:14:09 D Init DB
                  2022-01-10 12:14:09 D Analyse /mnt/f/flac_mp3/lossless/Abba
                  2022-01-10 12:14:09 D Looking for old tracks to remove
                  2022-01-10 12:14:10 D Num old tracks: 0
                  2022-01-10 12:14:10 D Init Musly
                  2022-01-10 12:14:10 E Failed to open Musly shared library (/mnt/g/music_cleaning/tools/music-similarity/linux/x86-64/libmusly.so)!
                  prabbit@system1:/mnt/g/music_cleaning/tools/music-similarity$ cd linux/x86-64/
                  prabbit@system1:/mnt/g/music_cleaning/tools/music-similarity/linux/x86-64$ ls -l
                  total 18576
                  -rwxrwxrwx 1 root root      898 Jan  8 12:16 README.md
                  -rwxrwxrwx 1 root root       88 Jan  8 12:16 config.json
                  -rwxrwxrwx 1 root root 18736912 Jan  8 12:16 essentia_streaming_extractor_music
                  -rwxrwxrwx 1 root root   277616 Jan  8 12:16 libmusly.so
                  Believing that the next step in the process is to have libmusly.so run, I attempted to run libmusly.so directly, with sad results.

                  Code:
                  prabbit@system1:/mnt/g/music_cleaning/tools/music-similarity$ ./linux/x86-64/libmusly.so
                  Segmentation fault
                  Recognizing that this is working for others, anyone have any ideas? (Google has very little helpful information to add.)

                  Comment


                  • #54
                    Originally posted by mruddo
                    I think in my case it's likely because all the genres I no longer wanted were already in the database - so perhaps it needs to look for any and remove them in some cases?
                    No, the genre filtering only happens at analysis time - its used to discard tracks. It will not affect tracks already in the DB.

                    Originally posted by mruddo
                    That being the case, I tried to do this manually by deleting them from the database. This seemingly worked fine, and when re-running the analysis they were not re-added.

                    I do however seem to have corrupted an index doing so:
                    You should not manually remove rows from the DB, this will lead to 'gaps' in the row-IDs, and will break the similarity. If you have removed things manually, then all the row-IDs need to be recalculated. The easiest way would be to move a music file out of your music folder, rescan with music-similarity, move the file back into the music folder, and re-scan again. When music-similarity detects a track has been removed, it copies all of the 'tracks' table to 'tracks_tmp' and then back-again - this causes al row IDs to be recalculated, and then it will recreate the jukebox.
                    Last edited by cpd73; 2022-01-11, 07:21.
                    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                    Comment


                    • #55
                      Originally posted by prabbit
                      I want the high-level analysis that is only available from the Linux-based Essentia. Lacking a Linux system (beyond my music-playing and serving Pis), I am using Windows 10 that has Windows Subsystem for Linux (WSL) installed; WSL allows Windows users to run Linux natively within Windows. Noticing that Craig uses Ubuntu, I chose Ubuntu 20.4 (from the Microsoft Store). So far so good.
                      I use Fedora actually


                      Originally posted by prabbit
                      Believing that the next step in the process is to have libmusly.so run, I attempted to run libmusly.so directly, with sad results.
                      lbmusly is a dynamic library, not an executable. This library is loaded by the python script, it is not executed. However, libmusly also needs the libavcodec, libavformat, etc. libraries. If these are not on your system then the python script will not be able to load libmusly as its dependencies are not found. The easiest way to install these other libraries is just to install the ffmpeg package. This is all mentioned in the linux/INSTALL.md file.
                      Last edited by cpd73; 2022-01-11, 07:21.
                      Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                      Comment


                      • #56
                        Originally posted by cpd73
                        No, the genre filtering only happens at analysis time - its used to discard tracks. It will not affect tracks already in the DB.

                        You should not manually remove rows from the DB, this will lead to 'gaps' in the row-IDs, and will break the similarity. If you have removed things manually, then all the row-IDs need to be recalculated. The easiest way would be to move a music fiel out of your music folder, rescan with music-similarity, move the track back into the music folder, and re-scan again. When music-similarity detects a track has been removed, it copies all of the 'tracks' table to 'tracks_tmp' and then back-again - this causes al row IDs to be recalculated, and the jukebox recreated.
                        Points noted and understood. I've taken that approach to remove the tracks from a backed up db before I trimmed it down... All good again now. Thanks.

                        Comment


                        • #57
                          Originally posted by cpd73
                          This is al mentioned in the linux/INSTALL.md file.
                          After the gentle RTFM (with some minor adjustments for Fedora vs Ubuntu) my files are being analyzed.

                          Comment


                          • #58
                            Originally posted by prabbit
                            After the gentle RTFM (with some minor adjustments for Fedora vs Ubuntu) my files are being analyzed.
                            What adjustments? I'll gladly update the docs...
                            Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                            Comment


                            • #59
                              Originally posted by cpd73
                              What adjustments? I'll gladly update the docs...
                              When I'm back at my computer with my notes, I'll have more details, and these may be user-specific (i.e., me) issues. It had to do with the steps under the Musly heading with "x86-64 Linux build of libmulsy, built on Fedora."

                              I couldn't use yum (Fedora, not Ubuntu), so the "built on Fedora" note was an important clue for me to use in searching (since my Linux experience was 20 years ago with little in between). I wasn't sure if after cloning I was supposed to cd into the cloned directory and then create the build directory. There isn't a step to do that but it seemed like it was necessary? And I stumbled/struggled with cmake and ffmpeg-devel. I ended up downloading and installing ffmpeg (per your hint) using apt. After I did that I tested the analysis on several files. It worked. Now I'm processing my 20k library.

                              Comment


                              • #60
                                Originally posted by prabbit
                                When I'm back at my computer with my notes, I'll have more details, and these may be user-specific (i.e., me) issues. It had to do with the steps under the Musly heading with "x86-64 Linux build of libmulsy, built on Fedora."
                                You don't need to rebuild musly, the supplied library works on Fedora and Ubuntu (I tried in a VM). The only things you should need to do are; install python, python requirements, and ffmpeg - then update config.json
                                Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                                Comment

                                Working...
                                X
                                😀
                                🥰
                                🤢
                                😎
                                😡
                                👍
                                👎