Home of the Squeezebox™ & Transporter® network music players.
Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 57
  1. #21
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    343
    So I've compiled musly on macOS 10.15. No errors, some deprecation warnings (libavformat and such...).

    But when I try to run anything Python3 I get
    ./musly-server.py --analyse /Users/defuser/Music/MEDIA/
    Traceback (most recent call last):
    File "./musly-server.py", line 33, in <module>
    mus = musly.Musly(lib)
    File "/Users/defuser/Documents/musly-server-master/lib/musly.py", line 31, in __init__
    ctypes.CDLL(libmusly.replace('libmusly.so', 'libmusly_resample.so'))
    File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
    OSError: dlopen(/usr/local/opt/musly-0.2/lib/libmusly.dylib, 6): Library not loaded: libmusly_resample.dylib
    Referenced from: /usr/local/opt/musly-0.2/lib/libmusly.dylib
    Reason: image not found
    BTW libmusly_resample.dylib and libmusly.dylib are in the same folder.

    My config.json

    Code:
    {
     "libmusly":"/usr/local/opt/musly-0.2/lib/libmusly.dylib",
     "paths":{
      "db":"/Users/defuser/Documents/musly/",
      "musly":"/Users/defuser/Music/MEDIA/",
      "lms":"/Users/defuser/Music/MEDIA/",
      "tmp":"/tmp/"
     },
     "lmsdb":"/Users/defuser/Library/Caches/Squeezebox/library.db",
     "genres":[
      ["Alternative Rock", "Classic Rock", "Folk/Rock", "Hard Rock", "Indie Rock", "Punk Rock", "Rock"],
      ["Dance", "Disco", "Hip-Hop", "Pop", "Pop/Folk", "Pop/Rock", "R&B", "Reggae", "Soul", "Trance"],
      ["Gothic Metal", "Heavy Metal", "Power Metal", "Progressive Metal", "Progressive Rock", "Symphonic Metal", "Symphonic Power Metal"]
     ]
    }
    I hit a wall there. I can only guess... is the lib format (dylib extension etc.) a problem? What's my mistake here?

    I've uploaded the compiled macOS version here.

    Thank you.

  2. #22
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,115
    Quote Originally Posted by afriend View Post
    So I've compiled musly on macOS 10.15. No errors, some deprecation warnings (libavformat and such...).
    Sorry, I don't use macOS - so really can't help much. If/when you get this working, I have moved the LMS side from lms-muslymixer to lms-musicsimilarity - as I've written a music-similarity backend that uses Essentia (see essentia-analyzer and essentia-api). This new mixer can talk to either the Musly or Essentia backend.
    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.

  3. #23
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,115
    Quote Originally Posted by afriend View Post
    Code:
    File "/Users/defuser/Documents/musly-server-master/lib/musly.py", line 31, in __init__
    ctypes.CDLL(libmusly.replace('libmusly.so', 'libmusly_resample.so'))
    Perhaps "libmusly.replace('libmusly.so', 'libmusly_resample.so')" should be "libmusly.replace('libmusly.dylib', 'libmusly_resample.dylib'))" for macOS ??? e.g. line 31 of edit lib/musly.py ??
    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.

  4. #24
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    343
    I had already replaced that part.
    In the end I had to "bake" the absolute path of libmusly_resample.dylib into libmusly.dylib.

    Before I start more tests on my main library may I just ask some questions because I'm really new to this.

    The value (analysis result) for a track in the musly.db is different from the one Roland0's script (LMSmusly-0.1.1) generates. I don't know much about the underlying models used to compute the similarity score. Do you use different settings? Also, could it be that Roland0's script is a bit faster or is yours just more thorough?

    If I put all the paths into the configure.json I just need "-a m" to analyze the music files, right?

    And what does "only updating the metadata database" do as opposed to "-a m"? Just remove dead tracks musly couldn't find in the LMS database?

    About jukebox and LMS/musly startup time: your script seems to (auto-)create a jukebox. Does it use the jukebox automatically? In general, how long does the start of (lms)musly take? I'm only asking because Roland0 said that with a large number of tracks in the database the startup time of lmsmusly would increase significantly.

    And finally, I've notice that "create similarity mix" doesn't show up in the LMS default web UI. Is this by design?

    Thank you.

    P.S.
    If it all works out I'll leave the macOS binaries and some instructions here.

  5. #25
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,115
    Quote Originally Posted by afriend View Post
    The value (analysis result) for a track in the musly.db is different from the one Roland0's script (LMSmusly-0.1.1) generates. I don't know much about the underlying models used to compute the similarity score. Do you use different settings? Also, could it be that Roland0's script is a bit faster or is yours just more thorough?
    Not sure, never used Roland0's script. I used (well copied and modified) Roland0's musly.py which interfaces Python->libmusy.so Musly does not process the whole track, but only a portion. One of the changes I made was how much to analyse - Roland0's is 30seconds, mine 2 minutes. My script also performs concurrent analysis of multiple tracks - Roland0's might do this, I have no idea. Whose is better, I'm not sure - they should be pretty similar. My aim was using Musy for DSTM.

    Quote Originally Posted by afriend View Post
    If I put all the paths into the configure.json I just need "-a m" to analyze the music files, right?
    Yes.

    Quote Originally Posted by afriend View Post
    And what does "only updating the metadata database" do as opposed to "-a m"? Just remove dead tracks musly couldn't find in the LMS database?
    My code does not touch the LMS db, it creates its own SQLite database. Therefore, I wanted a quick way to update this database to reflect and metadata changes in my files. When doing this the script just reads the tags and updates the DB for any changes.

    The script only needs access to the LMS DB if you have CUE files where 1 file has multiple tracks. The script will get the metadata, start, and duration, of each track from LMS. It then uses ffmpeg to create temporary MP3s for each track and have musly anylyse these.

    Quote Originally Posted by afriend View Post
    About jukebox and LMS/musly startup time: your script seems to (auto-)create a jukebox. Does it use the jukebox automatically? In general, how long does the start of (lms)musly take? I'm only asking because Roland0 said that with a large number of tracks in the database the startup time of lmsmusly would increase significantly.
    My script will create an SQLite database file and a Musly jukebox file. If the jukebox file does not exist it will be created - but this can take sometime (around 10mins on an i7 laptop for ~20k tracks). I analyse my files on my laptop, and the copy the SQLite DB and jukebox onto my Pi4 (where LMS runs, and musly-server is also run to provided a backend for LMS).

    Quote Originally Posted by afriend View Post
    And finally, I've notice that "create similarity mix" doesn't show up in the LMS default web UI. Is this by design?
    Nope, not by design. Not sure why its not there, but then I've never created this sort of menu - so I just copied/modifed the one from LMS's Music IP mixer. Its not a feature I really use.

    Quote Originally Posted by afriend View Post
    If it all works out I'll leave the macOS binaries and some instructions here.
    Thanks for trying this. Please let me know if it works, and what (if any) changes needed to be made and I'll update the github page to point to your binaries.

    p.s. Personally I think the Essentia backend provided better mixes, but MuscIP is still better than either. But, it'd be great to have another user's opinion.
    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.

  6. #26
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    1,240
    Quote Originally Posted by cpd73 View Post
    Not sure, never used Roland0's script. I used (well copied and modified) Roland0's musly.py which interfaces Python->libmusy.so Musly does not process the whole track, but only a portion. One of the changes I made was how much to analyse - Roland0's is 30seconds, mine 2 minutes.
    LMSmusly has an option to set the extract length. However, 30sec is the value recommended by musly's developer, and anything >60sec will slow down analysis without any effect, as musly will only use a max of 60sec for the analysis.
    I did some testing with 60sec when I wrote the interface, and didn't notice any improvement.

    Note that if you actually wanted to compare analysis results, you'd have to un-pickle the blob from the database, which will give a c-style float[56] array.
    Given that both musly and the interface to it are identical, I wouldn't bother.
    Various SW: Web Interface | Text Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Ambient Noise Mixer | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  7. #27
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    343
    Quote Originally Posted by cpd73 View Post
    My code does not touch the LMS db, it creates its own SQLite database. Therefore, I wanted a quick way to update this database to reflect and metadata changes in my files. When doing this the script just reads the tags and updates the DB for any changes.
    I keep my music files in a folder hierarchy like artist > album > filename.ext. So I guess if I change the artist name all files below will be deleted from the db and would have to be analyzed again. Not that this will happen a lot, just curious. BTW does it fill the metadata at the end because a first look at the musly.db (in progress) shows the relative path (files) and the values (vals) but the other metadata columns are still empty.

    Quote Originally Posted by cpd73 View Post
    The script only needs access to the LMS DB if you have CUE files where 1 file has multiple tracks.
    Good to know. So if I don't have any cue files this path is never called/checked and I don't even have to set it in config.json, right?

    Could you add os detection to lib/musly.py so manual editing of line 31 won't be necessary?
    For macOS the extension is dylib (libmusly.dylib and libmusly_resample.dylib).

    The latest macOS 10.15 (for which I've compiled the binaries) would give you Darwin:
    Code:
    >>> import os
    >>> os.name
    'posix'
    >>> import platform
    >>> platform.system()
    'Darwin'
    >>> platform.release()
    '19.6.0'
    And how do you feel about adding/moving these settings from app.py to config.json: DEFAULT_TRACKS_TO_RETURN, MIN_TRACKS_TO_RETURN, MAX_TRACKS_TO_RETURN, NUM_PREV_TRACKS_FILTER_ARTIST, NUM_PREV_TRACKS_FILTER_ALBUM, NUM_SIMILAR_TRACKS_FACTOR, SHUFFLE_FACTOR ? Might be nice to have all user configurable settings in one place.

    About create similarity mix: when I call that from a track's context menu/song details page it's using only this one track as a seed, right? In other words, I could just take a look at which tracks musly-server thinks are similar to this track.

    I've started the analysis. Since you commit after 500 tracks maybe you could a small info message stating the total number of tracks processed so far. Would make it easier to track progress.

    Anyway, I just wanted to thank you for taking the time to explain things to me and for musly-server. And a thank you to Roland0 too. Quite curious if this is going to work out on macOS and if it's going to make listening to my music more interesting. As far as Essentia is concerned, I think one of you mentioned that the analysis part was a lot slower than musly so I guess I'll never get to use that one because my hardware is quite old and slow.

  8. #28
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,115
    Quote Originally Posted by afriend View Post
    BTW does it fill the metadata at the end because a first look at the musly.db (in progress) shows the relative path (files) and the values (vals) but the other metadata columns are still empty.
    Yeah, meta-data is saved at the end.

    Quote Originally Posted by afriend View Post
    Good to know. So if I don't have any cue files this path is never called/checked and I don't even have to set it in config.json, right?
    Correct.

    Quote Originally Posted by afriend View Post
    Could you add os detection to lib/musly.py so manual editing of line 31 won't be necessary?
    Create a pull request on github, or send me your modified file.

    Quote Originally Posted by afriend View Post
    And how do you feel about adding/moving these settings from app.py to config.json: DEFAULT_TRACKS_TO_RETURN, MIN_TRACKS_TO_RETURN, MAX_TRACKS_TO_RETURN, NUM_PREV_TRACKS_FILTER_ARTIST, NUM_PREV_TRACKS_FILTER_ALBUM, NUM_SIMILAR_TRACKS_FACTOR, SHUFFLE_FACTOR ? Might be nice to have all user configurable settings in one place.
    Can do, but do they need to be configurable? Not sure I really see the point. NUM_PREV_TRACKS_FILTER_ARTIST and NUM_PREV_TRACKS_FILTER_ALBUM perhaps - but then if that was the case the I'd add them to the API, and allow setting of these in lms-musicsimilarity. I'm wary of having things over-configurable as that then creates extra scenarios for things to go wrong!

    But, let me know how the mixer works for you - as there is no point adding extra features if no one is actively using it!

    Quote Originally Posted by afriend View Post
    About create similarity mix: when I call that from a track's context menu/song details page it's using only this one track as a seed, right? In other words, I could just take a look at which tracks musly-server thinks are similar to this track.
    Yeah, for a track it just sends that one.

    I've started the analysis. Since you commit after 500 tracks maybe you could a small info message stating the total number of tracks processed so far. Would make it easier to track progress.

    Quote Originally Posted by afriend View Post
    Anyway, I just wanted to thank you for taking the time to explain things to me and for musly-server. And a thank you to Roland0 too. Quite curious if this is going to work out on macOS and if it's going to make listening to my music more interesting. As far as Essentia is concerned, I think one of you mentioned that the analysis part was a lot slower than musly so I guess I'll never get to use that one because my hardware is quite old and slow.
    As a rough estimate, Essentia is about 14 times slower. Musly took around 1hr to analyse ~20k tracks, and Essentia took about 14hrs. Both still faster than MusicIP.
    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.

  9. #29
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    343
    Created the OS PR.

    I see you've changed to extraction length to 30s. Will it distort the result of my ongoing analysis by much or at all if I stop the process now, change the value from 60s to 30s and then continue? Would love to save some time.

    And I was actually thinking mostly of NUM_PREV_TRACKS_FILTER_ARTIST and NUM_PREV_TRACKS_FILTER_ALBUM. Don't even know what the SHUFFLE_FACTOR is for...

    I forgot ask one thing though: many of my artist names are like "artistname (feat. anotherartist)" and some albums are like "albumname [expanded edition]". Is it save to include characters like "()[]" in the ignore part (config.json) or will this break a regex condition somewhere?

    Anyway, I'll report back when I've had some time to use musly/music-sim.

    Thanks.

  10. #30
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,115
    Quote Originally Posted by afriend View Post
    Created the OS PR.
    Thanks, merged.

    Quote Originally Posted by afriend View Post
    I see you've changed to extraction length to 30s. Will it distort the result of my ongoing analysis by much or at all if I stop the process now, change the value from 60s to 30s and then continue? Would love to save some time.
    To be honest, no idea. However, for me, even at the previous 2mins the analyis time was very fast - ~20k tracks/hour.

    Quote Originally Posted by afriend View Post
    And I was actually thinking mostly of NUM_PREV_TRACKS_FILTER_ARTIST and NUM_PREV_TRACKS_FILTER_ALBUM.
    I'll think about adding these, as I also have a MusicIP mixer where they could be added as well. I see no harm in making them configurable.

    Quote Originally Posted by afriend View Post
    I forgot ask one thing though: many of my artist names are like "artistname (feat. anotherartist)" and some albums are like "albumname [expanded edition]". Is it save to include characters like "()[]" in the ignore part (config.json) or will this break a regex condition somewhere?
    No regexes When meta-data is read back from the DB it is 'normalised' - brackets removed, soem strings removed, lowercased, etc. Just to try and help with mis-matched tags.
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •