Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Search-by-Distance-SMP (Read 25758 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Search-by-Distance-SMP

An implementation of Music-Graph for foobar2000 using Spider Monkey Panel, which creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.


Features
Creates playlists using high-level data from tracks similar to the currently selected one according to genre, style, key, etc. When their score is over 'scoreFilter', then they are included in the final pool. After all tracks have been evaluated and the final pool is complete, some of them are chosen to populate the playlist. You can choose whether this final selection is done according to score, randomly chosen, etc. All settings are configurable on the properties panel (or set in the files when called using buttons, etc.)

Take a look at the descriptions of the properties panel to check how the variables work. These are the weight/tags pairs checked by default:
X

There are 2 custom tags which can be set by the user too:
X

Any Weight/tags pair can be remapped and/or merged (sep. by comma). For example, linking genreWeight to 2 different genre tags on your files:
X

Some weight/tags pairs can be linked to TitleFormat Expr. Use tag names instead of TF expressions when possible (+ performance). For example, see dateWeight: TF is used to have the same results for tracks with YYYY-MM tags or YYYY tags.
X

Genre and Style tags (or their remapped values) can be globally filtered. See 'genreStyleFilter'. Case sensitive. For example, when comparing genre values from track A to track B, 'Soundtrack' and 'Radio Program' values are omitted:
  • genreStyleFilter: Soundtrack,Radio Program

There are 3 methods to calc similarity: WEIGHT, GRAPH and DYNGENRE.
  • WEIGHT: -> Score
        Uses genreWeight, styleWeight, moodWeight, keyWeight, dateWeight, dateRange, bpmWeight, bpmRange, composerWeight, customStrWeight, customNumWeight + scoreFilter
        Calculates similarity by scoring according to the tags. Similarity is calculated by simple string matching ('Rock' != 'Soul') and ranges for numeric tags. This means some coherence in tags is needed to make it work, and the script only works with high level data (tags) which should havebeen added to files previously using manual or automatic methods (like MusicBrainz Picard, see note at bottom).
  • GRAPH: -> Score + Distance
        Same than WEIGHT + max_graph_distance
        Apart from scoring, it compares the genre/styles tags set to the ones of the reference track using a graph and calculating their min. mean distance. Minimum mean distance is done considering (A,B,D) set matches (A,B,C) at 2 points (0 distance). So we only need to find the nearest pointfrom (A,B,D) to (C) which will be x. Then we calculate the mean distance dividing by the number of points of the reference track : (0 + 0 + x)/3.
        Imagine Google maps for genre/styles, and looking for the distance from Rock to Jazz for ex. 'max_graph_distance' sets the max distance allowed, so every track with genre/styles farther than that value will not be included in the final pool. Note this is totally different to simple string matching, so 'Acid Rock' may be similar to 'Psychedelic Rock' even if they are totally different tag values (or strings).
        This method is pretty computational intensive, we are drawing a map with all known genres/styles and calculating the shortest path between the reference track and all the tracks from the library (after some basic filtering). Somewhere between 2 and 5 secs for 40 K tracks. For a complete description of how it works check: 'helpers/music_graph_descriptors_xxx.js'. And to see the map rendered in your browser like a map check: 'Draw Graph.html'
  • DYNGENRE: -> Score
        Same than WEIGHT + dyngenreWeight
        Uses a simplification of the GRAPH method. Let's say we assign a number to every "big" cluster of points on the music graph, then we can simply put any genre/style point into any of those clusters and give them a value. So 'Rock' is linked to 3, the same than 'Roots Rock' or 'Rock & Roll'.It's a more complex method than WEIGHT, but less than GRAPH, which allows cross-linking between different genres breaking from string matching.
        For a complete description of how it works check: 'helpers/dyngenre_map_xxx.js'

Other features
  • The pool can be filtered with a flobal forced query (for example to always exclude live tracks).
  • The final selection can be choosen from the pool following 4 methods.
    • By score.
    • By probability.
    • Randomly.
    • Using harmonic mixing.
  • The final selection (aka playlist) can be sorted following 3 methods:
    • Randomly.
    • Following the order the tracks were chosen from the pool.
    • Scattering instrumentals: Intercalate instrumental tracks breaking clusters if possible.
  • Recursive playlist creation (where output tracks are used as new references, and so on).
  • Influences and anti-influences playlists.
  • There are some custom buttons which may be set according to user preferences, even its own name: 'buttons_search_bydistance_customizable.js'.


Note about genre/styles
GRAPH method doesn't care whether "Rock" is a genre or a style but the scoring part does! Both values are considered points without any distinction. Genre weight is related to genres, style weight is related to styles.... But there is a workaround, let's say you only use genre tags (and put all values together there). Then set style weight to zero. It will just check genre tags and the graph part will work the same anyway.

Note about GRAPH/DYNGENRE exclusions
Apart from the global filter (which applies to genre/style string matching for scoring purpose), there is another filtering done when mapping genres/styles to the graph or their associated static values. See 'map_distance_exclusions' at 'helpers/music_graph_descriptors_xxx.js'.

It includes those genre/style tags which are not related to an specific musical genre. For ex. "Acoustic" which could be applied to any genre. They are filtered because they have no representation on the graph, not being a real genre/style but a musical characteristic of any musical composition. Therefore, they are useful for similarity scoring purposes but not for the graph. That's why we don't use the global filter for them.

This second filtering stage is not really needed, but it greatly speedups the calculations if you have tons of files with these tags! In other words, any tag not included in 'helpers/music_graph_descriptors_xxx.js' as part of the graph will be omitted for distance calcs, but you save time if you add it manually to the exclusions (otherwise the entire graph will be visited trying to find a match).

Note about editing 'helpers/music_graph_descriptors_xxx.js' or user file
Instead of editing the main file, you can add any edit to an user set file named 'helpers/music_graph_descriptors_xxx_user.js'. Check sample for more info. It's irrelevant whether you add your changes to the original file or the user's one but note on future script updates the main file may be updated too. That means you will need to manually merge the changes from the update with your own ones, if you want them. That's the only "problem" editing the main one.

Both the html and foobar scripts will use any setting on the user file (as if it were in the main file), so there is no other difference. Anything at this doc which points to 'helpers/music_graph_descriptors_xxx.js' applies the same to 'helpers/music_graph_descriptors_xxx_user.js'.

Also integrates
 1. Music-Graph: An open source graph representation of most genres and styles found on popular, classical and folk music.
 2. Camelot-Wheel-Notation: Javascript implementation of the Camelot Wheel, ready to use "harmonic mixing" rules and translations for standard key notations.


Other implementations
 1. Playlist-Tools-SMP: Offers different pre-defefined examples for intelligent playlist creation.


Installation
Copy all files from the zip into YOUR_FOOBAR_PROFILE_PATH\scripts\SMP\xxx-scripts
Any other path WILL NOT work without editing the scripts. (see images_Installation_*jpg)
For ex: mine is c:\Users\xxx\AppData\Roaming\foobar2000\scripts\SMP\xxx-scripts...
For portable installations >= 1.6: .\foobar2000\profile\scripts\SMP\xxx-scripts...
For portable installations <= 1.5: .\foobar2000\scripts\SMP\xxx-scripts...
Then load any button script into a SMP panel within foobar.

Download latest release (or nightly releases) at github:
https://github.com/regorxxx/Search-by-Distance-SMP


Re: Search-by-Distance-SMP

Reply #2
Even though I haven't quite figured this tool out yet, it reminds me of the following helpful tools:

https://www.music-map.com/

https://musicmachinery.com/2009/05/31/building-a-music-map/

 :) 

They are somewhat similar ideas.
Although they are based on artist similarity (this one is about genre/styles similarities), so they are limited to an specific corpus of music -artists- (mainly focused on western music). Also to be up to date, they require an infinite amount of constant work. New artists appear each day.  On the other hand, genres and styles are more or less static within a given period.

A map more closely related would be this one:
https://musicmap.info/

Other difference is the open source nature of the data. And finally, the most important, this is meant to be used offline with real use-cases within foobar (I provide some buttons to create intelligent playlists for example). Those maps are fine to discover new artists you may like, or being sent to youtube videos on the browser, but that's all. You can not create playlist or do anything usable with those maps in your pc or your own software and don't work at all offline.

Re: Search-by-Distance-SMP

Reply #3
All of your github script looks very cool.

I wonder if you think there's any possibility that they work in linux running foobar with wine.

Because I found some problems but I know that there are scripts that depend on windows activeXobjects that doesn't work in wine at all and I'm not gonna waste your time.


Re: Search-by-Distance-SMP

Reply #4
I find pretty much all ActiveX objects work fine wine WINE with the exception of trying to use WshShell.RegRead to get the DPI from the registry. As I mentioned the other day, the main issue you'll always have is lack of internet connectivity to certain websites that require certain levels of TLS support.

Offline scripts should be fine.

WilB's library tree works without mods
Br3tts playlist and Smooth Browser work without mods
All the scripts in the SMP complete folder work with change to one line of code on js\helpers.js line 629. Replace this

const DPI = WshShell.RegRead('HKCU\\Control Panel\\Desktop\\WindowMetrics\\AppliedDPI');

with

const DPI = 96;

Re: Search-by-Distance-SMP

Reply #5
I find pretty much all ActiveX objects work fine wine WINE with the exception of trying to use WshShell.RegRead to get the DPI from the registry. As I mentioned the other day, the main issue you'll always have is lack of internet connectivity to certain websites that require certain levels of TLS support.

Offline scripts should be fine.

WilB's library tree works without mods
Br3tts playlist and Smooth Browser work without mods
All the scripts in the SMP complete folder work with change to one line of code on js\helpers.js line 629. Replace this

const DPI = WshShell.RegRead('HKCU\\Control Panel\\Desktop\\WindowMetrics\\AppliedDPI');

with

const DPI = 96;

For DPI error I'm adding a reg key with regedit   . Its not strange that they didn't found it, there is not such key ;) After that I don't need to modify the scripts

Wsh57 is needed to open links of musicbrainz, similar artist etc

but i found others like crash when scripts are trying to make copy paste operations. (in library tree and Biography) so before get too excited i prefer ask first.

Because this scripts seems complex and I have a lot of doubts about how to even put them in work


Re: Search-by-Distance-SMP

Reply #7
Copy/paste works for me. I guess that's because I'm using a 32bit prefix with all this nonsense installed via winetricks...

sh winetricks gdiplus_winxp wsh57 fontsmooth=rgb msscript ie8

Then maybe you can help me.

In the github page there is a lot of projects. I download all and unzip in the folder xxx the instruction said.

A lot of files asked overwrite so i do overwrite

Now i'm start to doubt. There's a lot of scripts.I thought that the ones i must to use are the ones in buttons (mostly for the pictures).

But when I try to load it in a panel the say something about g theme.

Whit the map I can get a little futher, the panel load and i can see a map (but fuzzy with vertical lines of yellow) and when I select an artist with the locale last.fm tag a point is shown in the map that let me make a playlist with the same country, etc.

But when I try the integration with Biography it said that is not in the path.

Any advice?

Re: Search-by-Distance-SMP

Reply #8
For the theme error, you'll need to download a windows theme (.msstyles file) and install it via winecfg.

edit: quick and dirty google...

https://askubuntu.com/questions/219791/improve-gui-appearance-of-wine-applications
http://www.mediafire.com/download/dnzzmnebm6v/luna.rar <- theme file

Ask regor about everything else. I've have zero knowledge/interest in these scripts.

Re: Search-by-Distance-SMP

Reply #9
I get a "buttonCoordinates is undefined" error. Total newbie here, what am I doing wrong?
NEVERMIND, GOT IT


Re: Search-by-Distance-SMP

Reply #11
Copy/paste works for me. I guess that's because I'm using a 32bit prefix with all this nonsense installed via winetricks...

sh winetricks gdiplus_winxp wsh57 fontsmooth=rgb msscript ie8

Then maybe you can help me.

In the github page there is a lot of projects. I download all and unzip in the folder xxx the instruction said.

A lot of files asked overwrite so i do overwrite

Now i'm start to doubt. There's a lot of scripts.I thought that the ones i must to use are the ones in buttons (mostly for the pictures).

But when I try to load it in a panel the say something about g theme.

Whit the map I can get a little futher, the panel load and i can see a map (but fuzzy with vertical lines of yellow) and when I select an artist with the locale last.fm tag a point is shown in the map that let me make a playlist with the same country, etc.

But when I try the integration with Biography it said that is not in the path.

Any advice?

The scripts can be used along other utilities or as standalone panels. For regular users, standalone panels would be preferred so yes... use the buttons. All the threads and the github readme point to the relevant buttons you need.

Also note that the button named "buttons_playlist_tools_menu" contains these utilities along many more in the form of a menu. I simply provide different ways to integrate them: standalone buttons, merged bars, menu or the bare-bone script...

If you make it work on linux, I would really appreciate if you compile the steps so I can add them to the readmes for other users.

About the map, please write in the relevant thread. Although again, that seems a linux related problem. You can manually install the mod anyway by yourself (if you have the script installed, you must edit the file and "include" the mod file on helpers), so I don't see a problem (the automatic integration can not work on every system by design).

Re: Search-by-Distance-SMP

Reply #12
Even though I haven't quite figured this tool out yet, it reminds me of the following helpful tools:

They are somewhat similar ideas.
Although they are based on artist similarity (this one is about genre/styles similarities), so they are limited to an specific corpus of music -artists- (mainly focused on western music). Also to be up to date, they require an infinite amount of constant work. New artists appear each day.  On the other hand, genres and styles are more or less static within a given period.


Yes good. Thank you for the detailed explanations. The map of relationships between performers that I gave as an example would work offline if it drew on its own library. It could show existing performers on the one hand, and those that are not yet available in the library. But admittedly this idea is a bit banal. :-)

Re: Search-by-Distance-SMP

Reply #13
Even though I haven't quite figured this tool out yet, it reminds me of the following helpful tools:

They are somewhat similar ideas.
Although they are based on artist similarity (this one is about genre/styles similarities), so they are limited to an specific corpus of music -artists- (mainly focused on western music). Also to be up to date, they require an infinite amount of constant work. New artists appear each day.  On the other hand, genres and styles are more or less static within a given period.


Yes good. Thank you for the detailed explanations. The map of relationships between performers that I gave as an example would work offline if it drew on its own library. It could show existing performers on the one hand, and those that are not yet available in the library. But admittedly this idea is a bit banal. :-)
Don't get me wrong. It would be cool to also use that data, but it's not released publicly right now nor open-source. You can use it on a browser, that's all.

Also when I said it requires online connection, I mean it requires to be online to be up to date. In this case, yes, you could theoretically download an entire database, create a graph and use it offline. But artists, by its nature, obviously change faster than genres/styles. I'm not really sure if a graph with +70K nodes would be usable in javascript within foobar at all btw.

Similarly Last fm data is not open-source; you can fetch it ussing scrappers, but then that requires online connection. I could, theoretically, support last fm data (similar artists) previously downloaded with a biography script, that's all.

Personally I prefer linking music by tangible similarity characteristics (key, genre, style, fingerprint, etc) than social based characteristics ("last fm says that beatles is similar to rollings, so it should be right"). I find the second approach too much based on eurocentrism and "popularity".

Re: Search-by-Distance-SMP

Reply #14
## [1.1.0] - 2021-05-26
### Added
- Harmonic mixing: multiple debug additions.
- Cache: is now saved to a json file and reused between different sessions. Cuts loading time by 4 secs for 70K tracks on startup (!).
- Cache: gets automatically refreshed whenever the descriptors crc change. i.e. it will be recalculated with any change by the user too.
- Descriptors: Multiple new additions.
### Changed
- Harmonic mixing: small changes and optimizations.
- Harmonic mixing: code for pattern creation moved to camelot_wheel.js.
- Harmonic mixing: code for sending to playlist moved to helpers and reused in multiple scripts.
- Debug: Greatly expanded the debug functions to check possible errors or inconsistencies in the descriptors. It should be foolproof now.
- Descriptors: Multiple fixes on descriptors found with the new debug code.
- Buttons: Variables are now set according to distance variables on descriptors. i.e. if they change at a latter point, they will be re-scaled.
### Removed
- Removed all lodash dependence and deleted helper.
### Fixed

Re: Search-by-Distance-SMP

Reply #15
I'm trying search by distance with 'buttons_search_bydistance.js' script (pulled from github today)

remapping panel prefs with:
genre: genre,ALBUM GENRE ALLMUSIC,ALBUM GENRE LAST.FM
style: ALBUM THEME ALLMUSIC
mood: ALBUM MOOD ALLMUSIC

Not sure of space handling, but I've tried remapping genre/style/mood tags (using default ALBUM GENRE ALLMUSIC, replacing ALBUM_GENRE_ALLMUSIC, enclosing 'ALBUM GENRE ALLMUSIC' & "ALBUM GENRE ALLMUSIC")

I get the same results on all queries (set to return 50 results, source track has multiple data values in all 5 fields)

Nearest Tracks button:
returns playlist with 50 items matching only first %genre% value; other custom genres ignored (results show no consistency)?
Similar Tracks button:
returns playlist with 50 items matching only first %genre% value; other custom genres ignored (results show no consistency)?
both playlists feature many duplicate artists which I find very strange given a library of 290K+ tracks.

Similar Genres button:
no results - returns empty playlist
Similar Mood button:
no results - returns empty playlist

I delete the resulting playlist between searches.

Any tips?

Re: Search-by-Distance-SMP

Reply #16
You have to use the tag name(s) as is, sep by comma. That's all. There is even examples on the readme and github.


You don't have to delete the playlists. They are always cleared first.

There is definitely something wrong there, since what you describe is really strange. The script merges all remapped tags. It's the 3rd line of the function... and it works perfectly on my side and according to other user's reports.

Could you post screenshots of your properties and tags? Maybe your tags are not split (?), you are putting the names wrong, etc. Obviously the problem has to do with the way you have added the tags, since every tag you have added is not working (mood tag, style tag) and genre works for the default tag value (genre).

EDIT: Some more hints
A dummy track with no tags and only ALL MUSIC GENRE...
X

Enable console debug to get more info!
X

Tags at properties
X

It will warn if you are missing tags ;)
X

The query thing is only for an extra forced query that can be added to pre-filter the library. But you have to check the rest. In your case you will probably see that your selected track had no mood or style tags, pointing to a problem with the way you have set tags on properties or on your files.

Re: Search-by-Distance-SMP

Reply #17
per prev. the only panel prefs change was:
genre: genre,ALBUM GENRE ALLMUSIC,ALBUM GENRE LAST.FM
style: ALBUM THEME ALLMUSIC
mood: ALBUM MOOD ALLMUSIC

track tags are:
Code: [Select]
Artist Name : Abdel Ali Slimani
Track Title : Mraya
Album Title : Mraya
Year : 1996
Genre : desi1; afro1
Composer :
Performer :
Album Artist : Abdel Ali Slimani; Jah Wobble
Track Number : 04
Total Tracks : 09
Disc Number :
Total Discs :
Comment :
<ALBUM GENRE ALLMUSIC> : International; Worldbeat; African Traditions; North African
<ALBUM GENRE LAST.FM> : Arabic; Rai; Love; Africa; Tunisia
<ALBUM MOOD ALLMUSIC> : Earthy; Nocturnal; Passionate; Rousing
<ALBUM THEME ALLMUSIC> : Hanging Out; Late Night
<BPM> : 186
<DISCOGS_ARTIST_PROFILE> : Rai singer Abdel Ali Slimani was raised in El Anasser, Algeria, where as a teen he learned guitar and performed as a drummer at soccer matches. Finding little opportunity for musicians in his native land, he went to Paris in 1982; after a subsequent move to London, Slimani found work as a club DJ before signing on as a vocalist and percussionist with ex-PiL bassist Jah Wobble's Anglo-Arabic unit Invaders of the Heart.
<DISCOGS_CATALOG> : CDRW55; CDRW 55; 7243 8 40780 2 7
<DISCOGS_COUNTRY> : UK & Europe
<DISCOGS_CREDIT_VOCALS> : Sinéad O'Connor; Abdel Ali Slimani
<DISCOGS_RELEASE_CREDITS> : Bass - Jah Wobble; Drums, Programmed By, Backing Vocals - John Reynolds; Electric Guitar, Guitar [Spanish Guitar], Oud ['ud], Backing Vocals - Justin Adams; Executive-Producer - Jah Wobble; Liner Notes [French Translation] - Rosa Santos; Management - David Jaymes Associates Ltd.; Mixed By - Mark Ferda; Photography By - John Sleeman; Producer - John Reynolds; Producer [Assistant] - Justin Adams; Vocals, Goblet Drum [Darbuka], Bendir, Tar (drum), Percussion [Kraksh] - Abdel Ali Slimani; Written-By - Slimani, Wobble, Reynolds, Adams
<DISCOGS_RELEASE_ID> : 327152
<DISCOGS_RELEASE_NOTES> : Recorded at John Reynolds Studios (...)
<DISCOGS_TRACK_CREDITS> : Cello - Caroline Dale; Goblet Drum [Darbuka] - Nacer Khenniche; Vocals - Sinéad O'Connor
<KEY> : Am
<PUBLISHER> : Real World Records
<RATING> : 4
<UNSYNCED LYRICS> : Abdel Ali Slimani - Mraya (...)

Selecting Similar Mood button:
logging returned:
Query created: NOT (%rating% EQUAL 2 OR %rating% EQUAL 1) AND NOT (STYLE IS Live AND NOT STYLE IS Hi-Fi) AND %channels% LESS 3 AND NOT COMMENT HAS Quad AND TITLE PRESENT AND ARTIST PRESENT AND DATE PRESENT
Items retrieved by query (minus duplicates): 293314 tracks
Pool of tracks with similarity greater than 40% and graph distance lower than 400: 0 tracks
Warning: Final Playlist selection length (= 0) lower/equal than 50 tracks. You may want to check 'sbd0_28.Exclude any track with graph distance greater than (only GRAPH method):' parameter (= 400).
Warning: Final Playlist selection length (= 0) lower/equal than 50 tracks. You may want to check 'sbd0_27.Exclude any track with similarity lower than (in %)' parameter (= 50%).
Final Playlist selection length: 0 tracks.
Call to do_searchby_distance SimilarMood took 23001 milliseconds.

Selecting Similar Genre button logging:
Query created: NOT (%rating% EQUAL 2 OR %rating% EQUAL 1) AND NOT (STYLE IS Live AND NOT STYLE IS Hi-Fi) AND %channels% LESS 3 AND NOT COMMENT HAS Quad AND TITLE PRESENT AND ARTIST PRESENT AND DATE PRESENT
Items retrieved by query (minus duplicates): 293314 tracks
Pool of tracks with similarity greater than 50% and graph distance lower than 150: 0 tracks
Warning: Final Playlist selection length (= 0) lower/equal than 50 tracks. You may want to check 'sbd0_28.Exclude any track with graph distance greater than (only GRAPH method):' parameter (= 150).
Warning: Final Playlist selection length (= 0) lower/equal than 50 tracks. You may want to check 'sbd0_27.Exclude any track with similarity lower than (in %)' parameter (= 60%).
Final Playlist selection length: 0 tracks.
Call to do_searchby_distance SimilarGenres took 24008 milliseconds.


I do have other tracks with those same tags. If nothing else, I would expect tracks from the same album to appear?

Re: Search-by-Distance-SMP

Reply #18
I do have other tracks with those same tags. If nothing else, I would expect tracks from the same album to appear?

Obviously XD

But I think where the problem is... I will advise you to read the readme. You are using GRAPH method (according to your log) with non standard genres, which clearly can not work at all since none of those genres exists in the graph. ' Arabic; Rai; Love; Africa; Tunisia' (?) (I don't plan to add Africa as a genre for ex. since that's not a genre at all).

Use WEIGHT method instead which will work with any genre value (uses string matching and simply compares tags to assign a score). The 'downside' is it will not relate genres by similarity (for ex. folk to country). So people have to choose, to either use a complex method restricted to Standard Tags (you can check which ones 'on music_graph_descriptors_xxx') or something which works with anything, but more simple (like spotify).

All music does not use standard genre tags at all for most tracks (African -location tag-, International -western-centric tag which means nothing-, African traditions -same... so many things are this-, although sometimes it gets it ritgh (Rock, Heavy Metal, Hard Rock, Pop Rock, Blues Rock). On the other hand they are perfect for WEIGHT method (they add tons of situational tags). Note you can also use "real genres" as genre and put ALL MUSIC tags on the custom tags. That way you can have best of both worlds.
X

Now, it seems it's my fault since I put that method as default for testing something instead of using the panel's property. And that's what I released. Go to buttons_search_bydistance.js, look for "method: 'GRAPH'" and change all to method: 'WEIGHT'. There are 4 instances. Reload the panel and done. It should work. I will fix that on the next release to follow what you set on the properties (If you open the properties, you will see a method property, but changing it will do nothing). And then, as noted, you (or anyone else) should use WEIGHT when using arbitrary genre values. In playlist tools this is simply done by using the menu name 'By weight' instead of  'By graph'.
You also have the custom buttons 'buttons_search_bydistance_customizable.js' which you can use and set to WEIGHT at properties (there it works fine).
X

The files edited (you have the 3 methods forced, or one which just follow the properties panel):
X

 

Re: Search-by-Distance-SMP

Reply #19
Thanks for the feedback and support. BTW there is a _README and INSTALLATION.txt (no info) and a README.md ?? which has more info but finding or applying it isn't particularly intuitive.

I wasn't expecting this tool to be some sort of liguial AI to relate tags by meaning. Obviously XD

I did make the changes and there are results for all 4 buttons now, however the results are also confounding.

-Nearest Tracks returns interesting lists which has the most overlap in the style tag.
-Similar Tracks returns a very random list with very little overlap in any of the 5 fields.
-Similar Genres returns a list with almost no connection or repetition of the seed genres and no other obvious patterns.
-Similar Mood returns a list roughly split in matches of mood and theme (<50% each), and very little similarity of genres.
Is there a description of the actual functionality of those 4 buttons somewhere?

I'm hoping to play with the weightings more as KEY and BPM are also important to me, but documentation seems to favor theory over practice. What exactly is the scale being calculated of all the variables "weight" (in panel prefs)? based on 100%?



Re: Search-by-Distance-SMP

Reply #20
Thanks for the feedback and support. BTW there is a _README and INSTALLATION.txt (no info) and a README.md ?? which has more info but finding or applying it isn't particularly intuitive.

I wasn't expecting this tool to be some sort of liguial AI to relate tags by meaning. Obviously XD

I did make the changes and there are results for all 4 buttons now, however the results are also confounding.

-Nearest Tracks returns interesting lists which has the most overlap in the style tag.
-Similar Tracks returns a very random list with very little overlap in any of the 5 fields.
-Similar Genres returns a list with almost no connection or repetition of the seed genres and no other obvious patterns.
-Similar Mood returns a list roughly split in matches of mood and theme (<50% each), and very little similarity of genres.
Is there a description of the actual functionality of those 4 buttons somewhere?

I'm hoping to play with the weightings more as KEY and BPM are also important to me, but documentation seems to favor theory over practice. What exactly is the scale being calculated of all the variables "weight" (in panel prefs)? based on 100%?



Github has a readme used on the frontpage. That's the "readme". It's unique for each repository.

The other file is universal for all my scripts and it clearly explains only how to install things and some basic tips. But as you can note, there is no specific info at all about the script you downloaded. I could change the filename to TIPS_INSTALLATION.txt though (?).

Quote
-Nearest Tracks returns interesting lists which has the most overlap in the style tag.
-Similar Tracks returns a very random list with very little overlap in any of the 5 fields.
-Similar Genres returns a list with almost no connection or repetition of the seed genres and no other obvious patterns.
-Similar Mood returns a list roughly split in matches of mood and theme (<50% each), and very little similarity of genres.
Is there a description of the actual functionality of those 4 buttons somewhere?

I'm hoping to play with the weightings more as KEY and BPM are also important to me, but documentation seems to favor theory over practice. What exactly is the scale being calculated of all the variables "weight" (in panel prefs)? based on 100%?
First... yep, these are obviously scripts to configure to your liking or use-case. The buttons are "examples" and I clearly indicate that in the readmes. They may work fine for most people without touching anything BUT obviously these are advanced things which try to emulate complex algorithms and require some thinking to make it work. It can even output genres which inspired or  are derivatives of the current selected track's genre. Or "opposite genres". Or mixes like DJ do, by key ordering, etc. And all can be configurable via properties with the custom button. (which you may have not tried yet). The other buttons have some weights and filter scoring static, written in the js files. Have that in mind if you are playing with them ;) (and that reminds me to totally remove properties not used for the static buttons to not confuse more people)

Second, probably you would make better use of Playlist-Tools-SPM, which also includes this... and has many other tools, easier to use/configure. (like dynamic query playlist creation according to the currently selected track, etc.)

Now, back to your questions.

All buttons have weighting variables, what works for me may not work for you. I give 4 examples, I could have simple given one and no one would complain  ::)  The labeling is arbitrary according to my experience and my library (and I can assure you it totally works like their title say hahaha), but it may output different things in your experience according to your tags scheme. That's why there is a customizable button, so you can simply add one which does what you want and done.

- The buttons are set to output random tracks from the pool (this will always be the same as long as the "variables" are the same). You can change that part in the properties. Then it will output always the same tracks most similar to the current one, by order. (Personally, I prefer to listen to different things, that's why the default is the other behavior)

Quote
-Similar Tracks returns a very random list with very little overlap in any of the 5 fields.
What you or I understand by similar is relative  ::)  I mean... you have weights. If you don't set mood or BPM tags on tracks, then those are discarded and you got less vectors of similarity. If you want to give more importance to genre matching, then increase that variable. For genre, genre weight.

That button clearly explains in the tooltip it will try to give more weight to genre tags but will not care so much about style tags.

Quote
-Similar Genres returns a list with almost no connection or repetition of the seed genres and no other obvious patterns.
What do you mean by connection? You are using WEIGHT method. It simply gives lets say 100 if it matches all genres, and 0 if it matches none. You got a filter (lets say +70% is similar). -this is obviously a simplified version-
Whatever you got must be over that filter, so whatever you got must have some genre tags equal to the selection you used to create the playlist. That's by construction. Do you mean you are not getting that? Or you are not satisfied with which tags are being used? The second one has to do more with all music tagging than anything... as said, they are totally situational XD and make no sense at all (african, etc.).

For ex. all my rock tracks have a genre Rock. And then Acid Rock or Pop Rock or Gothic Rock are styles. The scripts can not work with bad tagging habits (don't take it personal) and it's clearly stated in the readmes and the first use popup that appears.

Now, if  you find you get tracks with not enough similar tags.. you can either increase the filter minimum (to 85% for ex) or adjust the weights. If you are getting tracks which don't match any tag, then we are talking about a config problem or bug. If the tags you use doesn't really relate to how you perceive your music (and how the script uses those tags to group them), then... that's outside my reach.

Quote
-Similar Mood returns a list roughly split in matches of mood and theme (<50% each), and very little similarity of genres.
That's the idea. Did you read the tooltips over the buttons?  ::)  That button should not care at all about genres/styles and just output whatever is similar in moods and themes and all that. If you want more similarity, increase the filter value.

Btw my tracks have: genre, style, BPM, key and mood tags. Matching at least the last 3 always give pleasuring results.

Quote
Is there a description of the actual functionality of those 4 buttons somewhere?
Tooltip.
search_bydistance.js has extensive examples...
X
buttons_search_bydistance.js clearly estates the buttons are just examples, and the readme explains what each variable does. BUT you got the examples at the previous file which is probably easier to understand.

Quote
I'm hoping to play with the weightings more as KEY and BPM are also important to me, but documentation seems to favor theory over practice. What exactly is the scale being calculated of all the variables "weight" (in panel prefs)? based on 100%?
More simple. It doesn't matter what you put. Whatever weights you put  the total weight will be... the sum hahaha simple.
So if you put 25, 25, 30, 20. Then they sum 100% and obviously each value is the percentage too.
But you can put 1, 1,3,60. And it works the same. They sum 65, and 65 will be 100%.

PD: Try to add a more strict global query to pre-filter your library. Since seeing your logs you are working with 200K tracks and that's really really big. It will greatly speed up the things. Also setting weight to zero for unused things -if you set genre to 80%, you may well set date or another tag to 0%...- (again, you must use the customizable button for that)

EDIT: about relating tags "by meaning"... something like that is done for keys (they are grouped by complex relations). Try harmonic mixing in a custom button, or setting the key weight high and a range of 2 or 3.
About genres, that's done with GRAPH method. But I'm sorry to say all music tags are out of equation in that case (as genres, they are ok as custom tag).
You have an intermediate method DYNGENRE, but there must be some standard tags to work. Like "Rock". If allmusic tags gothic rock with 10 tags but not rock, then you are screwed. Just use WEIGHT and adjust weightings and filter scoring.

Feel free to ask me anything. It's a bit tedious to explain all but I imagine it's more to try something you don't understand hahaha I'm trying to iron out those points you have noted are confusing. Let me know if the examples I pointed to are good enough or not. (and maybe they should be added to their own file for easy referencing)

And try the playlist-Tools thing, since that probably suits your most immediate needs. It can easily create playlists with tracks which have 5 o more equal genres to the currently selected track or things like that. Can not be easier than that. (there are individual buttons, and the main playlist tools button which has tons of utilities and examples). (*)
X

(*) It's ironic but this is just one "little" thing within all the set of scripts.


Re: Search-by-Distance-SMP

Reply #22

And try the playlist-Tools thing, since that probably suits your most immediate needs.

The 100% tip was the key - really need a weighted verbosity filter. ;)

Thanks, will do, but playlist_manager.js is currently missing?

https://github.com/regorxxx/Playlist-Tools-SMP
hahaha No. That's another script with another repository...  ::) Tell me if I'm wrong but there is no place at that github I mention the playlist manager (?)
You have all my scripts there:
https://github.com/regorxxx

And there are 4 main scripts for end-users: world map, playlist manager, playlist tools and this one (also included in playlist tools).

My take is offline -I'm against internet being a requirement for this- and configurable intelligent playlist creation. If you want something similar for artist similarity with is just "plug&play" but using internet (and with less tools/or things to understand), you have
https://hydrogenaud.io/index.php?topic=121006.0

EDIT: And before you despair using the other tool, remember that ALL built-in examples are just examples and use standard tags (genre, mood, etc.) and not arbitrary tags (ALL MUSIC XXX). Create your own entries, remove the menus you don't need or edit the properties and change the current default menus replacing "genre" with whatever you like. (this reminds me I could add All music tags to the default tags too and they could simply be skipped if not present)

Re: Search-by-Distance-SMP

Reply #23
v1.2.0 - File restructuring and cleanup + bugfixes

Main change on script is that mean distance is now also divided by the number of genre/styles of the reference track for GRAPH method. That should give more results for tracks with too many tags, while not changing so much for the rest. Distance filters have been updated accordingly in all buttons to reflect the change (and users should do the same in their customized buttons).
See changelog.

## [1.2.0] - 2021-06-07
### Added
- Buttons: 4 sets of buttons, one for each method: GRAPH, WEIGHT, DYNGENRE + ONE CONFIGURABLE (method at properties). (This in addition to the fully customizable buttons)
### Changed
- GRAPH: mean distance is now also divided by the number of genre/styles of the reference track. That should give more results for tracks with too many tags, while not changing so much for the rest. Distance filters have been updated accordingly in all buttons to reflect the change (and users should do the same in their customized buttons).
- Buttons framework: updated.
- Helpers: Moved all external libraries to 'helpers-external'.
- Helpers: Split 'helpers_xxx.js' file into multiple ones for easier future maintenance.
- Moved all SMP scripts without UI (those not meant to be loaded directly on panels) to 'main'.
- All buttons now have not needed properties deleted, to not confuse users about things on properties not being reflected on the buttons.
### Removed
### Fixed
- Default args: crashes when trying to access non present properties on the arguments (found while applying the previous changes).
- Cache: crash when sharing cache between 2 panels due to a typo.
- In key mixing: crash when pool was smaller than set playlist length.
- In key mixing: not really random due to using sort + random method. Using an array shuffle now instead.
- Random picking: not really random due to using sort + random method. Using an array shuffle now instead.

Re: Search-by-Distance-SMP

Reply #24
v2.0.0 - Recipes, themes and Major buttons rework
DO NOT COPY OVER PREVIOUS INSTALLATION (*). Remove all previous panels within foobar and follow the instructions at the readme and installation tips. You can safely delete all files at 'xxx-scripts' first. If you are using other scripts, then download their latest version too and reinstall (Playlist Manager and World Map can be updated without de-installing their panels first, i.e. you can maintain all your settings).

See changelog for all changes.

    Recipes and themes for Search by distance. Recipes are config files for the buttons, which can be easily swapped. Themes mimic MusicIp functionality, i.e. work as a reference for playlist creation instead of using a track. You can easily create random playlists following a "mood" or "style" this way.
    Major buttons rework with easy to install and configure toolbars which allow to add\remove buttons on the fly.

(*) File structure has changed and now all buttons are meant to be used with a main toolbar file for easy config. Not doing so will lead to missing features.


## [2.0.0] - 2021-06-15
### Added
- Recipes: Recipes presets may be used to set variables of the function. Whenever the argument is set, it's used instead of related property. Custom button now allows to use a recipe file. Once set, button would always use the recipe as arguments instead of the properties variables. A recipe may force the use of a theme.
- Recipes: custom button now allows to set the recipe file used by pressing Ctrl + L. Click. 'None' would use the current properties variables, which is the default behaviour.
- Themes: themes presets may be used as reference instead of tracks. Whenever the argument is set, it's used instead of the selection. Custom button now allows to use a theme file. Once set, button would always use the theme as reference instead of the current selection.
- Buttons: custom button now allows to set the theme file used by pressing Shift + L. Click. 'None' would use the current selection, which is the default behavior.
- Buttons: custom button now allows to create a theme file using the currently focused track's tags. See theme menu (Shift + L. Click).
- Buttons: custom button now allows to set most configs using the configuration menu (Ctrl + Shift + L. Click): method, tags remapping, filters, etc. Whenever a config is overriden by a recipe, the related entry is greyed and a warning is shown.
- Buttons: new '_buttons_toolbar.js' toolbar which can be customized without editing the js file. Allows to enable/disable buttons -even add multiple copies- on demand and customize toolbar background color (L. Click on the bar).
### Changed
- Console: shows on console the track or theme used as reference (name and path).
- Buttons: custom button code cleanup and improvements on name changing.
- Buttons: custom button tooltip shows the theme and recipe being used, along tips to change them.
- Buttons: icons to all buttons.
- Buttons framework: skip icon drawing if font is not found.
- Buttons framework: allow a menu when clicking on the panel (and not on buttons).
- Portable: when properties are set for the first time, now use relative paths on profile folder for portable installations (>= 1.6). When possible, any other stored path is also stored as relative paths (for example themes or recipes on buttons).
- Helpers: warn about missing font on console if trying to load a font and is not found.
- Split all buttons into examples, toolbar and buttons folder. 'buttons_toolbar.js' is now the main script -in root folder- which can be loaded within a panel for easy configuration of buttons from this repository or any other.
### Removed
### Fixed
- Console: when playlist length is set to Infinite, warnings are no longer shown about number of tracks being less than it (which obviously always happened).