regorxxx / Search-by-Distance-SMP

An implementation of Music-Graph for foobar2000, using Spider Monkey, which creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/search-by-distance-smp/
GNU Affero General Public License v3.0
35 stars 7 forks source link

No results with remapped tag #8

Closed username116 closed 2 years ago

username116 commented 2 years ago

Hello Regor,

I can't get the customizable button to work since the changes due to foobar v2. As soon as I add a remapped tag, the results are often empty or almost empty playlists.

For example I do this :

I tried several tags, several songs. I tried the options. I compared the results with the v3.1.0 release. I tried with a new portable installation foobar v2.0 beta 12 x86 + Spider Monkey Panel v1.6.1 + the Search-by-Distance code downloaded two days ago. The button is used alone and there were no other settings before.

I saw in the js_data\tagsCache folder, after closing foobar, two files: %GENRE%, %DISCOGS_GENRE%.json, with all tag values. %GENRE, DISCOGS_GENRE%.json, with only question marks instead of values.

Another detail I saw: there is a setting Remove duplicates by : ["$ascii($lower($trim(%TITLE%)))","ARTIST","$year(%DATE%)"] I feel like ARTIST is missing the percentage symbols : %ARTIST%.

Another remark (sorry it's not the bug but I take the opportunity): The Discogs genre Folk, World, & Country appears as "Folk", "World", "& Country". I saw that in the console too. It's a pretty important / common tag for them. This is not a request, it's just to point it out.

regorxxx commented 2 years ago

Hello Regor,

I can't get the customizable button to work since the changes due to foobar v2. As soon as I add a remapped tag, the results are often empty or almost empty playlists.

For example I try to do this :

* Load the script buttons_search_bydistance_customizable.js

* Wait for the calculation of the cache with the console

* Name the button

* Select the Graph method with the Ctrl + Shift menu

* Test : it gives results, more or less

* Add a custom tag : Ctrl + Shift menu > Remap tags > Set genre tag: `GENRE,DISCOGS_GENRE`

* Reset link cache now ?  Yes. Wait for the cache calculation with the console.

* The results are empty playlists.

Beware tags cache is not fully tested, so running directly from github you will continue getting errors with things being WIP. Have uploaded a commit which should fix it. Reset tags cache after installing it and retry.

If it doesn't work, to disable tags cache: image

I tried several tags, several songs. I tried the options. I compared the results with the v3.1.0 release. I tried with a new portable installation foobar v2.0 beta 12 x86 + Spider Monkey Panel v1.6.1 + the Search-by-Distance code downloaded two days ago. The button is used alone and there were no other settings before.

I saw in the js_data\tagsCache folder, after closing foobar, two files: %GENRE%, %DISCOGS_GENRE%.json, with all tag values. %GENRE, DISCOGS_GENRE%.json, with only question marks instead of values.

Another detail I saw: there is a setting Remove duplicates by : ["$ascii($lower($trim(%TITLE%)))","ARTIST","$year(%DATE%)"] I feel like ARTIST is missing the percentage symbols : %ARTIST%.

Remove duplicates thing is right, percents are only needed when using functions.

regorxxx commented 2 years ago

Another remark (sorry it's not the bug but I take the opportunity): The Discogs genre Folk, World, & Country appears as "Folk", "World", "& Country". I saw that in the console too. It's a pretty important / common tag for them. This is not a request, it's just to point it out.

Well tag values are divided by comma, so there is nothing I can do with that. There is no single genre on the world using commas.

Folk, World & country is not a genre, is a collection of genres, so being strict, that value is wrong and should be split first. There is no thing as 'Folk, World & Country' on the graph since that goes against the design of this script. 2 of them are genres, and World is not a genre.

Obviously users may want to use it that way for queries or whatever, but it has zero use on Search by distance anyway so... There are several warnings about this on the tagging readmes and that's the standard on Foobar when you query all tags at once.

If you use 'Debug\Find genre/styles not on graph,' you will see all values discarded for the graph. They are still used for scoring purposes though, as stated on the method readmes.

username116 commented 2 years ago

I've done some testing and it seems to work. I'm getting results now, where before I just had empty playlists. I'll take a little more time the next few days to try it out. Thanks a lot.

Yes, maybe I am impatient and should wait for the releases. Thanks for your answers.

regorxxx commented 2 years ago

Don't get me wrong, this helps me to find broken things faster; just warning you, in case you want a "tested" release. Foobar 2.0 tag caching is mostly a beta thing, just finished implementing it tonight -at least in some tools-.

About the Discogs tags, you could try using TF:

regorxxx commented 2 years ago

Have touched a lot of things on the latest commits to better support Tag remapping with TF functions, and under the hood changes which hopefully will make my life easier on the future. Also some tag cache fixes. Let me know if it works as intended.

username116 commented 2 years ago

I have an error with today's version, with the default settings, when I click on the button. (When I deselect the menu Ctrl + Shift > Set final sorting > Smart Shuffle by Artist, it works, I have results.)

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
shuffleByTags is not defined

File: search_bydistance.js
Line: 1577, Column: 21
Stack trace:
  do_searchby_distance@search_bydistance.js:1577:21
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:57:5
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 135 foobar2000

I don't know if this is right, but I tried to add this line at the top: include('..\\main\\scatter_by_tags.js');, and I got this:

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
ReverseIterableMap is not defined

File: scatter_by_tags.js
Line: 211, Column: 15
Stack trace:
  shuffleByTags@scatter_by_tags.js:211:15
  do_searchby_distance@search_bydistance.js:1578:21
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:57:5
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 136 foobar2000

I wondered what is the new format to add a remapped tag, it says (JSON) ["GENRE"]. I looked in the .json files, and I deduced that it should be something like ["GENRE","TAG 2","TAG 3"].

regorxxx commented 2 years ago

I don't know if this is right, but I tried to add this line at the top: include('..\main\scatter_by_tags.js');, and I got this: Yep, just uploaded the missing dependencies and works fine on my tests. I'm now loading the button on a single panel, instead of a Playlist Tools toolbar to have your same settings.

regorxxx commented 2 years ago

I wondered what is the new format to add a remapped tag, it says (JSON) ["GENRE"]. I looked in the .json files, and I deduced that it should be something like ["GENRE","TAG 2","TAG 3"].

Yep, I have added an example about what JSON format means for casual users on the Input popup. It's just values quoted within an array [], but probably other users will have doubts. Will add it later at the readmes.

username116 commented 2 years ago

I found 3 other menu errors: Ctrl + Shift menu > Debug and testing > Debug Graph Ctrl + Shift menu > Debug and testing > Run distance tests Ctrl + Shift menu > Debug and testing > Graph statistics

Maybe missing sbd. before panelProperties: File: buttons_sbd_menu_config.js Line: 556, Column: 9 Line: 562, Column: 9 Line: 596, Column: 8

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
panelProperties is not defined

File: buttons_sbd_menu_config.js
Line: 556, Column: 9
Stack trace:
  func@buttons_sbd_menu_config.js:556:9
  _menu/this.btn_up/<@menu_xxx.js:305:15
  _menu/this.btn_up@menu_xxx.js:295:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 137 foobar2000

And here maybe a typo? helpers/helpers_xxx.js, line 94 "iI.E. these tracks would not be" In the window that appears with Ctrl + Shift menu > Other playlist attributes > Duplicates advanced RegExp title matching?

regorxxx commented 2 years ago

All fixed now.

username116 commented 2 years ago

I've seen other errors. Ctrl + Shift menu > Special playlist rules > Recursive playlist creation, uses output as new references

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
do_searchby_distance(...) is not iterable

File: search_bydistance.js
Line: 1607, Column: 57
Stack trace:
  do_searchby_distance@search_bydistance.js:1607:57
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:57:5
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 146 foobar2000

This one seems to come from my settings (with several remapped tags), because it worked without error on a new portable installation. Ctrl + Shift menu > Debug and testing > Graph statistics This is the console :

Called: Debug and testing\Graph statistics
Calculating graph links 0%.
Calculating graph links 25%.
Calculating graph links 50%.
Calculating graph links 75%.
Calculating graph links 100%.
foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
invalid array length

File: music_graph_xxx.js
Line: 715, Column: 20
Stack trace:
  histogram@music_graph_xxx.js:715:20
  graphStatistics@music_graph_xxx.js:770:2
  async*func@buttons_sbd_menu_config.js:598:5
  _menu/this.btn_up/<@menu_xxx.js:305:15
  _menu/this.btn_up@menu_xxx.js:295:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 142 foobar2000

Another, when no track is selected and I press the button. With the default settings. I don't know exactly how to reproduce it, but I tried before some options in the Set pre-scoring filters menu.

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
tracks is undefined

File: scatter_by_tags.js
Line: 262, Column: 21
Stack trace:
  shuffleByTags/<@scatter_by_tags.js:262:21
  shuffleByTags@scatter_by_tags.js:259:11
  do_searchby_distance@search_bydistance.js:1578:21
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:57:5
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 147 foobar2000

username116 commented 2 years ago

I compared the results with a version from two or three months ago. I found very similar results with the Weight method. With the Graph method, the results have changed. I see in the console that the similarity scores are the same, and the Graph scores are higher overall. I see that there were changes in the Changelog, I guess that's why.

This is the first time I've had fast results with foobar v2. Before it took about 10 seconds. Thank you very much for your help and for all the improvements. I guess it's good news if the internal changes are not visible. A detail: now I can put an empty value directly in Remap tags with []. Before it would restore the default value.

I saw another site where the Folk, World, & Country tag is used. But anyway, I agree with what you wrote here and in the Readmes. Thanks for the tips on Title Formatting. I've tried it. This answers another question I had: Since there is only one custom string, how to differentiate tags coming from different sources or models. This seems appropriate for the genres calculated by AcousticBrainz which do not always correspond to reality, and which have different definitions for the same genre name. Dortmund Jazz does not necessarily equal Rosamerica Jazz and does not necessarily equal real jazz. I imagine adding the name of the source before the values. I know it won't work with the Graph method, but maybe with the similarity score, or recipes with Weight method, there is also the weight setting. Now I know it is possible with Title Formatting as you have shown. I thought of this expression: "[$replace($insert($meta_sep(DISCOGS_GENRE,', 'Discogs ),Discogs ,0),Folk',' World',' & Country,Folk World & Country)]". A difference with this expression is that the lack of value gives "" in the tag cache, before it was "?".

regorxxx commented 2 years ago

I compared the results with a version from two or three months ago. I found very similar results with the Weight method. With the Graph method, the results have changed. I see in the console that the similarity scores are the same, and the Graph scores are higher overall. I see that there were changes in the Changelog, I guess that's why.

Yep, there have been some improvements on the calculations (and some bugs fixed). That's said, the results are dependent on your settings, which you can fine tune (weights and score filter), but the internals should better reflect now the similarity.

This is the first time I've had fast results with foobar v2. Before it took about 10 seconds. Thank you very much for your help and for all the improvements. I guess it's good news if the internal changes are not visible. A detail: now I can put an empty value directly in Remap tags with []. Before it would restore the default value.

That's right. Doing so will not use the tag, which is intended behavior. Previously was wrong.

This is the first time I've had fast results with foobar v2. Before it took about 10 seconds. Thank you very much for your help and for all the improvements. I guess it's good news if the internal changes are not visible.

My cache attempts are anyway a dirty patch for something which should be fixed by Peter on the main program; I would suggest you to report it anyway on the Foobar forums...In particular here: https://hydrogenaud.io/index.php/topic,123044.msg1016438.html#msg1016438 I find foobar v2 unusable for me and you will experience really slow processing in other scripts of mine which heavily rely on tag usage, while they take a few ms on foobar v1.

If you find any particular use-case where processing time is clearly much higher on v2, please open a new issue pointing to it (so I can have a clear view of the things I should focus on for V2). That part will take some time though.

regorxxx commented 2 years ago

I saw another site where the Folk, World, & Country tag is used. But anyway, I agree with what you wrote here and in the Readmes.

I know... well my design philosophy is linking genres by similarity, which requires some kind of uniqueness. Allowing things like that would go against that base; although as said nothing stops you to use it like that with the TF remap. I added a note about it on the readme.

This seems appropriate for the genres calculated by AcousticBrainz which do not always correspond to reality, and which have different definitions for the same genre name. Dortmund Jazz does not necessarily equal Rosamerica Jazz and does not necessarily equal real jazz. I imagine adding the name of the source before the values. I know it won't work with the Graph method, but maybe with the similarity score, or recipes with Weight method, there is also the weight setting. Now I know it is possible with Title Formatting as you have shown.

Custom string is compared against custom string values, so they don't get mixed with the genre/styles neither used on the graph, right.

Now... if you are talking about putting genre_dortmund and genre_rosamerica, both on the same stag slot.... yep, that would mean all values would be joined together and compared without caring about the "source". You can fix that with TF as you noted. BUT scoring is affected. If you add a prefix to the source, then you are not matching 10 values against 10 values, but 3 to 10. And the max score would always be 3/10.... not really giving you the results you want.

At some point I plan to add unlimited custom tags, so you could have lets say 3 custom tags, which would not be mixed. One slot for genre_dortmund and another one for genre_rosamerica for ex. That would cover any use-case. I have not given that any priority because that doesn't really bring something new to the table.... since it's simple string matching.

I would prefer to implement a real code logic to use things like genre_rosamerica or genre_dortmund, but let's say unlimited custom tags is on roadmap.

regorxxx commented 2 years ago

I thought of this expression: "[$replace($insert($meta_sep(DISCOGS_GENRE,', 'Discogs ),Discogs ,0),Folk',' World',' & Country,Folk World & Country)]". A difference with this expression is that the lack of value gives "" in the tag cache, before it was "?".

Not sure what you are trying but that gives me this result on tracks not having the tag, which I don't think it's intended. Discogs

regorxxx commented 2 years ago

I've seen other errors. Ctrl + Shift menu > Special playlist rules > Recursive playlist creation, uses output as new references

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx) do_searchby_distance(...) is not iterable

File: search_bydistance.js Line: 1607, Column: 57 Stack trace: do_searchby_distance@search_bydistance.js:1607:57 async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:57:5 themedButton/this.onClick@buttons_xxx.js:297:21 @buttons_xxx.js:480:21 fireEvents/</<@callbacks_xxx.js:148:37 fireEvents/<@callbacks_xxx.js:145:30

Fixed.

regorxxx commented 2 years ago

Another, when no track is selected and I press the button. With the default settings. I don't know exactly how to reproduce it, but I tried before some options in the Set pre-scoring filters menu.

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
tracks is undefined

File: scatter_by_tags.js
Line: 262, Column: 21
Stack trace:
  shuffleByTags/<@scatter_by_tags.js:262:21
  shuffleByTags@scatter_by_tags.js:259:11
  do_searchby_distance@search_bydistance.js:1578:21
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:57:5
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 147 foobar2000

This one will require some time... It's not possible to run the button when there is no selection. In case you have nothing selected (try it), it takes the focused track, which may be the first track on a playlist. And if you have an empty playlist, it does nothing. So it points to other error I can not find.

regorxxx commented 2 years ago

This one seems to come from my settings (with several remapped tags), because it worked without error on a new portable installation. Ctrl + Shift menu > Debug and testing > Graph statistics This is the console :

Called: Debug and testing\Graph statistics
Calculating graph links 0%.
Calculating graph links 25%.
Calculating graph links 50%.
Calculating graph links 75%.
Calculating graph links 100%.
foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
invalid array length

File: music_graph_xxx.js
Line: 715, Column: 20
Stack trace:
  histogram@music_graph_xxx.js:715:20
  graphStatistics@music_graph_xxx.js:770:2
  async*func@buttons_sbd_menu_config.js:598:5
  _menu/this.btn_up/<@menu_xxx.js:305:15
  _menu/this.btn_up@menu_xxx.js:295:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:297:21
  @buttons_xxx.js:480:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 142 foobar2000

It seems so. I know where the error comes from though, it essentially warns about trying to make an histogram with infinite columns... which would only happen if when there is no "data". And that points to some kind of weird tag remapping, yep. Could you post your tag settings? And then try with this file, it should bypass the error. Post me the results. music_graph_xxx.zip

username116 commented 2 years ago

This one will require some time... It's not possible to run the button when there is no selection. In case you have nothing selected (try it), it takes the focused track, which may be the first track on a playlist. And if you have an empty playlist, it does nothing. So it points to other error I can not find.

I reproduced it:

Here is my console: Gist

Capture d'écran 148 foobar2000

regorxxx commented 2 years ago

This one will require some time... It's not possible to run the button when there is no selection. In case you have nothing selected (try it), it takes the focused track, which may be the first track on a playlist. And if you have an empty playlist, it does nothing. So it points to other error I can not find.

I reproduced it:

* I tried some options in the "Set pre-scoring filters" menu. It created playlists.

* Ctrl + Shift menu > Reset to default.

* Click on the button without selecting anything

Here is my console: Gist

Capture d'écran 148 foobar2000

Can not reproduce it. Must be something related to your files (and their tags). Try with this file, the console log will output more things now. scatter_by_tags.zip

Note you are calling the button on different tracks each time, it has nothing to do with the 'Reset to defaults' or the filters. This is the track crashing:

Using selection as reference: 05 - If you could let me be (file://D:\Audio\Musique\Pop, rock\Jeanne Added\2020 - Air\05. If you could let me be.flac)

username116 commented 2 years ago

. Try with this file, the console log will output more things now. scatter_by_tags.zip

Here it is

I see "hugar". I don't know if it's that, but there are special characters in the name of the album and the songs and in the name of the composer. https://musicbrainz.org/release/6ebb2773-9ea3-4640-a2aa-4767a9764d20 https://www.discogs.com/release/14102594-Hugar-Var%C3%B0a

regorxxx commented 2 years ago

Nah, it was due to having so many tracks by same artist; there was only an exact solution for the smart shuffle (with an error there), and thus only crashed in that use-case, took me some time trying with combinations of tracks following your same pattern. Now hopefully fixed.

image -> image (note the only solution for such artist's proportion is intercalation, the thing not working before)

username116 commented 2 years ago

I reproduced this bug with Debug and testing > Graph statistics.

Capture d'écran 149 foobar2000

There doesn't seem to be any remapping, it looks like the default properties (no I see lines 72 and 73). Here are the current panel properties.

username116 commented 2 years ago

Could you post your tag settings? And then try with this file, it should bypass the error. Post me the results. music_graph_xxx.zip

I tried with your file. It crashed. Here is the console.

Capture d'écran 150 foobar2000

regorxxx commented 2 years ago

Thing is I can not reproduce your error in any way. music_graph_xxx.zip

username116 commented 2 years ago

Here is the console with the new file.

Capture d'écran 151 foobar2000

regorxxx commented 2 years ago

music_graph_xxx.zip Have zero idea what's going on. Clean properties from panel, reload script, reset link cache on debug and reset tags cache on debug. Then retry.

username116 commented 2 years ago

Here it is. I did what you asked. No error this time. I don't know what happened. Thanks for your help.

username116 commented 2 years ago

I thought of this expression: "[$replace($insert($meta_sep(DISCOGS_GENRE,', 'Discogs ),Discogs ,0),Folk',' World',' & Country,Folk World & Country)]". A difference with this expression is that the lack of value gives "" in the tag cache, before it was "?".

Not sure what you are trying but that gives me this result on tracks not having the tag, which I don't think it's intended. Discogs

Maybe the outside brackets are missing, this is only a part. The complete expression is: ["GENRE","[$replace($insert($meta_sep(DISCOGS_GENRE,', 'Discogs ),Discogs ,0),Folk',' World',' & Country,Folk World & Country)]"] , and it gives me results like this. The result is what I was trying to do. Separate a source with a prefix. The question marks don't seem important. I hadn't thought about the score.

Unlimited custom tags: I had thought of additional tags, but didn't dare to ask. So unlimited tags, yes that would be nice, but I don't know if many people will use it. From what little I have seen, there now seem to be other models that are perhaps different or better than the AcousticBrainz ones (but to make them work on windows, I don't know at all).

regorxxx commented 2 years ago

["GENRE","[$replace($insert($meta_sep(DISCOGS_GENRE,', 'Discogs ),Discogs ,0),Folk',' World',' & Country,Folk World & Country)]"]

I suppose the '?' is related to GENRE not being on those tracks, and "" value when the second one is missing. I will see how to avoid that, but meanwhile add "?" to the list of values filtered. image

username116 commented 2 years ago

I suppose the '?' is related to GENRE not being on those tracks, and "" value when the second one is missing.

Yes that's right. I checked by looking at the tags in my files. It's not because they are mp3s, it's the same for mp3s and flacs that don't have tags. The second empty value, I think it's because I used square brackets, to have a result only when the value is present. And the question mark is when the Genre tag is empty. I have very few Style tags, and the %STYLE% file in js_data\tagsCache is full of "?". Thanks for the advice.

regorxxx commented 1 year ago

@username116

Please take a look at the [custom-tags] branch. Once ready, next release will use the new tag system, which allows fully tag behavior customization. Is WIP, so there are probably errors here and there.

username116 commented 1 year ago

I tried the [custom-tags] branch, with a new foobar2000 v2.0 beta 16 x86 portable. It looks promising. When I load the file the first time, it asks me if I want to look for the missing genres in the graph. If I put yes, it crashes.

Capture d'écran 160 foobar2000

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
properties.genreTag is undefined

File: search_bydistance.js
Line: 1643, Column: 4
Stack trace:
  findStyleGenresMissingGraphCheck@search_bydistance.js:1643:4

Capture d'écran 162 foobar2000

Something similar with Debug and testing > Find genres/styles not on Graph :

properties.genreTag is undefined

File: buttons_sbd_menu_config.js
Line: 578, Column: 6

First try, when I click on the button, without setting : (If I remove the "Read tags from cache instead of files?" option, it works.)

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
Object.keys(...).map(...).push(...).map is not a function

File: search_bydistance.js
Line: 891, Column: 6
Stack trace:
  searchByDistance@search_bydistance.js:891:6
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:323:21
  @buttons_xxx.js:506:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 165 foobar2000

The default search method is Graph. Wasn't it Weight before?

I tried to add a new custom tag. It might be easier with examples or definitions for the questions: Enter name: (should it be TAG or ["tag"]?) Is a string? Uses absolute range?

When I change the weight of Genre or Style:

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
properties[key] is undefined

File: buttons_sbd_menu_config.js
Line: 223, Column: 20
Stack trace:
  func@buttons_sbd_menu_config.js:223:20
  _menu/this.btn_up/<@menu_xxx.js:317:15
  _menu/this.btn_up@menu_xxx.js:307:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:323:21
  @buttons_xxx.js:506:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 167 foobar2000

When I change the scoring method, for example: Set Tags and weighting > Style > Scoring... > LINEAR / LOGARITHMIC / LOGISTIC / NORMAL, the checkbox in the contextual menu no longer appears.

I take this opportunity to point out an error that is there on the main branch, when I delete or move a file:

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
libItems.forEach is not a function

File: helpers_xxx_tags_cache.js
Line: 131, Column: 13
Stack trace:
  tagsCache.deleteTags/<@helpers_xxx_tags_cache.js:131:13
  tagsCache.deleteTags@helpers_xxx_tags_cache.js:128:11
  tagsCache.enable/this.listeners<@helpers_xxx_tags_cache.js:201:10
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 163 foobar2000

username116 commented 1 year ago

Have you seen this change with foobar 2.0 beta 13? (Change Log) "Workarounds for poor performance of metadb_index operations compared to v1.x series (affects third party components only). " I haven't done a serious before and after comparison, so I don't know.

regorxxx commented 1 year ago

Fixed all those, including the cache one (you can use the updated file on the main branch too). You will have to change the scoring again to get it working,

regorxxx commented 1 year ago

Have you seen this change with foobar 2.0 beta 13? (Change Log) "Workarounds for poor performance of metadb_index operations compared to v1.x series (affects third party components only). " I haven't done a serious before and after comparison, so I don't know.

Yep, took a look at it. Have not done any test with a portable install yet.

I created a few threads bothering about the use of plugins like httpcontrol, mine, etc. and slow startup. So that may be it. But no idea if that will be just a small improvement or the end of tag caching.

username116 commented 1 year ago

Thanks for the fixes. There's that again when I click the button for the first time: (If I remove the "Read tags from cache instead of files?" option, it works.)

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
Object.values(...).filter(...).map(...).push(...).map is not a function

File: search_bydistance.js
Line: 889, Column: 6
Stack trace:
  searchByDistance@search_bydistance.js:889:6
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:323:21
  @buttons_xxx.js:506:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 169 foobar2000

The default search method is Graph ?

regorxxx commented 1 year ago

Should be fixed. And yes

username116 commented 1 year ago

It doesn't look like:

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
tagName.map is not a function

File: search_bydistance.js
Line: 889, Column: 39
Stack trace:
  searchByDistance/missingOnCache<@search_bydistance.js:889:39
  searchByDistance@search_bydistance.js:889:6
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:323:21
  @buttons_xxx.js:506:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 170 foobar2000

regorxxx commented 1 year ago

Now. Checked it myself.

username116 commented 1 year ago
Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
properties[key] is undefined

File: buttons_sbd_menu_config.js
Line: 619, Column: 146
Stack trace:
  func/keys<@buttons_sbd_menu_config.js:619:146
  func@buttons_sbd_menu_config.js:619:132
  _menu/this.btn_up/<@menu_xxx.js:317:15
  _menu/this.btn_up@menu_xxx.js:307:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:323:21
  @buttons_xxx.js:506:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 171 foobar2000

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
newConfig.genreTag is undefined

File: search_bydistance_extra.js
Line: 18, Column: 19
Stack trace:
  calculateSimilarArtists@search_bydistance_extra.js:18:19
  calculateSimilarArtistsFromPls@search_bydistance_extra.js:129:24
  async*func@buttons_sbd_menu_config.js:564:5
  _menu/this.btn_up/<@menu_xxx.js:317:15
  _menu/this.btn_up@menu_xxx.js:307:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 174 foobar2000

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
keyHandle is not defined

File: search_bydistance.js
Line: 1330, Column: 26
Stack trace:
  searchByDistance/matchIdx<@search_bydistance.js:1330:26
  searchByDistance@search_bydistance.js:1326:47
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 175 foobar2000

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
genreWeight is not defined

File: search_bydistance.js
Line: 1458, Column: 25
Stack trace:
  searchByDistance@search_bydistance.js:1458:25
  async*["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 176 foobar2000

I did some testing in a portable foobar. I added custom tags. It works, it gave good results. That's great, congrats! I'll be able to make all the settings per tag and per source that I want. Thanks a lot.

regorxxx commented 1 year ago

I tried to reproduce my previous settings. Some songs have a different Graph score. I searched a little in the settings but I couldn't find why.

There is nothing touched there, so that's on your side (or maybe you have new tracks, etc.). Different tags, or whatever. Are you sure you mean the GRAPH score and not the similarity score? Ensumo l'abril - 79.3/100 Simil. - 0 Graph

I can't uncheck the filters in Set pre-scoring filters > Additional pre-defined filters... > ... (in the main branch too)

Can't reproduce it. They work fine here. Delete your forced query, and start from blank. I changed some things there since they were not working. (or give me more clues)

Debug and testing > Reset tags cache

Fixed now.

Other tools > Calculate similar artists tags

Will require some time, I discovered one thing I simplified I should "fix" too now. Fixed the crash, but maybe tomorrow I will make it to use any "graph" related tag, not just genre/style.

Set playlist rules > DJ-like playlist creation + Harmonic mixing double pass

Fixed now.

With the option Set final sorting > Intercalate instrumental tracks

And fixed. Maybe tomorrow I will make it to use any "graph" related tag, not just genre/style to look for "instrumental".

Now that tags are fully customizable, I have to consider the possibility of multiple "genre"-like tags at places not considered before.

regorxxx commented 1 year ago

On next releases I plan to add a "share config" entry which will copy the config of the button to other panels, so tags only need to be set once. Because the idea is to have 3/4 customizable buttons loaded at the same time, each one with different sorting/special settings to create different types of playlists, not having to change all the config every time. Or well.... use recipes, that do the same.

And... loading a single button will not be supported anymore. You will have to load the buttons bar script, and then load the button you want from there. I will add a few presets the first time the bar is loaded, to make it easier.

username116 commented 1 year ago

Thanks for the fixes and info. There is one still there on the [custom-tags] branch.

Debug and testing > Reset tags cache

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
calcTags is not defined

File: buttons_sbd_menu_config.js
Line: 619, Column: 18
Stack trace:
  func@buttons_sbd_menu_config.js:619:18
  _menu/this.btn_up/<@menu_xxx.js:317:15
  _menu/this.btn_up@menu_xxx.js:307:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 179 foobar2000

regorxxx commented 1 year ago

Fixed. Was a typo.

username116 commented 1 year ago

There seems to be something else: Debug and testing > Reset tags cache

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
can't access lexical declaration `tags' before initialization

File: buttons_sbd_menu_config.js
Line: 619, Column: 18
Stack trace:
  func@buttons_sbd_menu_config.js:619:18
  _menu/this.btn_up/<@menu_xxx.js:317:15
  _menu/this.btn_up@menu_xxx.js:307:24
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:40:27
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 181 foobar2000

regorxxx commented 1 year ago

Yeah, variable name was already used below :roll_eyes: now

username116 commented 1 year ago

I tried to reproduce my previous settings. Some songs have a different Graph score. I searched a little in the settings but I couldn't find why.

There is nothing touched there, so that's on your side (or maybe you have new tracks, etc.). Different tags, or whatever. Are you sure you mean the GRAPH score and not the similarity score? Ensumo l'abril - 79.3/100 Simil. - 0 Graph

Yes, that was it. Maybe it needed a Reset link cache. It happened to me again (but it's rare):

Kaleidoscope - 65.3/100 Simil. - 39.4 Graph       (main branch)
Kaleidoscope - 65.3/100 Simil. - 30.6 Graph       (custom-tags branch)

Midnight Sun - 65.6/100 Simil. - 22.3 Graph       (main branch)
Midnight Sun - 65.6/100 Simil. - 16.7 Graph       (custom-tags branch)

I can't uncheck the filters in Set pre-scoring filters > Additional pre-defined filters... > ... (in the main branch too)

Can't reproduce it. They work fine here. Delete your forced query, and start from blank. I changed some things there since they were not working. (or give me more clues)

In the [custom-tags] branch, with default settings (Only Stereo is checked): Click on No Female vocals (Female vocals becomes checked too). I can't remove No Female vocals by clicking on it (it remains checked in the menu). Same with No Instrumentals and No Acoustic tracks.

And if I set Set Global Forced Query... to [], it doesn't do anything when I click on the button (I know it works if I don't put anything).

I'm not sure about all of this, but here's what I thought while testing: With the default settings it's the same results between the [main] and [custom-tags] branches. And when I add a tag in the settings, I see small differences in the results (it's more frequent), more or less, even when I don't use the cache. I don't know. It's quite possible that it's a setting I didn't see.

In the [custom-tags] branch: ["TAG 1","TAG 2","TAG 3"] gives really different results than ["TAG 1"], ["TAG 2"] and ["TAG 3"] in several custom tags. And with this second configuration, the Graph scores are much less varied (often all 0, or three or four values out of 50 results), which is like doing a Weight calculation.

In the [custom-tags] branch: I also see that ["GENRE","TAG 2","TAG 3"] gives some differences from ["GENRE"] (with weight at 0) + ["GENRE","TAG 2","TAG 3"] in a new custom tag.

I see in the %TITLE% cache file that if there is a comma in the title, the title is cut in two:

        [
            "file://D:\\Audio\\Feist - Pleasure (2017)\\03. Get not high, get not low.flac,0",
            [
                "Get not high",
                "get not low"
            ]
        ],

If I replace what is in the Other playlist attributes > Remove duplicates by ... option with this []: In the [custom-tags] branch:

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
handleList is undefined

File: search_bydistance.js
Line: 916, Column: 22
Stack trace:
  searchByDistance@search_bydistance.js:916:22
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 182 foobar2000

Also in the main branch:

handleList is undefined

File: search_bydistance.js
Line: 990, Column: 22

In the [custom-tags] branch, if I set Genre to []:

Error: Spider Monkey Panel v1.6.1 (Search by Distance Customizable Button: Search by Distance Customizable Button by xxx)
calcTags.genre is undefined

File: search_bydistance.js
Line: 719, Column: 3
Stack trace:
  searchByDistance@search_bydistance.js:719:3
  ["Search by Distance Customizable"]<@buttons_search_bydistance_customizable.js:61:5
  themedButton/this.onClick@buttons_xxx.js:339:21
  @buttons_xxx.js:522:21
  fireEvents/</<@callbacks_xxx.js:148:37
  fireEvents/<@callbacks_xxx.js:145:30

Capture d'écran 183 foobar2000

regorxxx commented 1 year ago

In the [custom-tags] branch, with default settings (Only Stereo is checked): Click on No Female vocals (Female vocals becomes checked too). I can't remove No Female vocals by clicking on it (it remains checked in the menu). Same with No Instrumentals and No Acoustic tracks.

Got it. Fixed. It's really difficult to add pre-defined queries to an existing expression, since I have to check parentheses, the possibility of an expression being preceded by a NOT, etc. Think I finally fixed it.

And if I set Set Global Forced Query... to [], it doesn't do anything when I click on the button (I know it works if I don't put anything).

That works as intended (?). The query is not an array, is a string. If you want no query, put it blank. But if you put [] you are asking to look for [], which obviously gives no tracks (and this is stated at the console log). I don't think that's my problem, I mean if the user puts that in any search tool within foobar it's considered a valid query. I "could" add a check against queries returning nothing on a library, but that's just adding a new feature to check for user's error, not my fault.

If I replace what is in the Other playlist attributes > Remove duplicates by ... option with this []: In the [custom-tags] branch:

This was never intended to be empty, but fixed now. Maybe users don't want duplication removal, so it's a valid setting.

In the [custom-tags] branch, if I set Genre to []:

Fixed.

regorxxx commented 1 year ago

With the default settings it's the same results between the [main] and [custom-tags] branches. And when I add a tag in the settings, I see small differences in the results (it's more frequent), more or less, even when I don't use the cache. I don't know. It's quite possible that it's a setting I didn't see.

About your other tests, can't really understand your settings. Please send me some screenshots with how you configure tags, like this: image For all relevant tags you are changing. And the scores with a given reference track in all those cases.

A track should always give the same results whenever you use the same settings, Enable "Sort final playlist by scoring" and disable "Take randomly from pool". It will always output the same list of tracks ordered the same way. Then with that maybe I can find your problems... also I need to know how you are adding those tags. Which type of tags are those (the answers to the popups).