Announce: Musly DSTM Mixer (mix by similarity)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cpd73
    Senior Member
    • Mar 2017
    • 5020

    Announce: Musly DSTM Mixer (mix by similarity)

    This is a DSTM mixer that uses Musly to obtain 'similar' tracks to 5 seed tracks. I started this plugin as MusicIP takes a long time to analyse files (and is closed source), whereas Musly is much faster (and open source) - ~20k tracks took about 50 minutes to analyse on a 5 year old i7 laptop with an SSD (as opposed to around 70hrs for MusicIP). However, in my opinion, the mixes are nowhere near as good – and a lot of tracks need to be filtered out due to genre, matching artist from seed tracks, etc. Still, I’ve made this release in case others are interested. The Musly analyser uses some code taken from Roland0’s LMS-Musly plugin.

    There are 2 parts to this plugin:
    1. The DSTM plugin, which is a standard LMS Plugin - https://github.com/CDrummond/lms-muslymixer
    2. A python script (musly-server) used to analyse music tracks, create a 'similarity' database, and provide access to query track similarity via a simple HTTP API - https://github.com/CDrummond/musly-server

    To run the 'musly-server' script you will need to build the musly library itself - my github repo has precompiled libraries for Fedora32 and Raspbian. You might also be able to use one of the binaries from Roland0’s LMS-Musly plugin

    Files are analysed by calling:
    Code:
    musyl-server.py --analyse <path to music>
    Once music has been analysed, the API server can then be started:
    Code:
    musyl-server.py
    Please refer to https://github.com/CDrummond/musly-server for more details. This server needs to be running before the DSTM mixer can create a mix. A systemd service is provided.

    The DSTM plugin can be installed by using a release ZIP file from github, or by adding my repo file to LMS.
    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.
  • slartibartfast
    Senior Member
    • Jan 2010
    • 13478

    #2
    Originally posted by cpd73
    This is a DSTM mixer that uses Musly to obtain 'similar' tracks to 5 seed tracks. I started this plugin as MusicIP takes a long time to analyse files (and is closed source), whereas Musly is much faster (and open source) - ~20k tracks took about 50 minutes to analyse on a 5 year old i7 laptop with an SSD (as opposed to around 70hrs for MusicIP). However, in my opinion, the mixes are nowhere near as good – and a lot of tracks need to be filtered out due to genre, matching artist from seed tracks, etc. Still, I’ve made this release in case others are interested. The Musly analyser uses some code taken from Roland0’s LMS-Musly plugin.

    There are 2 parts to this plugin:
    1. The DSTM plugin, which is a standard LMS Plugin - https://github.com/CDrummond/lms-muslymixer
    2. A python script (musly-server) used to analyse music tracks, create a 'similarity' database, and provide access to query track similarity via a simple HTTP API - https://github.com/CDrummond/musly-server

    To run the 'musly-server' script you will need to build the musly library itself - my github repo has precompiled libraries for Fedora32 and Raspbian. You might also be able to use one of the binaries from Roland0’s LMS-Musly plugin

    Files are analysed by calling:
    Code:
    musyl-server.py --analyse
    Once music has been analysed, the API server can then be started:
    Code:
    musyl-server.py
    Please refer to https://github.com/CDrummond/musly-server for more details. This server needs to be running before the DSTM mixer can create a mix. A systemd service is provided.

    The DSTM plugin can be installed by using a release ZIP file from github, or by adding my repo file to LMS.
    I was hoping this was going to be your cut down MusicIP plugin for DSTM [emoji3]. Is that close to release?

    Edit. Never mind I spoke too soon [emoji3]

    Sent from my Pixel 3a using Tapatalk
    Last edited by slartibartfast; 2020-08-06, 07:48.
    Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
    Bedroom: Radio
    Bathroom: Radio

    Comment

    • bakker_be
      Senior Member
      • May 2009
      • 1037

      #3
      Will test this one as well
      Main System: Marantz SR-5015 + Adam Audio T8V + Teufel Ultima 20 Mk 3 + BK Monolith+ FF + Lenovo T560 + Kodi + LG OLED65B26LA + UP-Board running Daphile
      Kitchen: Touch + Ikea ENEBY 30
      Home-Office: SqueezeLite-X + Topping DX3 Pro + NAD 312 + TMA Premium 905

      Comment

      • bakker_be
        Senior Member
        • May 2009
        • 1037

        #4
        Hmmm, running into a bit of bother with the musly server ...
        Code:
        bart@ubuntu_t540:~/musly-server$ ./musly-server.py -l DEBUG --analyse /mnt/music
        Traceback (most recent call last):
          File "./musly-server.py", line 13, in <module>
            from lib import app, config, metadata_db, musly, analysis
        ImportError: cannot import name 'app'
        You'll see analysis has been moved to the end of the import line. I did that to see if it was that file specifically or the import in itself. OS is Ubuntu 18.04 LTS Server.
        Main System: Marantz SR-5015 + Adam Audio T8V + Teufel Ultima 20 Mk 3 + BK Monolith+ FF + Lenovo T560 + Kodi + LG OLED65B26LA + UP-Board running Daphile
        Kitchen: Touch + Ikea ENEBY 30
        Home-Office: SqueezeLite-X + Topping DX3 Pro + NAD 312 + TMA Premium 905

        Comment

        • cpd73
          Senior Member
          • Mar 2017
          • 5020

          #5
          Originally posted by bakker_be
          Hmmm, running into a bit of bother with the musly server ...
          Code:
          bart@ubuntu_t540:~/musly-server$ ./musly-server.py -l DEBUG --analyse /mnt/music
          Traceback (most recent call last):
            File "./musly-server.py", line 13, in <module>
              from lib import app, config, metadata_db, musly, analysis
          ImportError: cannot import name 'app'
          You'll see analysis has been moved to the end of the import line. I did that to see if it was that file specifically or the import in itself. OS is Ubuntu 18.04 LTS Server.
          Odd. I don't use Ubuntu, but Fedora32 (I used Ubuntu for years, but switched due to 'snap' apps). Which version of python3? Fedora32 has 3.8.5, and Raspbian (which also works for me) has 3.7.3

          Does "python3 ./musly-server.py -l DEBUG --analyse /mnt/music/" Work???
          Last edited by cpd73; 2020-08-14, 12:13.
          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

          • bakker_be
            Senior Member
            • May 2009
            • 1037

            #6
            Originally posted by cpd73
            Odd. I don't use Ubuntu, but Fedora32 (I used Ubuntu for years, but switched due to 'snap' apps). Which version of python3? Fedora32 has 3.8.5, and Raspbian (which also works for me) has 3.7.3

            Does "python3 ./musly-server.py -l DEBUG --analyse /mnt/music/" Work???
            This is what apt-get tells me when i want to install python3:
            Code:
            bart@ubuntu_t540:~/musly-server$ sudo apt-get install python3
            [sudo] password for bart:
            Reading package lists... Done
            Building dependency tree
            Reading state information... Done
            python3 is already the newest version (3.6.7-1~18.04).
            0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
            python3 ./musly-server.py -l DEBUG --analyse /mnt/music gives the same error, I'll look into getting a >3.7 python release ...

            EDIT: I'm now on 3.8.5, thanks to a PPA, it's not present in the default repositories, and I still have the same error ...
            Last edited by bakker_be; 2020-08-14, 18:21.
            Main System: Marantz SR-5015 + Adam Audio T8V + Teufel Ultima 20 Mk 3 + BK Monolith+ FF + Lenovo T560 + Kodi + LG OLED65B26LA + UP-Board running Daphile
            Kitchen: Touch + Ikea ENEBY 30
            Home-Office: SqueezeLite-X + Topping DX3 Pro + NAD 312 + TMA Premium 905

            Comment

            • cpd73
              Senior Member
              • Mar 2017
              • 5020

              #7
              Originally posted by bakker_be
              EDIT: I'm now on 3.8.5, thanks to a PPA, it's not present in the default repositories, and I still have the same error ...
              Hmm, OK I'll see what I can do - but I'm not really a python coder.
              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

              • cpd73
                Senior Member
                • Mar 2017
                • 5020

                #8
                Originally posted by bakker_be
                Hmmm, running into a bit of bother with the musly server ...
                Code:
                bart@ubuntu_t540:~/musly-server$ ./musly-server.py -l DEBUG --analyse /mnt/music
                Traceback (most recent call last):
                  File "./musly-server.py", line 13, in <module>
                    from lib import app, config, metadata_db, musly, analysis
                ImportError: cannot import name 'app'
                You'll see analysis has been moved to the end of the import line. I did that to see if it was that file specifically or the import in itself. OS is Ubuntu 18.04 LTS Server.
                How about if you change the start of 'musly-server.py' to be:

                Code:
                import sys
                import os
                sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib'))
                
                import argparse
                import logging
                from lib import analysis, app, config, metadata_db, musly
                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

                • cpd73
                  Senior Member
                  • Mar 2017
                  • 5020

                  #9
                  Originally posted by bakker_be
                  Hmmm, running into a bit of bother with the musly server ...
                  Code:
                  bart@ubuntu_t540:~/musly-server$ ./musly-server.py -l DEBUG --analyse /mnt/music
                  Traceback (most recent call last):
                    File "./musly-server.py", line 13, in <module>
                      from lib import app, config, metadata_db, musly, analysis
                  ImportError: cannot import name 'app'
                  You'll see analysis has been moved to the end of the import line. I did that to see if it was that file specifically or the import in itself. OS is Ubuntu 18.04 LTS Server.
                  Ah, is it just 'app' that has the error? If so what if you rename app.py to (e.g.) muslyapp.py and use "from lib import muslyapp, config, metadata_db, musly, analysis" ???
                  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

                  • bakker_be
                    Senior Member
                    • May 2009
                    • 1037

                    #10
                    Originally posted by cpd73
                    Ah, is it just 'app' that has the error? If so what if you rename app.py to (e.g.) muslyapp.py and use "from lib import muslyapp, config, metadata_db, musly, analysis" ???
                    It's not only app. Initially analysis was first in the line of imports (you had it alphabetically, structured thinking, I like that), so to verify if it was something with analysis I moved it to the end of the line. This shifted focus to app, as it is now first in line, so I'm guessing it's something with the import ...
                    I'll try your modification suggestion from this and the previous post later today when I'm in front of a PC with easy access to the LMS machine where all this resides.

                    EDIT: I first modified the code as you suggested. This resolve the issue. I've then changed the names of the files (and modified the musly-server.py accordingly of course), still no luck
                    Last edited by bakker_be; 2020-08-15, 12:11.
                    Main System: Marantz SR-5015 + Adam Audio T8V + Teufel Ultima 20 Mk 3 + BK Monolith+ FF + Lenovo T560 + Kodi + LG OLED65B26LA + UP-Board running Daphile
                    Kitchen: Touch + Ikea ENEBY 30
                    Home-Office: SqueezeLite-X + Topping DX3 Pro + NAD 312 + TMA Premium 905

                    Comment

                    • cpd73
                      Senior Member
                      • Mar 2017
                      • 5020

                      #11
                      Originally posted by bakker_be
                      EDIT: I first modified the code as you suggested. This resolve the issue. I've then changed the names of the files (and modified the musly-server.py accordingly of course), still no luck
                      So, the first (path) mod works? If so I'll update the code.
                      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

                      • bakker_be
                        Senior Member
                        • May 2009
                        • 1037

                        #12
                        Originally posted by cpd73
                        So, the first (path) mod works? If so I'll update the code.
                        Oh damn, no ... Stupid typo, should've been this DIDN'T resolve the issue!!!
                        Main System: Marantz SR-5015 + Adam Audio T8V + Teufel Ultima 20 Mk 3 + BK Monolith+ FF + Lenovo T560 + Kodi + LG OLED65B26LA + UP-Board running Daphile
                        Kitchen: Touch + Ikea ENEBY 30
                        Home-Office: SqueezeLite-X + Topping DX3 Pro + NAD 312 + TMA Premium 905

                        Comment

                        • cpd73
                          Senior Member
                          • Mar 2017
                          • 5020

                          #13
                          Originally posted by bakker_be
                          Oh damn, no ... Stupid typo, should've been this DIDN'T resolve the issue!!!
                          OK. I'm creating an Ubuntu 18.04 VM so will check with that.
                          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

                          • cpd73
                            Senior Member
                            • Mar 2017
                            • 5020

                            #14
                            Originally posted by cpd73
                            OK. I'm creating an Ubuntu 18.04 VM so will check with that.
                            Something is broken on your 18.04 install. I've just created an 18.04VM, and unzipped the 0.0.1 release - this works. I hacked the musly.py file as I have not built musly, so removed all the main functionality. Still, musly-server.py starts just fine. Very odd.
                            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

                            • bakker_be
                              Senior Member
                              • May 2009
                              • 1037

                              #15
                              Originally posted by cpd73
                              Something is broken on your 18.04 install. I've just created an 18.04VM, and unzipped the 0.0.1 release - this works. I hacked the musly.py file as I have not built musly, so removed all the main functionality. Still, musly-server.py starts just fine. Very odd.
                              OK, I'll try and find out what's going on ...
                              Main System: Marantz SR-5015 + Adam Audio T8V + Teufel Ultima 20 Mk 3 + BK Monolith+ FF + Lenovo T560 + Kodi + LG OLED65B26LA + UP-Board running Daphile
                              Kitchen: Touch + Ikea ENEBY 30
                              Home-Office: SqueezeLite-X + Topping DX3 Pro + NAD 312 + TMA Premium 905

                              Comment

                              Working...