HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: regor on 2021-05-13 12:28:02

Title: Search-by-Distance-SMP
Post by: regor on 2021-05-13 12:28:02
Search-by-Distance-SMP (https://github.com/regorxxx/Search-by-Distance-SMP)
(https://img.shields.io/github/release/regorxxx/Search-by-Distance-SMP.svg?include_prereleases) (https://github.com/regorxxx/Search-by-Distance-SMP/blob/main/CHANGELOG.md)(https://www.codefactor.io/repository/github/regorxxx/Search-by-Distance-SMP/badge/main) (https://www.codefactor.io/repository/github/regorxxx/Search-by-Distance-SMP/overview/main)(https://api.codacy.com/project/badge/Grade/1677d2b0dee54548bf44614fcf808529) (https://www.codacy.com/gh/regorxxx/Search-by-Distance-SMPdashboard?utm_source=github.com&utm_medium=referral&utm_content=regorxxx/Search-by-Distance-SMP&utm_campaign=Badge_Grade)(https://img.shields.io/github/license/regorxxx/Search-by-Distance-SMP) (https://github.com/regorxxx/Search-by-Distance-SMP/blob/main/LICENSE)
An implementation of Music-Graph (https://github.com/regorxxx/Music-Graph) for foobar2000 using Spider Monkey Panel (https://theqwertiest.github.io/foo_spider_monkey_panel), which creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.

(https://user-images.githubusercontent.com/83307074/116761198-80a8bd80-aa06-11eb-904c-b3d50905f6bd.gif)

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:

There are 3 methods to calc similarity: WEIGHT, GRAPH and DYNGENRE.

Other features

(https://user-images.githubusercontent.com/83307074/116776801-073aba80-aa5a-11eb-8f3f-82e02ccf265e.gif)

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 (https://github.com/regorxxx/Music-Graph): An open source graph representation of most genres and styles found on popular, classical and folk music.
 2. Camelot-Wheel-Notation (https://github.com/regorxxx/Camelot-Wheel-Notation): Javascript implementation of the Camelot Wheel, ready to use "harmonic mixing" rules and translations for standard key notations.

(https://user-images.githubusercontent.com/83307074/116759506-fcecd200-aa01-11eb-8d2c-8a48ebcc73c0.gif)

Other implementations
 1. Playlist-Tools-SMP (https://github.com/regorxxx/Playlist-Tools-SMP): Offers different pre-defefined examples for intelligent playlist creation.

(https://user-images.githubusercontent.com/83307074/116759000-cebac280-aa00-11eb-8a81-9a450e13205a.gif)

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
Title: Re: Search-by-Distance-SMP
Post by: rolf1955 on 2021-05-13 21:07:05
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://www.music-map.com/)

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

 :)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-05-14 17:27:28
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://www.music-map.com/)

https://musicmachinery.com/2009/05/31/building-a-music-map/ (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.
Title: Re: Search-by-Distance-SMP
Post by: paregistrase on 2021-05-15 06:00:42
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.

Title: Re: Search-by-Distance-SMP
Post by: marc2k3 on 2021-05-15 11:45:24
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;
Title: Re: Search-by-Distance-SMP
Post by: paregistrase on 2021-05-15 11:56:34
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
Title: Re: Search-by-Distance-SMP
Post by: marc2k3 on 2021-05-15 12:07:41
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
Title: Re: Search-by-Distance-SMP
Post by: paregistrase on 2021-05-15 12:17:45
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?
Title: Re: Search-by-Distance-SMP
Post by: marc2k3 on 2021-05-15 12:58:03
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.
Title: Re: Search-by-Distance-SMP
Post by: el-jaguar on 2021-05-15 15:58:17
I get a "buttonCoordinates is undefined" error. Total newbie here, what am I doing wrong?
NEVERMIND, GOT IT
Title: Re: Search-by-Distance-SMP
Post by: Awesomeo on 2021-05-17 19:29:32
https://acousticbrainz.org/

Btw good and huge open-source databases of acoustic data.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-05-17 23:35:06
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).
Title: Re: Search-by-Distance-SMP
Post by: rolf1955 on 2021-05-20 22:00:18
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. :-)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-05-23 22:23:40
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".
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-05-26 21:00:46
## [1.1.0] - 2021-05-26 (https://github.com/regorxxx/Search-by-Distance-SMP)
### 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
Title: Re: Search-by-Distance-SMP
Post by: mjm716 on 2021-06-02 06:51:23
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?
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-06-02 08:39:43
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.
(https://hydrogenaud.io/index.php?action=dlattach;attach=19837;image)

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.
Title: Re: Search-by-Distance-SMP
Post by: mjm716 on 2021-06-02 09:09:39
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?
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-06-02 09:31:21
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
Title: Re: Search-by-Distance-SMP
Post by: mjm716 on 2021-06-02 15:08: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%?


Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-06-02 17:45:05
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 (https://hydrogenaud.io/index.php?topic=120978.0), 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.
Title: Re: Search-by-Distance-SMP
Post by: mjm716 on 2021-06-03 04:00:41

And try the playlist-Tools thing (https://hydrogenaud.io/index.php?topic=120978.0), 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 (https://github.com/regorxxx/Playlist-Tools-SMP)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-06-03 08:42:40

And try the playlist-Tools thing (https://hydrogenaud.io/index.php?topic=120978.0), 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 (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)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-06-07 19:36:03
v1.2.0 - File restructuring and cleanup + bugfixes (https://github.com/regorxxx/Search-by-Distance-SMP)

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.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-06-15 17:35:05
v2.0.0 - Recipes, themes and Major buttons rework (https://github.com/regorxxx/Search-by-Distance-SMP)
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).
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-13 19:44:33
regor, I have a (dumb) question regarding harmonic mixing...I use InitialKey instead of Key. Where should I change (replace InitialKey with Key)  this, in which script or properties panel?
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-13 20:06:12
regor, I have a (dumb) question regarding harmonic mixing...I use InitialKey instead of Key. Where should I change (replace InitialKey with Key)  this, in which script or properties panel?
That one along bpm are hard-coded. Will be configurable on properties on next releases.

Line 1423 at search_bydistance.js:
Code: [Select]
const restTagNames = [(keyWeight !== 0 || bInKeyMixingPlaylist) ? 'key' : 'skip', (dateWeight !== 0) ? dateTag[0] : 'skip', (bpmWeight !== 0) ? 'bpm' : 'skip', (customNumWeight !== 0) ? customNumTag[0] : 'skip']; // 'skip' returns empty arrays...

Replace 'key' with 'InitialKey' or whatever you use.

Btw if you use the customizable button (buttons_search_bydistance_customizable.js), it should allow you to configure most things without touching the properties. In next releases key would be on that tag list:

X
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-14 00:56:17
I replaced key with initialkey where you said, but it doesnt work, this is what I have in the console :

Called: Harmonic mix\Harmonic mix from playlist
do_harmonic_mixing: Tracks don't have key tag.
["domKey", "energySwitch", "moodDrop", "perfectMatch", "moodBoost", "subDomKey", "energySwitch", "energyRaise", "perfectMatch", "energyBoost", "energyDrop", "energyDrop", "perfectMatch", "domKey", "perfectMatch", "perfectMatch", "perfectMatch", "subDomKey"]

initialkey is using this values :
G#m
Bmaj
Ebm
Gb
Bbm
Db
Fmin
Ab
Cmin
Eb
Gmin
Bb
Dmin
Fmaj
Amin
Cmaj
Emin
Gmaj
Bmin
Dmaj
F#m
Amaj
C#m
Emaj
Thanks for the tip about buttons_search_bydistance_customizable.js
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-14 08:56:34
If you check the related repository at github for harmonic mixing you will see only standard notation is allowed
https://github.com/regorxxx/Camelot-Wheel-Notation

i.e. 'Abm'   or 'G#m'
Bmin or Dmaj are not allowed, Dmaj is D, Bmin is Bm.

You can either retag your files with standard notation (masstagger could automate the process or mp3tag) (*) or edit camelot_wheel_xxx.js (keyNotationObject and keyNotation). Note your files have also mixed notations (D#m and Dmin) (**).

If you prefer to edit the descriptor, you would add this to keyNotation for ex. but replacing the left column with Abmin, D#m (?? it should be D#min (**)), etc. (Also note you should not add duplicates, if D#m is already present on standard notation, skip it)
Code: [Select]
['G#m'	, '1A' 	], // Minor
['Abm' , '1A' ],
['D#m' , '2A' ],
['Ebm' , '2A' ],
['A#m' , '3A' ],
['Bbm' , '3A' ],
['Fm' , '4A' ],
['Cm' , '5A' ],
['Gm' , '6A' ],
['Dm' , '7A' ],
['Am' , '8A' ],
['Em' , '9A' ],
['Bm' , '10A' ],
['F#m' , '11A' ],
['Gbm' , '11A' ],
['C#m' , '12A' ],
['Dbm' , '12A' ],
['B' , '1B' ], // Major
['F#' , '2B' ],
['Gb' , '2B' ],
['C#' , '3B' ],
['Db' , '3B' ],
['G#' , '4B' ],
['Ab' , '4B' ],
['D#' , '5B' ],
['Eb' , '5B' ],
['A#' , '6B' ],
['Bb' , '6B' ],
['F' , '7B' ],
['C' , '8B' ],
['G' , '9B' ],
['D' , '10B' ],
['A' , '11B' ],
['E' , '12B' ],

I'm not sure about adding that additional translation on next release, which program gives those tags?

(*) Just replacing 'min' with 'm' would do on all tracks. No need to create an script for every key. Also, maybe that solution could be added to the script:

Code: [Select]
const camelotKey = camelotWheel.keyNotationObject.has(key) ? {...camelotWheel.keyNotationObject.get(key)} : null;
->
const camelotKey = camelotWheel.keyNotationObject.has(key.replace('min','m')) ? {...camelotWheel.keyNotationObject.get(key.replace('min','m'))} : null;

Code: [Select]
const camelotKeyNew = camelotWheel.keyNotationObject.get(keyNew);
const camelotKey = camelotWheel.keyNotationObject.get(key);
->
const camelotKeyNew = camelotWheel.keyNotationObject.get(keyNew.replace('min','m'));
const camelotKey = camelotWheel.keyNotationObject.get(key.replace('min','m'));

Code: [Select]
camelotKeyCurrent = keyCurrent.length ? camelotWheel.getKeyNotationObject(keyCurrent) : null;
->
camelotKeyCurrent = keyCurrent.length ? camelotWheel.getKeyNotationObject(keyCurrent.replace('min','m')) : null;

Code: [Select]
camelotKeyNew = (keyNew.length) ? camelotWheel.getKeyNotationObject(keyNew) : null;
->
camelotKeyNew = (keyNew.length) ? camelotWheel.getKeyNotationObject(keyNew.replace('min','m')) : null;

Or alternatively simply editing the has/get funcs at camelot_wheel_xxx.js would do (not needing anything more):
Code: [Select]
	hasKey(xy) {return (typeof xy === 'object' ? (xy.hasOwnProperty('hour') && xy.hasOwnProperty('letter') ? this.keyNotation.has(xy.hour + xy.letter) : false): this.keyNotation));},
getKeyNotationObject(y) {return (this.hasKey(y) ? {...this.keyNotationObject.get(y)} : null);},

->

hasKey(xy) {return (typeof xy === 'object' ? (xy.hasOwnProperty('hour') && xy.hasOwnProperty('letter') ? this.keyNotation.has(xy.hour + xy.letter) : false): this.keyNotation.has(xy.replace('min','m')));},
getKeyNotationObject(y) {return (this.hasKey(y.replace('min','m')) ? {...this.keyNotationObject.get(y.replace('min','m'))} : null);},

Let me know if it works for you, and probably I will add the latest change too.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-15 18:24:18
Sorry for late answer but my foobar configuration refused to start ( a problem with SMP, a shutdown corrupted a package json, the settings for Library Tree were lost, but in the end everything was restored 100% , I had a backup for Library Tree, but it took awhile until it was solved).

"I'm not sure about adding that additional translation on next release, which program gives those tags?"
Probably you shouldn't.
It was simply an error from my part (I copied the wrong notations), I use standard notation (I use Serato for key values).

"Line 1423 at search_bydistance.js:
const restTagNames = [(keyWeight !== 0 || bInKeyMixingPlaylist) ? 'key' : 'skip', (dateWeight !== 0) ? dateTag[0] : 'skip', (bpmWeight !== 0) ? 'bpm' : 'skip', (customNumWeight !== 0) ? customNumTag[0] : 'skip']; // 'skip' returns empty arrays...

Replace 'key' with 'InitialKey' or whatever you use."
This didn't worked
But I noticed that if I copy the values from initialkey tag to key tag, the script works, so those values (key notations ) are good.

Well, our discussion wasn't totally useless because you reminded me about a masstagger script that I had. For those that don't want to remap tags or simply want to have in the "key'' tag , Camelot notations (obviously the files must have a key value somewhere added with Serato or other program) : http://sendanywhe.re/ZDXKN35B
Then, if you go to : Display - Playlist View - Columns - Style script ( don't forget to check "Use custom style script") and you add this:

$if($strstr(%KEY%,1A),$set_style(back,$rgb(86,241,218,86,241,218)),%KEY%)
$if($strstr(%KEY%,1B),$set_style(back,$rgb(2,237,202,2,237,202)),%KEY%)
$if($strstr(%KEY%,2A),$set_style(back,$rgb(125,242,170,125,242,170)),%KEY%)
$if($strstr(%KEY%,2B),$set_style(back,$rgb(60,238,129,60,238,129)),%KEY%)
$if($strstr(%KEY%,3A),$set_style(back,$rgb(174,245,137,174,245,137)),%KEY%)
$if($strstr(%KEY%,3B),$set_style(back,$rgb(134,242,79,134,242,79)),%KEY%)
$if($strstr(%KEY%,4A),$set_style(back,$rgb(232,218,161,232,218,161)),%KEY%)
$if($strstr(%KEY%,4B),$set_style(back,$rgb(223,202,115,223,202,115)),%KEY%)
$if($strstr(%KEY%,5A),$set_style(back,$rgb(253,191,167,253,191,167)),%KEY%)
$if($strstr(%KEY%,5B),$set_style(back,$rgb(255,160,124,255,160,124)),%KEY%)
$if($strstr(%KEY%,6A),$set_style(back,$rgb(253,175,183,253,175,183)),%KEY%)
$if($strstr(%KEY%,6B),$set_style(back,$rgb(255,160,124,255,160,124)),%KEY%)
$if($strstr(%KEY%,7A),$set_style(back,$rgb(253,170,204,253,170,204)),%KEY%)
$if($strstr(%KEY%,7B),$set_style(back,$rgb(255,129,180,255,129,180)),%KEY%)
$if($strstr(%KEY%,8A),$set_style(back,$rgb(242,171,228,242,171,228)),%KEY%)
$if($strstr(%KEY%,8B),$set_style(back,$rgb(238,130,217,238,130,217)),%KEY%)
$if($strstr(%KEY%,9A),$set_style(back,$rgb(221,180,253,221,180,253)),%KEY%)
$if($strstr(%KEY%,9B),$set_style(back,$rgb(206,143,255,206,143,255)),%KEY%)
$if($strstr(%KEY%,10A),$set_style(back,$rgb(190,205,253,190,205,253)),%KEY%)
$if($strstr(%KEY%,10B),$set_style(back,$rgb(159,182,255,159,182,255)),%KEY%)
$if($strstr(%KEY%,11A),$set_style(back,$rgb(142,228,249,142,228,249)),%KEY%)
$if($strstr(%KEY%,11B),$set_style(back,$rgb(86,217,249,86,217,249)),%KEY%)
$if($strstr(%KEY%,12A),$set_style(back,$rgb(85,240,240,85,240,240)),%KEY%)
$if($strstr(%KEY%,12B),$set_style(back,$rgb(85,240,240,85,240,240)),%KEY%)

The colors will look exactly like in the Camelot Wheel :







Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-15 18:36:25
So, my problem was solved. I use Serato to get the key values in ''initialkey'' tag, then I use a script for Masstagger to add  Camelot notations in ''key'' tag (this way it will also have a great look, similar to dj programs) . Thanks, once again @regor , for the help
Btw, just to be sure, if you look at that picture, (I used : Playlist tools - Playlist manipulation - Harmonic mix from playlist) your script works ok, no? I'm asking just to be sure that foobar doesn't rearranges the songs in a wrong order
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-15 19:22:17
So, my problem was solved. I use Serato to get the key values in ''initialkey'' tag, then I use a script for Masstagger to add  Camelot notations in ''key'' tag (this way it will also have a great look, similar to dj programs) . Thanks, once again @regor , for the help
Btw, just to be sure, if you look at that picture, (I used : Playlist tools - Playlist manipulation - Harmonic mix from playlist) your script works ok, no? I'm asking just to be sure that foobar doesn't rearranges the songs in a wrong order
Note the whole point of only allowing standard notation was to translate it to camelot notation on the fly hahahahaha (*)
So there is no need at all to do it first by yourself! (my idea was to allow SMP to work with standard notation -Gbm- and camelot notation at the same time -2A- without forcing you to re-tag). Just copying Initialkey to key should work. Obviously, doing the translation too. Anyway retagging will not be needed at all in next release since you can set the key tag.

(*) My first approach to the problem was also using a similar script than the one you posted. But it's really tedious to apply that script since it had so many lines... and you need to re-apply it on every new track. So I found it better to just do it on the SMP script using the keys we already had (Gbm, ...).
There is another problem, some keys have a sharp and flat notation and are equivalent. Abm and G#m are both 1A. So you have to duplicate the script to include both cases. For common users, that requirement would have been a big No.

Now that you mention it I will add that masstagger script to 'presets\Masstagger\' (I think the latest public release does not have that folder (?)). I'm sharing my own masstagger scripts which may be useful for people (although not related to any tool in particular), and the key translation may come useful too. From standard to camelot and the opposite one.

Quote
Replace 'key' with 'InitialKey' or whatever you use."
This didn't worked
But I noticed that if I copy the values from initialkey tag to key tag, the script works, so those values (key notations ) are good.
Note there are 2 functions (one called V2), maybe you edited the wrong function (?). It's 100% sure that editing that line should allow you to load tags from initialkey (try lowercase).

About it working, see console. If it says it works, then it works hahahaha Really, if you enable console debug, it will output an array of keys telling you the movements used. With that, you can compare the actual order and the "desired order" and easily check if it works. Looking at your screenshot I would say yes... similar keys are grouped, when it changes it tries small steps (+- 1) and there are a few mood boosts/drops (+-3). The complete arrangement is random, i.e. on every run a new "pattern" is created. But the proportion of movements allowed is not (for ex. 10% of movements are +-3).

Finally, use your ears. If the playlist flows without strange jumps and following tracks sounding as a natural progression of the previous one, no matter the music genre... then it works. There are a few mood/energy jumps here and there, but really limited in number and meant to spice it a bit.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-15 19:34:31
To enable debug, it seems I missed to expose a global bool... you can enable it for Search By distance buttons at properties, but not for Playlist Tools menu.

Anyway, at main\playlist_tools_menu.js look for 'const defaultArgs'
This is my current code (probably different to the latest public release)
Code: [Select]
const defaultArgs = {
playlistLength: menu_properties['playlistLength'][1],
forcedQuery: menu_properties['forcedQuery'][1],
ratingLimits: menu_properties['ratingLimits'][1].split(','),
bHttpControl: () => {return utils.CheckComponent('foo_httpcontrol') && _isFolder(fb.ProfilePath + 'foo_httpcontrol_data\\ajquery-xxx')},
httpControlPath: fb.ProfilePath + 'foo_httpcontrol_data\\ajquery-xxx\\smp\\'
};

if you add 'bDebug: true' there it will output verbose comments to console log for most tools:
Code: [Select]
const defaultArgs = {
playlistLength: menu_properties['playlistLength'][1],
forcedQuery: menu_properties['forcedQuery'][1],
ratingLimits: menu_properties['ratingLimits'][1].split(','),
bHttpControl: () => {return utils.CheckComponent('foo_httpcontrol') && _isFolder(fb.ProfilePath + 'foo_httpcontrol_data\\ajquery-xxx')},
httpControlPath: fb.ProfilePath + 'foo_httpcontrol_data\\ajquery-xxx\\smp\\',
bDebug: true
};
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-15 21:52:30
Have updated the repository with all the latest changes and fixes. Key remap included. If anyone want to test it, download the files directly from the repository not the releases.

(it's recommended to also download the latest files from the rest of my scripts, since I have changed all with major changes in Playlist Tools. If you use Playlist Tools, just download all from there, since it includes this)

Changelog is up to date on github. Check unreleased.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-15 23:28:29
"Now that you mention it I will add that masstagger script to 'presets\Masstagger\' (I think the latest public release does not have that folder (?)) I'm sharing my own masstagger scripts which may be useful for people (although not related to any tool in particular) "
No, there is no folder with Masstagger scripts, so it will be a useful thing
@regor I know, I forgot to mention , my method sacrifices a bit of efficiency in favor of visual aspect haha . The easiest solution would be just to remap the tags and that's all. But instead I choose to push a button from time to time just to have that colorful effect like in that picture (and Camelot notations), and besides it's not entirely silly, it helps a lot visually , if you want to make a manual mix using Camelot notations , you just see the colors and you know that something is wrong , so you could include that little script for CUI too (  Display - Playlist View - Columns - Style script).......for those interested in visual aspect or those that can find it useful :)

"Looking at your screenshot I would say yes... similar keys are grouped, when it changes it tries small steps"

Good to know it's working (I had a silly belief that maybe foobar will interfere with your script and will try to sort the songs in a wrong way haha), I didn't looked at the camelot wheel for a long time so I completely forgot the rules haha, so I thought you'll spot immediately if something is wrong :)


Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-16 08:43:53
"Now that you mention it I will add that masstagger script to 'presets\Masstagger\' (I think the latest public release does not have that folder (?)) I'm sharing my own masstagger scripts which may be useful for people (although not related to any tool in particular) "
No, there is no folder with Masstagger scripts, so it will be a useful thing
@regor I know, I forgot to mention , my method sacrifices a bit of efficiency in favor of visual aspect haha . The easiest solution would be just to remap the tags and that's all. But instead I choose to push a button from time to time just to have that colorful effect like in that picture (and Camelot notations), and besides it's not entirely silly, it helps a lot visually , if you want to make a manual mix using Camelot notations , you just see the colors and you know that something is wrong , so you could include that little script for CUI too (  Display - Playlist View - Columns - Style script).......for those interested in visual aspect or those that can find it useful :)

"Looking at your screenshot I would say yes... similar keys are grouped, when it changes it tries small steps"

Good to know it's working (I had a silly belief that maybe foobar will interfere with your script and will try to sort the songs in a wrong way haha), I didn't looked at the camelot wheel for a long time so I completely forgot the rules haha, so I thought you'll spot immediately if something is wrong :)



I think it may be possible to simply add the translation script directly to the column but use standard notation on tags. So you have both, no need to re-tag and easy visualization. Will check it

The latest update already includes those masstager scripts for moods (at presets).

Update:

key translation (both flat and sharp standard notations) + UI Colors (CUI): using this one there is no need to re-tag files but you can still visualize camelot keys as a column.
Code: [Select]
$if($stricmp(%KEY%,G#m),$puts(kTrans,1A))
$if($stricmp(%KEY%,Abm),$puts(kTrans,1A))
$if($stricmp(%KEY%,D#m),$puts(kTrans,2A))
$if($stricmp(%KEY%,Ebm),$puts(kTrans,2A))
$if($stricmp(%KEY%,A#m),$puts(kTrans,3A))
$if($stricmp(%KEY%,Bbm),$puts(kTrans,3A))
$if($stricmp(%KEY%,Fm),$puts(kTrans,4A))
$if($stricmp(%KEY%,Cm),$puts(kTrans,5A))
$if($stricmp(%KEY%,Gm),$puts(kTrans,6A))
$if($stricmp(%KEY%,Dm),$puts(kTrans,7A))
$if($stricmp(%KEY%,Am),$puts(kTrans,8A))
$if($stricmp(%KEY%,Em),$puts(kTrans,9A))
$if($stricmp(%KEY%,Bm),$puts(kTrans,10A))
$if($stricmp(%KEY%,F#m),$puts(kTrans,11A))
$if($stricmp(%KEY%,Gbm),$puts(kTrans,11A))
$if($stricmp(%KEY%,C#m),$puts(kTrans,12A))
$if($stricmp(%KEY%,Dbm),$puts(kTrans,12A))
$if($stricmp(%KEY%,B),$puts(kTrans,1B))
$if($stricmp(%KEY%,F#),$puts(kTrans,2B))
$if($stricmp(%KEY%,Gb),$puts(kTrans,2B))
$if($stricmp(%KEY%,C#),$puts(kTrans,3B))
$if($stricmp(%KEY%,Db),$puts(kTrans,3B))
$if($stricmp(%KEY%,G#),$puts(kTrans,4B))
$if($stricmp(%KEY%,Ab),$puts(kTrans,4B))
$if($stricmp(%KEY%,D#),$puts(kTrans,5B))
$if($stricmp(%KEY%,Eb),$puts(kTrans,5B))
$if($stricmp(%KEY%,A#),$puts(kTrans,6B))
$if($stricmp(%KEY%,Bb),$puts(kTrans,6B))
$if($stricmp(%KEY%,F),$puts(kTrans,7B))
$if($stricmp(%KEY%,C),$puts(kTrans,8B))
$if($stricmp(%KEY%,G),$puts(kTrans,9B))
$if($stricmp(%KEY%,D),$puts(kTrans,10B))
$if($stricmp(%KEY%,A),$puts(kTrans,11B))
$if($stricmp(%KEY%,E),$puts(kTrans,12B))
$if($get(kTrans),,$puts(kTrans,%key%))
$get(kTrans)
$if($stricmp($get(kTrans),1A),$set_style(back,$rgb(86,241,218,86,241,218)),$get(kTrans))
$if($stricmp($get(kTrans),1B),$set_style(back,$rgb(2,237,202,2,237,202)),$get(kTrans))
$if($stricmp($get(kTrans),2A),$set_style(back,$rgb(125,242,170,125,242,170)),$get(kTrans))
$if($stricmp($get(kTrans),2B),$set_style(back,$rgb(60,238,129,60,238,129)),$get(kTrans))
$if($stricmp($get(kTrans),3A),$set_style(back,$rgb(174,245,137,174,245,137)),$get(kTrans))
$if($stricmp($get(kTrans),3B),$set_style(back,$rgb(134,242,79,134,242,79)),$get(kTrans))
$if($stricmp($get(kTrans),4A),$set_style(back,$rgb(232,218,161,232,218,161)),$get(kTrans))
$if($stricmp($get(kTrans),4B),$set_style(back,$rgb(223,202,115,223,202,115)),$get(kTrans))
$if($stricmp($get(kTrans),5A),$set_style(back,$rgb(253,191,167,253,191,167)),$get(kTrans))
$if($stricmp($get(kTrans),5B),$set_style(back,$rgb(255,160,124,255,160,124)),$get(kTrans))
$if($stricmp($get(kTrans),6A),$set_style(back,$rgb(253,175,183,253,175,183)),$get(kTrans))
$if($stricmp($get(kTrans),6B),$set_style(back,$rgb(255,160,124,255,160,124)),$get(kTrans))
$if($stricmp($get(kTrans),7A),$set_style(back,$rgb(253,170,204,253,170,204)),$get(kTrans))
$if($stricmp($get(kTrans),7B),$set_style(back,$rgb(255,129,180,255,129,180)),$get(kTrans))
$if($stricmp($get(kTrans),8A),$set_style(back,$rgb(242,171,228,242,171,228)),$get(kTrans))
$if($stricmp($get(kTrans),8B),$set_style(back,$rgb(238,130,217,238,130,217)),$get(kTrans))
$if($stricmp($get(kTrans),9A),$set_style(back,$rgb(221,180,253,221,180,253)),$get(kTrans))
$if($stricmp($get(kTrans),9B),$set_style(back,$rgb(206,143,255,206,143,255)),$get(kTrans))
$if($stricmp($get(kTrans),10A),$set_style(back,$rgb(190,205,253,190,205,253)),$get(kTrans))
$if($stricmp($get(kTrans),10B),$set_style(back,$rgb(159,182,255,159,182,255)),$get(kTrans))
$if($stricmp($get(kTrans),11A),$set_style(back,$rgb(142,228,249,142,228,249)),$get(kTrans))
$if($stricmp($get(kTrans),11B),$set_style(back,$rgb(86,217,249,86,217,249)),$get(kTrans))
$if($stricmp($get(kTrans),12A),$set_style(back,$rgb(85,240,240,85,240,240)),$get(kTrans))
$if($stricmp($get(kTrans),12B),$set_style(back,$rgb(85,240,240,85,240,240)),$get(kTrans))

Key translation only (for column display CUI)
Code: [Select]
$if($stricmp(%KEY%,G#m),$puts(kTrans,1A))
$if($stricmp(%KEY%,Abm),$puts(kTrans,1A))
$if($stricmp(%KEY%,D#m),$puts(kTrans,2A))
$if($stricmp(%KEY%,Ebm),$puts(kTrans,2A))
$if($stricmp(%KEY%,A#m),$puts(kTrans,3A))
$if($stricmp(%KEY%,Bbm),$puts(kTrans,3A))
$if($stricmp(%KEY%,Fm),$puts(kTrans,4A))
$if($stricmp(%KEY%,Cm),$puts(kTrans,5A))
$if($stricmp(%KEY%,Gm),$puts(kTrans,6A))
$if($stricmp(%KEY%,Dm),$puts(kTrans,7A))
$if($stricmp(%KEY%,Am),$puts(kTrans,8A))
$if($stricmp(%KEY%,Em),$puts(kTrans,9A))
$if($stricmp(%KEY%,Bm),$puts(kTrans,10A))
$if($stricmp(%KEY%,F#m),$puts(kTrans,11A))
$if($stricmp(%KEY%,Gbm),$puts(kTrans,11A))
$if($stricmp(%KEY%,C#m),$puts(kTrans,12A))
$if($stricmp(%KEY%,Dbm),$puts(kTrans,12A))
$if($stricmp(%KEY%,B),$puts(kTrans,1B))
$if($stricmp(%KEY%,F#),$puts(kTrans,2B))
$if($stricmp(%KEY%,Gb),$puts(kTrans,2B))
$if($stricmp(%KEY%,C#),$puts(kTrans,3B))
$if($stricmp(%KEY%,Db),$puts(kTrans,3B))
$if($stricmp(%KEY%,G#),$puts(kTrans,4B))
$if($stricmp(%KEY%,Ab),$puts(kTrans,4B))
$if($stricmp(%KEY%,D#),$puts(kTrans,5B))
$if($stricmp(%KEY%,Eb),$puts(kTrans,5B))
$if($stricmp(%KEY%,A#),$puts(kTrans,6B))
$if($stricmp(%KEY%,Bb),$puts(kTrans,6B))
$if($stricmp(%KEY%,F),$puts(kTrans,7B))
$if($stricmp(%KEY%,C),$puts(kTrans,8B))
$if($stricmp(%KEY%,G),$puts(kTrans,9B))
$if($stricmp(%KEY%,D),$puts(kTrans,10B))
$if($stricmp(%KEY%,A),$puts(kTrans,11B))
$if($stricmp(%KEY%,E),$puts(kTrans,12B))
$if($get(kTrans),,$puts(kTrans,%key%))
$get(kTrans)

Key translation only (DUI)
Code: [Select]
$if($stricmp(%KEY%,G#m),$puts(kTrans,1A))$if($stricmp(%KEY%,Abm),$puts(kTrans,1A))$if($stricmp(%KEY%,D#m),$puts(kTrans,2A))$if($stricmp(%KEY%,Ebm),$puts(kTrans,2A))$if($stricmp(%KEY%,A#m),$puts(kTrans,3A))$if($stricmp(%KEY%,Bbm),$puts(kTrans,3A))$if($stricmp(%KEY%,Fm),$puts(kTrans,4A))$if($stricmp(%KEY%,Cm),$puts(kTrans,5A))$if($stricmp(%KEY%,Gm),$puts(kTrans,6A))$if($stricmp(%KEY%,Dm),$puts(kTrans,7A))$if($stricmp(%KEY%,Am),$puts(kTrans,8A))$if($stricmp(%KEY%,Em),$puts(kTrans,9A))$if($stricmp(%KEY%,Bm),$puts(kTrans,10A))$if($stricmp(%KEY%,F#m),$puts(kTrans,11A))$if($stricmp(%KEY%,Gbm),$puts(kTrans,11A))$if($stricmp(%KEY%,C#m),$puts(kTrans,12A))$if($stricmp(%KEY%,Dbm),$puts(kTrans,12A))$if($stricmp(%KEY%,B),$puts(kTrans,1B))$if($stricmp(%KEY%,F#),$puts(kTrans,2B))$if($stricmp(%KEY%,Gb),$puts(kTrans,2B))$if($stricmp(%KEY%,C#),$puts(kTrans,3B))$if($stricmp(%KEY%,Db),$puts(kTrans,3B))$if($stricmp(%KEY%,G#),$puts(kTrans,4B))$if($stricmp(%KEY%,Ab),$puts(kTrans,4B))$if($stricmp(%KEY%,D#),$puts(kTrans,5B))$if($stricmp(%KEY%,Eb),$puts(kTrans,5B))$if($stricmp(%KEY%,A#),$puts(kTrans,6B))$if($stricmp(%KEY%,Bb),$puts(kTrans,6B))$if($stricmp(%KEY%,F),$puts(kTrans,7B))$if($stricmp(%KEY%,C),$puts(kTrans,8B))$if($stricmp(%KEY%,G),$puts(kTrans,9B))$if($stricmp(%KEY%,D),$puts(kTrans,10B))$if($stricmp(%KEY%,A),$puts(kTrans,11B))$if($stricmp(%KEY%,E),$puts(kTrans,12B))$if($get(kTrans),,$puts(kTrans,%key%))$get(kTrans)

Should look like the image koshingg provided:
Spoiler (click to show/hide)

Btw @Koshingg , why does that masstagger script provide both an initial key and a key tag when you already have a key tag? (in fact it gets cleared and replaced with ?)
Spoiler (click to show/hide)
I like that it works with multiple formats though
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-16 15:31:48
You found a better solution, thanks for those scripts for CUI :)

''Btw @Koshingg , why does that masstagger script provide both an initial key and a key tag when you already have a key tag? (in fact it gets cleared and replaced with ?)  ''
It's great that you found that error. Here is the new version without that error (and with Initial Key) tag : http://sendanywhe.re/T5I5KNLW Ok, now I'll explain why the script provides an Initial key tag too, haha . Actually is a hidden bonus, for those that maybe use this plugin https://getmusicbee.com/forum/index.php?topic=24631.0 for Musicbee, that tag is needed for that plugin to work. I used MusicBee a few years ago, for one year, I still have that configuration so I thought : hmmm, let's add this tag too, who knows what might happen in the future, hahaha, what if foobar goes x64 and many components will not work ? :)
Anyway, the final version of the script, it adds only camelot notation in Key tag (Initial key tag it's not present anymore): http://sendanywhe.re/6452ULMS (you've probably corrected that mistake already, haha, but maybe someone else will find it useful)


Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-20 09:30:52
You found a better solution, thanks for those scripts for CUI :)

''Btw @Koshingg , why does that masstagger script provide both an initial key and a key tag when you already have a key tag? (in fact it gets cleared and replaced with ?)  ''
It's great that you found that error. Here is the new version without that error (and with Initial Key) tag : http://sendanywhe.re/T5I5KNLW Ok, now I'll explain why the script provides an Initial key tag too, haha . Actually is a hidden bonus, for those that maybe use this plugin https://getmusicbee.com/forum/index.php?topic=24631.0 for Musicbee, that tag is needed for that plugin to work. I used MusicBee a few years ago, for one year, I still have that configuration so I thought : hmmm, let's add this tag too, who knows what might happen in the future, hahaha, what if foobar goes x64 and many components will not work ? :)
Anyway, the final version of the script, it adds only camelot notation in Key tag (Initial key tag it's not present anymore): http://sendanywhe.re/6452ULMS (you've probably corrected that mistake already, haha, but maybe someone else will find it useful)



Didn't know that plugin. Seeing what it does, it's pretty similar (but limited to a subset of tags and features). Musicbee is a great program btw and has many built-in features that foobar misses (or only found on plugins).

You can pretty much replicate its behavior by setting style, date and other tag weights not used to zero. Key weight can be set to zero (so it doesn't look for similar keys), and enabling harmonic mixing on search by distance buttons (properties or custom one). Thus it will only use BPM, genre, energy (you can set it as a custom tag) and keys (only for harmonic mixing). The method may be set to graph to allow a more variate list of related genres, instead of using simple matching.

Only thing left is rating, but you can use global forced query to discard 1 or 2 rated tracks. (that's the default query in fact). I'm not sure rating should be added in any other way... since it would clearly favor high rated tracks instead of using all above the limits set.

Finally, those settings can be saved as a preset (recipe) to easily switch functionality when needed. I will add that recipe in next release. Feel free to suggest other mixes ideas, I perfectly know the "main weakness" of these scripts is their complexity (also its strength since they can  be fine tuned to do anything), so more examples and recipes will be welcomed by many.

Will check the masstagger scripts again, thanks :)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-20 10:16:48
Just updated the custom buttons to show the current value on the menus (no need to click on them or open properties).
It also shows the value if set(forced) by the recipe. Also added a submenu for the weights and ranges (not available previously).
Replace file 'buttons_sbd_menu_config.js' at 'helpers' with the one provided to update.

X

Also added the mentioned recipe 'LikeADJ (MusicBee).json'. Install it on 'presets\Search by\recipes\' so it gets automatically shown on the recipe list within foobar.

All this will be added to the repository when I update it.

EDIT: Btw if you know what 'Energy' is I would appreciate it. Mixed in Key offers that tag, but I don't have the software. As far as I have seen it relates to danceability. So chill is 0. Since I strongly prefer open source solutions, musicBrainz offers some high level data similar to that.
https://essentia.upf.edu/svm_models/accuracies_v2.1_beta1.html
In particular danceability and moods (relaxed/party)

And low level data:
https://essentia.upf.edu/reference/streaming_Danceability.html
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-20 17:10:22
Well, it seems they're 2 different things :
Danceability: Describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity.
Energy: Represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. High-Energy tracks have increased entropy, and tend to feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale.
Mixed in Key adds the value for Energy from 1 to 10 (AFAIK it's the only software to do that, maybe that has changed lately, I didn't checked in the last 1-2 years) ,But some people add that value manually, values are added from 1-5.

I have these errors for Search by distance and Playlist Manager (even using the dev build for SMP, WINDOWS 10, latest stable version of foobar)
Error: Spider Monkey Panel v1.5.2-dev+327ba5dc ({311F3B08-764E-4315-8AB1-BF3F99B97668})
include failed:
Path does not point to a valid file: helpers\buttons_xxx.js

File: <main>
Line: 35, Column: 2
Stack trace:
  @:35:2

Error: Spider Monkey Panel v1.5.1 (Playlist Manager: Playlist Manager v0.2 by XXX)
include failed:
Path does not point to a valid file: helpers\helpers_xxx.js

File: <main>
Line: 27, Column: 1
Stack trace:
  @:27:1

Error: Spider Monkey Panel v1.5.2-dev+327ba5dc (Playlist Manager: Playlist Manager v0.2 by XXX)
include failed:
Path does not point to a valid file: helpers\helpers_xxx.js

File: <main>
Line: 27, Column: 1
Stack trace:
  @:27:1

Should I report this to SMP thread? Probably I should since I have another error from this component caused by other scripts (Biography , Library Tree)

Also, it seems I can't remap the key tag. I made a gif for you, http://sendanywhe.re/SBJKBHJ5 maybe you see where the problem is.
I tried to remap the key tag with : INITIALKEY or INITIAL KEY, but it doesn't work

"Feel free to suggest other mixes ideas"
Ok, I will, maybe not necessary ideas about mixes , but just a few ideas about various things
Nice to see that recipe 'LikeADJ (MusicBee) in Foobar too, haha.

Hmm, I remembered something.....
There is a way to get Energy tag (and other tags) but you have to do it manually
You need Spotify (free account, so you don't have to pay anything). Unfortunately we don't have this https://getmusicbee.com/addons/plugins/306/musicbeesynctoservice/  (Maybe someone can do it, I know there is a Spotify plugin for Foobar, but it's only for Premium users, and I don't think it can synchronize playlists ,from foobar to Spotify and from Spotify to Foobar.) But we can use this https://www.tunemymusic.com/#step1 (you can export a foobar playlist and then you can import that playlist in Spotify.
Then we can import that playlist from Spotify , here http://organizeyourmusic.playlistmachinery.com/#
Now, in Foobar (in that playlist that we have exported), we can add values (manually) to these tags :
Year
Genre
BPM
Energy
Danceability
Loudness (dB)
Liveness
Valence
Acousticness
Speechiness
Popularity
Maybe there is a possibility to do it automatically ? Manually it's obviously not ideal, maybe for a few playlists ...

Some links, maybe they're useful:
https://www.rcharlie.com/spotifyr/
https://www.kaylinpavlik.com/classifying-songs-genres/
https://towardsdatascience.com/what-makes-a-song-likeable-dbfdb7abe404
https://developer.spotify.com/documentation/web-api/reference/#endpoint-get-audio-features
http://www.playlistmachinery.com

Btw, if you didn't downloaded those scripts for masstagger because the links have expired, you can download both of them from here http://sendanywhe.re/APATMI1Y



Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-21 09:23:42
That's the relative path bug... already reported at SMP. I can't do anything but revert the change to absolute paths until @TheQwertiest gives us an answer.

Quote
Danceability: Describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity.
Energy: Represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. High-Energy tracks have increased entropy, and tend to feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale.
Mixed in Key adds the value for Energy from 1 to 10 (AFAIK it's the only software to do that, maybe that has changed lately, I didn't checked in the last 1-2 years) ,But some people add that value manually, values are added from 1-5.
On the other hand, they can be perfectly similar without knowing how energy it 's really calculated hahahaha I mean, even if the descriptions are "different", I would think both variables match for the examples you gave. In fact the one at essentia is also a scale.
https://essentia.upf.edu/reference/std_Danceability.html

In fact according to their patent they may be equivalent:
https://patents.justia.com/patent/8865993

If you are interested on test it, I could give you a set of samples tagged with Danceability values to analyze them in mixed in key. If there is correlation, I could support both as equivalent variables. (in its own variable, instead of using the custom one for the user)

Quote
Also, it seems I can't remap the key tag. I made a gif for you, http://sendanywhe.re/SBJKBHJ5 maybe you see where the problem is.
I tried to remap the key tag with : INITIALKEY or INITIAL KEY, but it doesn't work
Oh! You are mixing scripts hahahaha Ok... this script is the left one. What you configure there obviously only works there!
You are talking about Playlist Tools (so you would have to write that at its thread). Key tag is hard-coded there yep, forgot to change that. In fact, in no way (even it they were the same script) it could work as you did... 2 panels can not share their config and they should not! (it could be done but I see no reason to do that, since it's up to you how you want to config different panels). Also note they are 2 different things with different aims. Using harmonic mixing with Playlist Tools just remixes the current playlist. Search by Distance creates a new playlist using a complex algorithm exactly like the links you provided.

I thought you were using the custom search by distance buttons to create playlists by similarity, obviously, and there it works (it also has an harmonic mix method).

Also a question, why are you adding those buttons in 3 panels? you can merge them in one (see tooltip at background).
And... why don't you add the bar to the top? If you rigth click on the top bar you can add a SMP panel as a toolbar ;)

Note that I created a framework to have a buttons bar, but that doesn't mean that a config set at a button applies to the other buttons. This is by design, you must configure each tool separately (even if they are in the same panel). Being in different panels applies the same.

Spoiler (click to show/hide)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-21 09:28:53
Now, in Foobar (in that playlist that we have exported), we can add values (manually) to these tags :
Year
Genre
BPM
Energy  -> previous comment
Danceability -> previous comment
Loudness (dB) -> replay gain does that (see my UI scripts at presets)
Liveness
Valence -> these are moods, picard (essentia) gives them
Acousticness -> with a % picard (essentia) gives it too. BUT I find it better to simply look for an Acoustic tag/mood. Not a percentage. This is already done on Search by Distance.
Speechiness -> with a % picard (essentia) gives it too. BUT I find it better to simply look for an Instrumental tag/mood. Not a percentage. This is already done on Search by Distance with an additional logic to scatter instrumental tracks.
Popularity -> last fm popularity?
Maybe there is a possibility to do it automatically ? Manually it's obviously not ideal, maybe for a few playlists ...

In any case, you can add those tags to the custom tag. BUT I have to think about adding more, since some of them are more valuable in Spotify than here. Spotify suggests new -meant to be popular- songs, this plugin creates a playlist by similarity. I'm not gonna suggest a song everybody should like according to a predefined variable (that's precisely what I dislike about online players hahahaha), but only suggest songs similar to the ones you selected. In that sense a "popularity" variable is useless to me, although I know many people love playing the most popular songs according to a chart.... there is Find & Play by @WilB  for that.

I could add more low level data though, but I already think most users are not even using 30% of the capabilities of this script... lets not talk about adding more! (this doesn't equal to a "No", but it's not a priority since probably I will be the only one using it)

AcousticBrainz Tags
Quote
Tag files with tags from the AcousticBrainz database, all highlevel classifiers and tonal/rhythm data.

By default, only simple mood and genre information is saved, but the plugin can be configured to include all highlevel data.
AcousticBrainz Tonal-Rhythm
Quote
Add's the following tags:

    Key (in ID3v2.3 format)
    Beats Per Minute (BPM)

from the AcousticBrainz database.
https://picard.musicbrainz.org/plugins/

EDIT:
https://towardsdatascience.com/what-makes-a-song-likeable-dbfdb7abe404
For example that link you gave me exactly represents what I dislike about using data to predict what we like or how to "create a hit". It's like saying we like X because we listen to X thus we should create more tracks like X since we love X. Therefore, we continue listening to X and liking X. And so on... works, but makes zero sense to me. That's about music as a product, not about relations between different tracks, genres, etc. It's even more stupid when you think... hey if you wanted to tell me to do X because we love X, you didn't need at all to study the tracks with such detail. Just tell me to replicate the current 40 top charts and done.

Something similar happens with 'Similar artists' thing which works for occidental music but nothing more. And it only outputs the "most popular" artists because it's heavily based on popularity and user listening habits. I really dislike such biased approaches to music.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-21 10:15:37
http://www.playlistmachinery.com/
You can do that with pools at playlist tools. And even use playlists as sources (see playlist manager integration). And that's why I say most people are not using even 30% of what I did hahahaha You have macros, pools and dynamic queries (evaluated with selection) at Playlist Tools, that should cover any imaginable thing you want to do to create your own mixes.

https://www.kaylinpavlik.com/classifying-songs-genres/
That's already done at Music Brainz, using machine learning and those features. Genre classification only has a 50-60% precision anyway. But it's there if you want it. No need to reinvent the wheel, and it's open source.

https://www.rcharlie.com/spotifyr/
That's something which may be useful for the spotify plugin, you could suggest it there.

EDIT: About the key thing at Playlist Tools
https://hydrogenaud.io/index.php?topic=120978.msg1000973#msg1000973
Title: Re: Search-by-Distance-SMP
Post by: jazzthieve on 2021-07-21 17:05:50
Just a small correction, you say Valence attribute is the same as moods which isn't fully correct. Based on Robert Thayer's mood classification model (Spotify uses this model, among others) mood classification is a combination of Valence in relation to Energy. Valence by itself doesn't say that much. High Valence with high energy means a very upbeat happy song while the same energy with low valence is a high stress/agressive song. Low Energy with low Valence is a sad song while a high valence and low energy song is a relaxing mood.
High valence by itself could both mean very upbeat and happy or just relaxing (and everything in between).

https://sites.tufts.edu/eeseniordesignhandbook/2015/music-mood-classification/

I manually tag my library using this model. I always use both attributes (Valance, Energy) on the same scale. The numbers I tag are coordinates plotted on an X-Y graph and depending on where the position of the coordinates fall I derive meaning from them ("moods", but it's a bit more abstract).
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-21 17:42:20
Well I didn't mean they are strictly the same (low level data), obviously, but I consider them a replacement (high level data). Specially since I was talking about usable open source data (since Spotify's data is not that).
Essentia cites a lot of research on that sense: https://essentia.upf.edu/research_papers.html

In fact none of the Essentiadata is strictly the same. Danceability in Spotify uses different scales and model than the one at Essentia. But I assume they are equivalent as long as you know in which model you are working and what you do with it.

Quote
I manually tag my library using this model. I always use both attributes (Valance, Energy) on the same scale. The numbers I tag are coordinates plotted on an X-Y graph and depending on where the position of the coordinates fall I derive meaning from them ("moods", but it's a bit more abstract).
How do you tag them manually?
Title: Re: Search-by-Distance-SMP
Post by: jazzthieve on 2021-07-22 06:48:45
it's rather simple, I use a masstagger script to tag and split (multivalue) series of numbers (usually 2 but can be up to 6 numbers). I bind that script to keyboard shortcuts (alt+numpad). The first number input is the X axis coordinate (Valence), the second number is the Y-axis coordinate (Energy). The scale goes from 1 to 7 (both axis). I created a map to visualize it for myself. On my config I have a panel that shows me this:
(https://i.ibb.co/wgsHDr9/Thayer.jpg)

It gives me essentially 4 quadrants of "mood" variations. Left upper is high energy, low valence = unsettling, aggression (I colored this red). Right upper is high valence, high energy =upbeat and happy (yellow color). Left lower is somber, sad melancholy (blue color). Right lower high valence but low energy= generally relaxing.

Combinations are possible (max 3 sets of coordinates). I also have a masstagger script which translates the numbers into a normal mood tag. For now I just say either aggression, upbeat, relaxing, sad depending on in which quadrant the coordinate falls but in essence if I were to assign each separate coordinate a certain mood name I'd have 36 separate combinations. But I don't need to name them, I basically just look at the coordinates and immediately know how the song will feel. Example

3;6 : agressive but not extreme (heavy metal music for example)
1;7: very aggressive, very extreme (brutal death metal)
7;6 very upbeat and energetic (like the intro song from the movie La LA land)
6;2: positive sounding and relaxing (soft upbeat but relaxing reggae music)
1;2: basically a song that will make you cry

All is done with titleformatting because I know shit about coding. There are other aspects I include with this mood model but I'll stick to just explaining this. I too developed a method to easily create selections which groups songs based on genre, mood, song complexity, and era by just using "quicksearch for same". It's done in a more manual fashion and without sourcing data from the internet but it works for me  (and it's highly accurate). But I do admire what you're doing.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-22 09:00:54
That looks interesting although it's a nightmare to tag an entire library manually if you start from scratch! I have done that for genre/styles instead of using online tags, since they are mostly a joke. The graph is the natural representation of a proper genre map as a result . I used MusicBrainz for mood tagging since it has an accuracy over 90%, so it's fine for me. Then I manually re-tag any obviously wrong track on playback from time to time.

You can use your method with these scripts too (don't think they require at all internet sourced tags) as long as you have genre/style tags. You can even use those numeric tags as the custom num tag, so it works with your tagging method. (or using the mood tag if you translate your values into moods with masstagger first)

I know 'the quicksearch for same 'component. An improvement over that is that this one doesn't use queries, but assigns an score similarity. Queries are too restrictive (although they work) because tracks are either in or out of your group. An scoring allows you to fine-tune the degree of similarity. Then there are a dozen of other features which can be used to create the playlist, while the query approach just outputs all matches.

Btw at Playlist Tools you have tools which use queries too. In fact, probably you would be more interested on them. There are dynamic queries (its 100% equal to Quicksearch for same functionality but allows more advanced queries like multitags, multiple expressions, etc.). and queries combinatory. Let's say you want any track which must match at least 3 of these: Sad, Acoustic, Rock, Instrumental, key Abm:. Doing that manually is not feasible (a combination of queries takes easily 10 lines as soon as you have +3 elements) and it's out of scope for quicksearch component. You have it in the Playlist Tools button an also as an independent configurable button.

X

Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-22 09:51:49
Have simplified the code of the masstagger key presets since they had another problem, they removed already existing tags (since it used some of them as intermediate values). Now they give only one tag per script (a new one or a replacement) and don't remove any other.

There are 3 versions now:
- Standard notation to Camelot notation. key (*) -> %KEY%
- Standard notation to Camelot notation. key (*) -> %INITIAL KEY%  (recreates new tag, like Mixed in Key)
- Camelot notation to Standard notation. key (*) -> %KEY%  (the reverse of the previous ones)

(*) key at left will use any of these as sources: %INITIAL KEY%, %INITIALKEY%, %KEY_START%, %KEY%, %KEY_CAMELOT%, %KEY_OPENKEY%

In any case, the other tags are not touched at all and will be left as is. Also note these presets are NOT NEEDED at all for the SMP scripts since the translation is done automatically on the code. Neither to show the translated values at UI (https://hydrogenaud.io/index.php?topic=120982.msg1000798#msg1000798).  Just sharing them for other uses. They will be present on the repository at '.\presets' folder.

PD: Back to this SMP script, I will add open key support on next releases too, translating internally that notation to camelot keys. Obviously it will be ported to Playlist Tools too for harmonic mixing. Finally, I will add 4 more masstagger presets to translate standard keys and camelot keys to open keys and back. And edit the UI presets to also support open key notation.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-22 12:00:59
"Oh! You are mixing scripts hahahaha "
haha, yes, somehow I managed to do that. But at least the little problem is solved now, the tag key it's not hard-coded anymore , in Playlist Tools

''Also a question, why are you adding those buttons in 3 panels? you can merge them in one (see tooltip at background).
And... why don't you add the bar to the top? If you rigth click on the top bar you can add a SMP panel as a toolbar''

That wasn't my main foobar configuration, it's just a portable foobar for testing. I have the scripts in my main foobar config. too and I was thinking to add a new tab (because it's not ideal how they are placed now) with your scripts, and a few other things for manual tagging, all in one place

 "I could give you a set of samples tagged with Danceability values to analyze them in mixed in key''
regor , I don't have mixed in key

"For example that link you gave me exactly represents what I dislike about using data to predict what we like or how to "create a hit....hey if you wanted to tell me to do X because we love X, you didn't need at all to study the tracks with such detail. Just tell me to replicate the current 40 top charts and done"

haha, I agree with you, I just sent those links in the eventuality that maybe you'll find something interesting

"AcousticBrainz Tonal-Rhythm"
Thanks about the tip , I already had that plugin BUT I didn't noticed those settings (about highlevel tags)

"most people are not using even 30% of what I did hahahaha You have macros, pools and dynamic queries''

I think you're right, I didn't used macros and pools until now, but I will , I also added a few dynamic queries. But it's very very good that options do exist, people have different needs .  I'll use much more than 30% :)

For those interested to add ENERGY, DANCEABILITY, ACOUSTICNESS, INSTRUMENTALNESS, LIVENESS, SPEECHINESS, VALENCE and AUDIO_FEATURES ( for ex. #dynamics-med; #energy-high; #vocal-high; #neutral), there is another option ( Picard can do this too, and a bit more, as regor said) : https://onetagger.github.io/#download
I'm not saying it's better than Picard but strictly for adding these tags it seems it does a better job, it's faster.

regor, I didn't said you should or you shouldn't add more low level data (as you said the scripts are already complex), just that it's fun to have more data in your tags, haha. Those tags can be used with dynamic queries (Playlist tools), or for example a very simple use, just sort a playlist after Danceability (or other tag) , from the highest value to the lowest. Obviously they're not 100% accurate (the same happens for Key, or BPM)




Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-22 12:32:19
regor, I didn't said you should or you shouldn't add more low level data (as you said the scripts are already complex), just that it's fun to have more data in your tags, haha. Those tags can be used with dynamic queries (Playlist tools), or for example a very simple use, just sort a playlist after Danceability (or other tag) , from the highest value to the lowest. Obviously they're not 100% accurate (the same happens for Key, or BPM)
Glad it's solved. I will upload the latest changes to the repositories, although most people seem to have problems due to the SMP bug so...

As you noted, you can use any arbitrary tag on Playlist Tools for queries, whether you use dynamic queries, standard queries, sorting or Search same by. And save those entries for later use. My concerns are about adding them at this particular script since it must comply with some open source data standard, and those tags must be easily retrievable by other users. That's why I have limited the subset of 'exotic' tags to BPM, KEY, MOODS which can be retrieved by picard, but also by Bio script, multiple DJ software, etc.

Arbitrary tags may be added to the 2 custom fields by anyone. Also multiple tags may be merged into one slot. So if you want to use those arbitrary tags as 'moods' you can simply set Moods -> Moods,Valence,Danceability. It works the same, no need to create an additional slot. Only consideration: string slots must use string tags. Numeric slots must use numeric tags.

Now, the last program you linked finally appears to be a real alternative/complement to Picard and AcousticBrainz data.... so I will study its use, how tags are being added, etc. and If I found it in line with the rest, I would gladly implement those other tags. Have to check if it needs Spotify installed, since I would need to bypass that limitation because I don't have an account.

On the other hand, those are 'intermediate' level data because they are neither final tags (Acoustic, Instrumental, ...) nor low level data so some considerations must apply here. Otherwise I would be duplicating work and results: if you already use Acoustic as a genre tag and/or moods (picard), it makes no sense to also check for Acousticness since both give you the same info. It would make tracks with the 3 tags being more similar than they are, since I would be adding a score to the 3 features. In other words, it would require either the user having to choose between 2 models (AcousticBrainz vs Spotify) or discarding some features if others are present (and that's really complicated). (*)

(*) I would have to check for things like if a track is using Instrumental genre/mood tag, then Instrumentalness = 100%. But only one of them should be scored. And finally another track may have Instrumentalness but not the other tags, so I would have to compare the previous virtual tag to it... and it easily becomes a mess.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-22 17:58:50
I forgot to add that there is a difference about the way the data is added in those tags. One Tagger uses the Spotify model (which I think it's much much easier for the normal Foobar users, and I assume it's easier for you, in SMP, if you ever decide to use those tags). Picard's model I think it's more difficult (better said it's almost useless) for normal users because it's harder to use those values from tags.
For example , for Danceability :
in Picard , we have 2 tags, with these values
AB:HI:DANCEABILITY:DANCEABLE                   0.973414301872
AB:HI:DANCEABILITY:NOT DANCEABLE          0.0265856720507

In One Tagger, only one tag, easier:
1T_DANCEABILITY                        78

I noticed an interesting tag in Picard (gender tag), it's not offered by One Tagger :

AB:HI:GENDER:FEMALE             0.972042262554
AB:HI:GENDER:MALE                 0.0279577393085
This is a song by Janet Jackson.
Is it possible to add a gender filter ( for CUI filters , Album list panel, Library tree SMP, or other option) , using the data from those 2 tags?
If it is possible I could use Picard for this.
Another thing, I noticed that One tagger finds results for more songs, maybe it's possible that Spotify's data base is larger (or maybe it only happened to me).
Btw, if Spotify is not available in your country, and you need it to use One tagger (client id and client secret)I guess I can make an account for you and give you those dates.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-22 18:16:11
I forgot to add that there is a difference about the way the data is added in those tags. One Tagger uses the Spotify model (which I think it's much much easier for the normal Foobar users, and I assume it's easier for you, in SMP, if you ever decide to use those tags). Picard's model I think it's more difficult (better said it's almost useless) for normal users because it's harder to use those values from tags.
For example , for Danceability :
in Picard , we have 2 tags, with these values
AB:HI:DANCEABILITY:DANCEABLE                   0.973414301872
AB:HI:DANCEABILITY:NOT DANCEABLE          0.0265856720507

In One Tagger, only one tag, easier:
1T_DANCEABILITY                        78

I noticed an interesting tag in Picard (gender tag), it's not offered by One Tagger :

AB:HI:GENDER:FEMALE             0.972042262554
AB:HI:GENDER:MALE                 0.0279577393085
This is a song by Janet Jackson.
Is it possible to add a gender filter ( for CUI filters , Album list panel, Library tree SMP, or other option) , using the data from those 2 tags?
If it is possible I could use Picard for this.
Another thing, I noticed that One tagger finds results for more songs, maybe it's possible that Spotify's data base is larger (or maybe it only happened to me).
Btw, if Spotify is not available in your country, and you need it to use One tagger (client id and client secret)I guess I can make an account for you and give you those dates.
Picard gives that data, but you are not supposed to use it as you did. I.e. it gives:
Code: [Select]
variable A: {
       value: Y,
       X: 40%,
       Y: 60%,
}
You may extract X and Y as you did, or just extract the bigger one, which is considered the actual "tag" (value). Spotify just gives you the percentage, but not the tag. i.e. it gives a number, but you have to convert that into actual tag values (danceable, not danceable). You simply have to configure it right. This is an example of the data that can be extracted (note some low level data and high level data have same name but are different things!)
https://acousticbrainz.org/373d355f-faae-4851-9022-11bcc4144ed3

Use cases are different. I see totally useless a percentage on queries ;) but obviously in SMP it can make sense. So in fact I disagree and I find more useful to have tag names (acoustic, danceable, party) than numbers on foobar2000, while it may be the opposite for a similarity scoring method.

About it finding more songs... yes and no. Let me remind you Spotify is closed source data. If I don't find a CD on picard I can submit it, there is a plugin which even copies the actual info from tracks and opens the web in your browser with that data. It takes 15 seconds to add a release. Then I can run their analysis tool on my PC and submit the data. Some time later if I reload the same album at picard it will be recognized and the data (mood, key, bpm, etc.) will be there ready to be saved on my files. Good luck doing that with Spotify hahahaha

I mean, they are different tools from different frame-minds. You can not add any data to One Tagger, you can only use what's there. If some release is missing you are out of luck, while the open source approach lets you collaborate and add those pieces. Obviously Spotify is the winner if we talk about which one has the bigger database... but not necessarily the one which satisfies everyone needs. One Tagger is also using discogs to tag releases, which is clearly out of scope for Piccard (and I agree it's a bigger database too).

In any case I'm not suggesting to use Picard for standard tagging (I use discogs) but only for Mood, BPM, key, etc. Composers are also a plus. And there you have too instruments, relationships,etc.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-22 18:41:19
Well first discogs requires an account, the rest of the servers are mant for DJs (electronic music). So it's not as pretty as it seemed.
The audio features requires an spotify account as suspected.
Tried with a rolling stones album (12x5) with no luck hahaha
It also doesn't use any fingerprinting, so it looks for tags only if you filled some of the basic ones (or by filename). While picard recognizes audio even if it has zero tags.
Drag n drop is broken, it uses an electron interface and tries to reproduce the files instead of using them to find tags! You can drag n drop folders into picard without problems. Tag saving is not done automatically, you can discard/accept changes, here it's done without notice.
etc.
Picard gives you different releases to choose from. Discogs would allow you to do that, but the way it's implement limits that option since it's done all automatically.

Can not check the spotify audio features without an account, so at least the only part that would be really useful is out of my reach. Sorry for being so critic, but as a standard tagger it really sucks hahahaha (greatly prefer mp3tag+discogs, or picard or foobar+discogs) I will try to create an spotify account to test it more.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-22 19:32:29
I think this gif shows most of the problems I mentioned:
Spoiler (click to show/hide)

But will try the Spotify thing since that was the main point anyway.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-07-22 22:30:16
It's my fault , I should have warned you, haha. But now you understand why I didn't mentioned not even a single word about One Tagger's capabilities as a standard tagger, because it can't compete with Picard or other programs. It's meant to be used mostly by Dj
It's still a new software, it appeared 2 or 3 months ago, so we can't really compare anything. It will never be like Picard, MP3tag, or others, just a simple , maybe faster solution for some that don't need many features.
What I liked (I didn't even tested anything else) was only one thing, the Spotify implementation (which I think it's missing from other programs, no?),  it's also free . Obviously I would be glad if Spotify implementation appears in other programs, then I will not use One Tagger at all, haha . There is room for everybody, I also use Mp3tag, Picard, or Jaikoz Tagger

"Sorry for being so critic''
No problem, it's not my software :) As you said, they're different tools, even though they're both taggers, haha, they have a different vision and use

Hmm, I didn't quite understood you here ,about my question with the gender tag, sorry :
''You may extract X and Y as you did, or just extract the bigger one, which is considered the actual "tag" (value). Spotify just gives you the percentage, but not the tag. i.e. it gives a number, but you have to convert that into actual tag values (danceable, not danceable). You simply have to configure it right. ''

How can I get the actual "tag" (value)? I don't want a number in Gender tag, I want Male or Female. There's a setting in Picard? (I didn't find it) Or is something more complicated?




Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-23 08:41:11
Its supposed that you may configure the plugin in such a way that you simply get the tag value (male) instead of numbers for both values. When I created a plugin for picard I did it that way (and that's what I use), have not tested it since then with that new plugin which extracts all data. I will take a look at it and report, since there must be a way. Either in the program or editing the plugin, if it's the latter I will upload my own fork of it.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-07-24 20:59:36
Have updated the repository with the new menus to remap all missing tags, set weights, etc. This:
https://hydrogenaud.io/index.php?topic=120982.msg1000945#msg1000945
Also added the presets (masstagger) and a great optimization on speed for harmonic mixing.

If anyone want to test it, download the files directly from the repository not the releases. Please have in mind the relative path bug on SMP has not been solved yet, so I have no idea if it will work for you!
(it's recommended to also download the latest files from the rest of my scripts in that case, since I have changed all with major changes)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-08-04 10:15:06
I forgot to add that there is a difference about the way the data is added in those tags. One Tagger uses the Spotify model (which I think it's much much easier for the normal Foobar users, and I assume it's easier for you, in SMP, if you ever decide to use those tags). Picard's model I think it's more difficult (better said it's almost useless) for normal users because it's harder to use those values from tags.
For example , for Danceability :
in Picard , we have 2 tags, with these values
AB:HI:DANCEABILITY:DANCEABLE                   0.973414301872
AB:HI:DANCEABILITY:NOT DANCEABLE          0.0265856720507

In One Tagger, only one tag, easier:
1T_DANCEABILITY                        78

I noticed an interesting tag in Picard (gender tag), it's not offered by One Tagger :

AB:HI:GENDER:FEMALE             0.972042262554
AB:HI:GENDER:MALE                 0.0279577393085
This is a song by Janet Jackson.
Is it possible to add a gender filter ( for CUI filters , Album list panel, Library tree SMP, or other option) , using the data from those 2 tags?
If it is possible I could use Picard for this.
Another thing, I noticed that One tagger finds results for more songs, maybe it's possible that Spotify's data base is larger (or maybe it only happened to me).
Btw, if Spotify is not available in your country, and you need it to use One tagger (client id and client secret)I guess I can make an account for you and give you those dates.
Back to the topic, the answer was scripting. Picard allows automatic scripting, so those multiple tags can be used to set only once with numbers or labels.

To get a label:
Code: [Select]
$set(timbre,‎$if($gte($substr(%ab:hi:timbre:bright%,2,3),5),Bright,Dark))
To get a number from 0 to 100:
Code: [Select]
$set(brightness,‎$substr(%ab:hi:timbre:bright%,2,4))

Note AcousticBrainz tags are complementary, i.e. ab:hi:timbre:bright and ab:hi:timbre:dark should sum 1... so only one of them is needed for scripting.

X

X

X

X

Applying the same principle to every tag, you may get full labels for all the data tags and also one number per set of tags (danceability, gender, etc.).

Finally you can remove the unwanted tags:
Code: [Select]
$unset(ab:hi:timbre:bright)
$unset(ab:hi:timbre:dark)
...

As can be seen, it's really hard to improve this workflow... since scripting allows you to do almost anything at picard (without needing to use masstagger at a later point at foobar). In conclusion, I still find better to use AcousticBrainz data since it's open source, does not require a third party api key by a closed source program (spotify), allows scripting to modify tags to your needs and offers both full tag labeling and/or raw values (numbers) to be used at a later point by other programs or scripts (foobar and SMP). Not saying I will not look at the spotify thing, but right now  I can assure this works.

Also I know regular users are "not capable" of writing such scripts for picard... but in that case they are also not capable of setting onetagger with an spotify api or setting these SMP scripts right to use those tags. In all cases it only requires a bit of time and attention...

As a solution, I will write myself the full set of picard's scripts which along the plugin should provide all the desired tags: gender, timbre, danceability, etc. with labels and/or single number (per set of tags). Only work left at user's side would be to install the required plugin, copy/paste the scripts and decide which tags they want to retrieve. I use pìcard too so makes sense to release it publicly. That should cover all problems you have with picard while also fulfilling all the requisites.

Right now I will put my efforts only in the tagging part. Those extra tags may be used -now- as custom string tags and custom num tags on Search by Distance. Also as queries in Playlist Tools. At some point I may implement them as default tags with their own logic.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-08-05 09:06:02
Got the scripts workings and managed to retrieve/create these variables:

Code: [Select]
timbre -> bright/dark
brightness -> 0-100
danceability -> 0-100 (would prefer to move this to danceness, and use this one for Danceable/not Danceable) (*)
gender -> female/male
femaleness -> 0-100
tonality -> tonal/atonal
tonaleness -> 0-100
speechiness -> 0-100
acousticness -> 0-100 (uses mood acoustic as reference)
valence -> 0-100 ((mood happy + mood not sad) / 2) (**)
chords rate -> 0-100
chords key -> ...

(*) Would break Spotify's data direct comparisons
(**) Should be equivalent to Spotify's one


Will release them as soon as a bug is solved, since working with the scripts found the acousticBrainz plugin broke some scripts:
https://tickets.metabrainz.org/projects/PICARD/issues/PICARD-2256?filter=addedrecently
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-08-05 17:56:58
With your help, things look much much better for Picard, I will use the scripts definitely.  Btw, I didn't used scripts in Picard, until a few days ago, when I added 2 scripts
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-08-06 11:27:42
Please update AcousticBrainz Tags plugin to last version (2.2). It's a requisite, has a fix for the bug I found.
Then add these 3 scripts. Edit as needed if you want to have/delete only specific tags.
Also check the order. The "remove" script should be at the bottom (see image 1).

AcousticBrainz Tags Number
Code: [Select]
$noop(Sets -number- tags from AcousticBrainz high/low level data)
$noop(Recommended to removes all high/low level data afterwards)
$noop(Requires: AcousticBrainz Tags plugin 2.2+)
$noop(Requires: All high-level and subset of low-level tags enabled at plugin config)

$noop(Timbre tags: brightness -number-)
$set(_temp,%ab:hi:timbre:bright%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(brightness,%_temp%)

$noop(Danceability tags: danceness -number-)
$set(_temp,%ab:hi:danceability:danceable%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(danceness,%_temp%)

$noop(Gender tags: femaleness -number-)
$set(_temp,%ab:hi:gender:female%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(femaleness,%_temp%)

$noop(Voice/Instrumental tags: speechiness -number-)
$set(_temp,%ab:hi:voice_instrumental:voice%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(speechiness,%_temp%)

$noop(Acousticness tags: acousticness -number-)
$set(_temp,%ab:hi:mood_acoustic:acoustic%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(acousticness,%_temp%)

$noop(Valence tags: Valence -number-)
$set(_tempA,%ab:hi:mood_happy:happy%)
$set(_tempB,$get(ab:hi:mood_sad:not sad))
$if($eq($substr(%_tempA%,2,3),0),$set(_tempA,$substr(%_tempA%,3,4)),$set(_tempA,$substr(%_tempA%,2,4)))
$if($eq($substr(%_tempB%,2,3),0),$set(_tempB,$substr(%_tempB%,3,4)),$set(_tempB,$substr(%_tempB%,2,4)))
$set(valence,$div($add(%_tempA%,%_tempB%),2))

$noop(Tonality tags: tonaleness -number-)
$set(_temp,%ab:hi:tonal_atonal:tonal%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(tonaleness,%_temp%)

$noop(Chords tags: chords_rate -number-)
$set(_temp,%ab:lo:tonal:chords_changes_rate%)
$if($eq($substr(%_temp%,2,3),0),$set(_temp,$substr(%_temp%,3,4)),$set(_temp,$substr(%_temp%,2,4)))
$set(chords_rate,%_temp%)

AcousticBrainz Hi Tags Labels
Code: [Select]
$noop(Sets -label- tags from AcousticBrainz high/low level data)
$noop(Recommended to removes all high/low level data afterwards)
$noop(Requires: AcousticBrainz Tags plugin 2.2+)
$noop(Requires: All high-level and subset of low-level tags enabled at plugin config)

$noop(Timbre tags: timbre -label-)
$set(timbre,$if($gte($substr(%ab:hi:timbre:bright%,2,3),5),Bright,Dark))

$noop(Danceability tags: danceability -label-)
$set(danceability,$if($gte($substr(%ab:hi:danceability:danceable%,2,3),5),Danceable,Not danceable))

$noop(Gender tags: gender -label-)
$set(gender,$if($gte($substr(%ab:hi:gender:female%,2,3),5),Female,Male))

$noop(Tonality tags: tonality -label-)
$set(tonality,$if($gte($substr(%ab:hi:tonal_atonal:tonal%,2,3),5),Tonal,Atonal))

$noop(Chords tags: chords_key -label-)
$set(chords_key,%ab:lo:tonal:chords_key%)

AcousticBrainz High_Low Tags Remove
Code: [Select]
$noop(Removes all high/low level tags retrieved by AcousticBrainz Tags plugin)
$noop(Meant to be used along other scripts which uses this data first)
$noop(Requires: AcousticBrainz Tags plugin 2.2+)

$noop(ISMIR2004 Rhythm Classification Dataset "Ballroom dataset")
$unset(ab:hi:ismir04_rhythm:chachacha)
$unset(ab:hi:ismir04_rhythm:jive)
$unset(ab:hi:ismir04_rhythm:quickstep)
$unset(ab:hi:ismir04_rhythm:rumba-american)
$unset(ab:hi:ismir04_rhythm:rumba-international)
$unset(ab:hi:ismir04_rhythm:rumba-misc)
$unset(ab:hi:ismir04_rhythm:samba)
$unset(ab:hi:ismir04_rhythm:tango)
$unset(ab:hi:ismir04_rhythm:viennesewaltz)
$unset(ab:hi:ismir04_rhythm:waltz)

$noop(MIREX Audio Mood Classification Dataset)
$unset(ab:hi:moods_mirex:aggressive\, fiery\, tense/anxious\, intense\, volatile\, visceral)
$unset(ab:hi:moods_mirex:humorous\, silly\, campy\, quirky\, whimsical\, witty\, wry)
$unset(ab:hi:moods_mirex:literate\, poignant\, wistful\, bittersweet\, autumnal\, brooding)
$unset(ab:hi:moods_mirex:rollicking\, cheerful\, fun\, sweet\, amiable/good natured)
$unset(ab:hi:moods_mirex:passionate\, rousing\, confident\, boisterous\, rowdy)

$noop(genre_dortmund)
$unset(ab:hi:genre_dortmund:alternative)
$unset(ab:hi:genre_dortmund:blues)
$unset(ab:hi:genre_dortmund:electronic)
$unset(ab:hi:genre_dortmund:folk/country)
$unset(ab:hi:genre_dortmund:funk/soul/rnb)
$unset(ab:hi:genre_dortmund:jazz)
$unset(ab:hi:genre_dortmund:pop)
$unset(ab:hi:genre_dortmund:rap/hiphop)
$unset(ab:hi:genre_dortmund:rock)

$noop(genre_electronic)
$unset(ab:hi:genre_electronic:ambient)
$unset(ab:hi:genre_electronic:drum and bass)
$unset(ab:hi:genre_electronic:house)
$unset(ab:hi:genre_electronic:techno)
$unset(ab:hi:genre_electronic:trance)

$noop(genre_rosamerica)
$unset(ab:hi:genre_rosamerica:classical)
$unset(ab:hi:genre_rosamerica:dance)
$unset(ab:hi:genre_rosamerica:hiphop)
$unset(ab:hi:genre_rosamerica:jazz)
$unset(ab:hi:genre_rosamerica:pop)
$unset(ab:hi:genre_rosamerica:rhythm and blues)
$unset(ab:hi:genre_rosamerica:rock)
$unset(ab:hi:genre_rosamerica:speech)

$noop(genre_tzanetakis)
$unset(ab:hi:genre_tzanetakis:blues)
$unset(ab:hi:genre_tzanetakis:classical)
$unset(ab:hi:genre_tzanetakis:country)
$unset(ab:hi:genre_tzanetakis:disco)
$unset(ab:hi:genre_tzanetakis:hiphop)
$unset(ab:hi:genre_tzanetakis:jazz)
$unset(ab:hi:genre_tzanetakis:metal)
$unset(ab:hi:genre_tzanetakis:pop)
$unset(ab:hi:genre_tzanetakis:reggae)
$unset(ab:hi:genre_tzanetakis:rock)

$noop(Moods)
$unset(ab:hi:mood_acoustic:acoustic)
$unset(ab:hi:mood_acoustic:not acoustic)
$unset(ab:hi:mood_aggressive:aggressive)
$unset(ab:hi:mood_aggressive:not aggressive)
$unset(ab:hi:mood_electronic:electronic)
$unset(ab:hi:mood_electronic:not electronic)
$unset(ab:hi:mood_happy:happy)
$unset(ab:hi:mood_happy:not happy)
$unset(ab:hi:mood_party:party)
$unset(ab:hi:mood_party:not party)
$unset(ab:hi:mood_relaxed:relaxed)
$unset(ab:hi:mood_relaxed:not relaxed)
$unset(ab:hi:mood_sad:sad)
$unset(ab:hi:mood_sad:not sad)

$noop(Timbre)
$unset(ab:hi:timbre:bright)
$unset(ab:hi:timbre:dark)

$noop(Danceability)
$unset(ab:hi:danceability:danceable)
$unset(ab:hi:danceability:not danceable)

$noop(Gender)
$unset(ab:hi:gender:female)
$unset(ab:hi:gender:male)

$noop(Tonality)
$unset(ab:hi:tonal_atonal:tonal)
$unset(ab:hi:tonal_atonal:atonal)

$noop(Instrumental/Voice)
$unset(ab:hi:voice_instrumental:voice)
$unset(ab:hi:voice_instrumental:instrumental)

$noop(Chords, BMP & Key)
$unset(ab:lo:tonal:chords_key)
$unset(ab:lo:tonal:chords_changes_rate)
$unset(ab:lo:tonal:chords_scale)
$unset(ab:lo:tonal:key_key)
$unset(ab:lo:tonal:key_scale)
$unset(ab:lo:rhythm:bpm)

The set of scripts remove all high low data tags and creates these:
Code: [Select]
timbre
brightness
danceability
danceness
gender
femaleness
tonality
tonaleness
speechiness
acousticness
valence
chords rate
chords key

Note these scripts are subject to change (already swapped danceness with danceability), so if you tag your files with it beware you may need to re-tag/re-map them at some point whenever I add those variables on my multiple SMP tools.

The pts files are just text files with the picard scripts. They may be read in any text editor or you can use notepad++ with the xml language definition (for syntax highlighting). (see image 2 & 3)
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-08-06 15:09:40
Well... first fix. If the high level tags are missing for the release, now nothing is written (instead of using default -wrong- values). (*)

AcousticBrainz Hi Tags Labels
Code: [Select]
$noop(Sets -label- tags from AcousticBrainz high/low level data)
$noop(Recommended to removes all high/low level data afterwards)
$noop(Requires: AcousticBrainz Tags plugin 2.2+)
$noop(Requires: All high-level and subset of low-level tags enabled at plugin config)

$noop(Timbre tags: timbre -label-)
$set(_temp,%ab:hi:timbre:bright%)
$if(%_temp%,
$set(_temp,$if($gte($substr(%_temp%,2,3),5),Bright,Dark))
$set(timbre,%_temp%)
)

$noop(Danceability tags: danceability -label-)
$set(_temp,%ab:hi:danceability:danceable%)
$if(%_temp%,
$set(_temp,$if($gte($substr(%_temp%,2,3),5),Danceable,Not danceable))
$set(danceability,%_temp%)
)

$noop(Gender tags: gender -label-)
$set(_temp,%ab:hi:gender:female%)
$if(%_temp%,
$set(_temp,$if($gte($substr(%_temp%,2,3),5),Female,Male))
$set(gender,%_temp%)
)

$noop(Tonality tags: tonality -label-)
$set(_temp,%ab:hi:tonal_atonal:tonal%)
$if(%_temp%,
$set(_temp,$if($gte($substr(%_temp%,2,3),5),Tonal,Atonal))
$set(tonality,%_temp%)
)

$noop(Chords tags: chords_key -label-)
$set(_temp,%ab:lo:tonal:chords_key%)
$if(%_temp%,
$set(danceability,%_temp%)
)

Just replace this script, the others are fine. (and hope no one tagged their files yet!) Apart from this error, the scripts are now 100% safe and working as expected. Sorry.

For a release with all the AcousticBrainz tags -and already tagged by picard previously-, you should see something like this:
X
While one without the tags (the album has not been analyzed yet), you should see something like this (no changes): (**)
X

(*) For example a track without ab:hi:timbre:bright was set as timbre = dark, which is clearly wrong... since no tag means no -known- timbre.
(**) If you have albums on music brainz database -thus tagged with MBID's- but without acousticBrainz tags... you may analyze the files and send the results to their server. All is done automatically.
https://acousticbrainz.org/download
https://musicbrainz.org/doc/How_to_Submit_Analyses_to_AcousticBrainz
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-08-06 22:25:23
Thanks for the detailed explanation , I tested on a few files and everything seems ok. Thanks once again
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-08-07 09:47:45
Updated the repository with the Picard Scripts. No further changes (also included in last update of Playlist Tools).
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-08-14 15:59:13
Pushed a new update with some additions to the graph descriptors (genre and styles on the map). With the last batch I managed to cover my entire library (+430 different genre/styles) although there are many more on the descriptors added. That means is not probable to see many more updates on that field since essentially that covers all I know.

If using Playlist Tools (*), the menu entry named 'configuration\Search by Distance\Find genres/styles not on Graph' reports any genre/style not on the graph. Now I'm open to request to add those that may be considered relevant. Note I don't care at all about Last.FM - All music tags like "world music" or "African" which mean nothing, only real genre/styles please (Flamenco, Sadcore, Kabuki, Desert Blues, etc.). In any case user-defined styles may be added at 'music_graph_descriptors_xxx_user.js' so no one have to agree with me about what qualifies as genre/style.

People may also share that descriptor file which may be of interest to other users, or even me for future releases.

(*) I will consider adding the tools to the standard buttons from here too.

Now, considering the future development of this tool I'm thinking about adding:

- Cultural links restrictions mode: currently things like 'African' or 'Argentinian Rock' are skipped since they are not genres at all... but they may point to some specific music culture (and probably shared musical character). I may consider adding a new layer to the graph where certain styles are linked to an specific cultural group (for ex. Americana to American Music or Desert Blues to North African music) which may be used to further restrict playlist creation to things within the same cultural group. In that case it would use both the "real" genre/styles if they are linked to a group and tags that usually are skipped on the graph like 'African', etc.

- Integration with World-Map: since there is already a framework to get a database of artists and countries, it may be used (if locale tags are not found on tracks) to further refine playlists (for ex. "get me similar tracks to this song of Dylan but only from artists from Europe"). Also related to previous feature. Since it would use the database from the other script, and that one may be filled with values from Last fm and the Bio script, it would work without the need of re-tagging files.

- Themes with multiple files as reference: right now the tool uses only one track as reference. I have toyed with the idea of using an entire playlist at some point... at this point I have managed to do the first step of using a virtual file as container instead of a real track, that's what's called theme (and users may create their own based on tracks as references via buttons). The solution would be simply mixing the tags from all the files and retrieving tracks according to the entire set of tags. The alternative would be getting similar tracks for every track on the list and the mixing the results, but that would take time proportional to n which is simply not feasible for real use.

- Integrating low/high level data: alternative model to the use of moods, where things like valence, danceness, brightness, etc. are used.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-09-16 13:15:35
@regor I have this problem (I noticed a few weeks ago, but somehow it wasn't time for this, to report it) Also, not only that it crashes when I do Shift L click but when I do ctrl L click to set the recipe, as you see , there's nothing there - LikeADJ (MusicBee), and the other recipes should be there. Although when I do Ctrl L click and I choose to open the folder with recipes , the folder opens correctly , the path is correct:  scripts\SMP\xxx-scripts\presets\Search by\recipes
Console :

[14:53:02] foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.5.2 (Merged Buttons bar: Merged Buttons bar by xxx)
theme is null

File: buttons_sbd_menu_theme.js
Line: 101, Column: 16
Stack trace:
  createThemeMenu/<@buttons_sbd_menu_theme.js:101:16
  createThemeMenu@buttons_sbd_menu_theme.js:99:10
  newButtons.SimilarUserSet<@buttons_search_bydistance_customizable.js:44:4
  SimpleButton/this.onClick@buttons_xxx.js:138:25
  on_mouse_lbtn_up@buttons_xxx.js:222:11

And this is that error that appears in the message :

Error: Spider Monkey Panel v1.5.2 (Merged Buttons bar: Merged Buttons bar by xxx)
theme is null

File: buttons_sbd_menu_theme.js
Line: 101, Column: 16
Stack trace:
  createThemeMenu/<@buttons_sbd_menu_theme.js:101:16
  createThemeMenu@buttons_sbd_menu_theme.js:99:10
  newButtons.SimilarUserSet<@buttons_search_bydistance_customizable.js:44:4
  SimpleButton/this.onClick@buttons_xxx.js:138:25
  on_mouse_lbtn_up@buttons_xxx.js:222:11

I tested this also in a fresh portable install, but there it seems it works, no problem, so I don't know what it might me
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 15:58:32
One of your presets files got corrupted (maybe you edited one of them?), that's probably the problem. Overwrite this file at helpers, try to use the menus and check the console.

Somehow I missed a safecheck at that line (present at other places), so now it should not crash if the file doesn't load properly... but that still doesn't solve your installation problem. Take a look first at the console output before re-downloading and reinstalling all presets to be sure its only a local problem and not something on my side.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-09-16 17:22:56
No crash now. I think I found the problem, this is from the console :
[19:02:14] Recipe file is not valid:.\profile\scripts\SMP\xxx-scripts\presets\Search by\recipes\LikeADJ (MusicBee).json

I didn't copied all because it's the same for all presets
It seems the path to the recipe folder is wrong, I don't know how that happened . This is what I have (I have no profile folder):

foobar2000 (2019)\scripts\SMP\xxx-scripts\presets\Search by\recipes

This is the problem, the path? If yes, where should I modify the path? I did right click on the button - Properties, but I'm not sure where to modify

Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 18:24:30
Yep.. that's the problem. I think that's because you are using an older foobar version, don' you? (pre 1.6)

I added relative path support to all plugins but they require > 1.6, with files being within the profile folder. Not sure I'm gonna change that since it's too complex to check for 2 different paths at all instances, but right now you may either update the portable install or create a profile folder yourself. Then copy all scripts folder into it and done (it doesn't matter at all if you left the folder "foobar2000 (2019)\scripts" too, as long as there is a "foobar2000 (2019)\profile\scripts" folder with all the files).


EDIT: let me check someting.

EDIT2: well the problem was using pre 1.6 portable installs since they don't have profile folders. Have added an additional check for it at the lines of codes I found giving problems (testing it at foobar 1.4 myself). Should be solved, can not guarantee it's bug free since I only test on >1.6 portable installs.
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-09-16 18:32:36
No, it's not a old version, I have 1.6.6.
Edit.
I know, it should have been foobar2000 (2019)\profile\scripts\SMP\xxx-scripts\presets\Search by\recipes, but it's not. It's foobar2000 (2019)\scripts\SMP\xxx-scripts\presets\Search by\recipes . I have this portable install since 2019, and somehow, this is how it remained, after every update.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 18:38:31
Then your installation is wrong, since you are missing the profile folder. Check my install instructions, the scripts must be at the profile folder for >1.6 portable installs. And 1.6 portable installs use a profile folder for its user data.

X

Anyway ironically the pre <1.6 fix may "fix" your problem too. But you have to fix your installation path or more problems will appear at some point (and that's why you have been noticing strange behaviors and crashes at multiple places!).

Quote
foobar2000 (2019)\profile\scripts\SMP\xxx-scripts\
Title: Re: Search-by-Distance-SMP
Post by: marc2k3 on 2021-09-16 18:55:09
fb2k v1.6+ can easily not have a profile folder from using an older version and then upgrading it in place. Only clean portable installs of v1.6+ generate a profile folder on first run.

But of course you already know everything and never need anything explained because you're a ****ing genius.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 19:00:56
fb2k v1.6+ can easily not have a profile folder from using an older version and then upgrading it in place. Only clean portable installs of v1.6+ generate a profile folder on first run.

But of course you already know everything and never need anything explained because you're a ****ing genius.
Wow... XD @snotlicker really do yourself a favor and stop talking to me as I already asked previously, please. It really seems you have problems managing your emotions  ::)

Btw... I was talking about the installation of the scripts not foobar. So yep, the installation is wrong since I have explicitly asked in the instructions to install into the profile folder for >1.6, whether that folder exists or not, is created by foobar installation or not is totally irrelevant.
Title: Re: Search-by-Distance-SMP
Post by: marc2k3 on 2021-09-16 19:02:44
Using fb.ProfilePath would work for every scenario without hardcoding the word profile. Fighting existing standards that are there to make everyone's life easier is not the way to go.

BTW, I'm mocking you, I'm laughing. It's not something you can attribute to being overly emotional.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 19:20:55
Really I'm tired of this... 3rd time I'm asking you to stop.
Using fb.ProfilePath would work for every scenario without hardcoding the word profile. Fighting existing standards that are there to make everyone's life easier is not the way to go.
Is not only being condescending which is annoying, but also thinking you know the solution to a problem without even taking a look at the code.

The current "file" path is saved at properties panel, and it allows either relative paths "./profile/scripts/" or "./scripts/" or absolute paths.

Paths are also saved according to being a portable installation or not. Putting something like fb.ProfilePath does nothing, since then what you save at the properties panel becomes a simple absolute path. And when you move your foobar installation into another PC with another disk letter (USB) then bam, your code breaks. And for sure I will not use eval() to allow even another way to input stupid things there only to evaluate fb.ProfilePath on the fly.

As solution I have taken the file helpers and replace  './' at the start with fb.FoobarPath on the fly on every call , which ironically is the RIGHT solution since any relative path must be relative to the foobar installation which is the real root. Not an arbitrary path which changes according to version number or where the user chooses to install things. This is clearly stated in the readme, and I follow the internal structure of the software. Which I don't like, because hey I found stupid not having a profile folder in all versions... but that's not my problem and life continues.

So no, please, stop telling me how to do the things I wanna do. It's fine you don't like my coding practices or me, but then go on and stop behaving like an angry bully since your behavior is becoming really ridiculous. Not gonna loose more time with you.

EDIT: And for sure... I'm not the one with a history behind me about being too emotional and having stupid discussions with other users, questionable behaviors,  deleting repositories, multiple accounts with new names, etc.  ::) Like you wanna repeat the same pattern again, but look for another user because that's not gonna happen with me. Take it easy.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 19:33:43
And seriously this is the end of the discussion, I don't have time for these things, neither I contribute to a forum to create hostility or have personal discussions. It has gone too far by my side too, sorry for my English as always and I apologize if I don't express myself in a right way sometimes or being "too direct", but I think there are lines that must not be crossed. Will simply ignore your replies from now on, hope you do the same.

Lets go back to the topic, @Koshingg let me know if moving the files solves the problem (works for me in 1.4 and 1.6 in portable installs as far as I have checked). Thanks
Title: Re: Search-by-Distance-SMP
Post by: Koshingg on 2021-09-16 21:14:26
@snotlicker and @regor honestly, as a foobar user , I would like to see you both get along, and cooperating in a nice manner, not like this :)

regor the problem is solved if I create that profile folder and move the scripts there, The problem is once I create that profile folder foobar starts without my theme and without user components , so I have to move also the other folders in that profile folder. This is why I avoided this move

snotlicker was right here : "fb2k v1.6+ can easily not have a profile folder from using an older version and then upgrading it in place. Only clean portable installs of v1.6+ generate a profile folder on first run.''

This is exactly my situation, I upgraded and I have no profile folder, I knew about your requirements for users that have foobar 1.6.+ BUT I didn't wanted to start moving folders and components, to create possible problems
I made a quick test and everything seems ok, if I move folders in the profile folder (obviously some things must be modified but it can be done) I'll make a backup, just in case...
This situation with this profile folder (some have it , some not) it's not ideal, for sure :)
But for me, for now, everything seems ok. I think it's better to just move the folders in that profile folder, to avoid possible problems in the future

Thanks for the help
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-16 21:44:47
Will warn about the folder update misbehavior on the readmes too, so people with >1.6 always install it right no matter if they updated from an old version or not. This is affecting other scripts which rely on relative paths for user configurable files too (like the world map's image).
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-19 14:35:21
Just pushed a new update. Please read the new installation instructions. This update is required if you also update any of my other scripts due to the UTF-8 file saving/reading changes. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
### CHANGED
- All json files are now saved as UTF-8 without BOM. All json files are now read as UTF-8 (forced).
- Link cache is now saved in an human readable structure.
- Updated installation instructions.
Title: Re: Search-by-Distance-SMP
Post by: regor on 2021-09-23 15:49:46
Just pushed a new update. First steps on async processing for these scripts and porting of the additional tools from Playlis Tools. Clone the repository to get the latest changes (Code/Download zip) instead of using the releases page.
Quote
   ### Added
   - Cache: Checks graph links cache size on startup and warns when file size > 40 Mb. This is done to avoid memory leaks, since the file is fully loaded on memory and a corrupted file may increase the map size indefinitely until crashing the panel.
   - Buttons: Customizable button now has all additional menu entries found at Playlist Tools button: debug graph, find genre/styles not on graph, reset cache, etc. i.e. both now should offer the same degree of customization and advanced tools.
   ### Changed
   - Requisites: Script requires at minimum SMP 1.5.2. now.
   - Cache: Graph links cache is now calculated asynchronously whenever it's required (on first initialization or when manually forced to do so, thus improving the startup time the first time the panel it's loaded and not blocking the UI on posterior updates.
SimplePortal 1.0.0 RC1 © 2008-2021