Skip to main content

Notice

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

Re: [SMP] Music Graph development

Reply #50
A)  %played_times_js%  contains both, foobar (1) and lastfm statistics (2+3), and %lastfm_played_times_js% contains only lastfm statistics but with some temp offset (2+3).
B)  %played_times_js%  contains both, foobar (1)  and lastfm scrobbles (3), done within foobar and %lastfm_played_times_js% contains lastfm statistics (2+3) (with some temp offset).

In any case, what's the reasoning of having duplicate data at all? Why are they not being filtered using the SDK? Or why not exposing a global variable having all without duplicates?
B is mostly accurate.
%played_times_js% ONLY includes plays from foobar. It doesn't know or care about last.fm scrobbles, although some or all of these plays could have also been scrobbled.
%lastfm_played_times_js% ONLY includes scrobbles from last.fm, and doesn't know or care where those scrobbles came from and some or all of them could have been from foobar.

foo_enhanced_playcount originally didn't retrieve scrobbles, and it was added a little later on. The reason the lists are different and can contain duplicates is because it's impossible to be 100% accurate with them. Let's say you start playing a 4 minute long song at 12:00:01. After 60 seconds, foobar records a play time stamp at 12:01:01.342 (it's down to the microsecond at least). At the 2 minute mark (50% through) your song is scrobbled to last.fm with a timestamp of when the song STARTED playing... i.e. 12:00:01 (only down to the second). At some point relatively early on I started adding 60seconds to the timestamps I received from last.fm so that they would hopefully be very close, but if you pull up the properties page of a song you'll see that very often last.fm last played will be 12:01:01 and foobar's will be 12:01:02. Still, that'd probably be somewhat easy to try and filter out most duplicates.

The problem is now what happens if 30 seconds into the song I started playing at 12:00:01 I pause the track for exactly 10 minutes while I'm on a phone call, then I unpause and continue listening to the whole thing. last.fm receives a scrobble for 12:00:01 when the song started, and the component returns it as 12:01:01 like always. However, foobar's recorded played time is now 12:11:01. I've still got a duplicate.

I decided to just throw my hands up and put the onus on the user how they want to handle it. Maybe that's not the best decision but it's the one that was made. I could add a %played_times_combined% or change the default behavior and attempt to filter out duplicates, but I don't have plans for that at the moment. I honestly don't know if anyone besides you or me is even using the actual played times for anything currently. I think the lastfm play counts and the %first_played_enhanced%/%last_played_enhanced% are much more common.

Re: [SMP] Music Graph development

Reply #51
Ok! Now I get it. Yep, I supposed the problem was that. Although I think %played_times_combined% should be provided by the plugin for consistency and simplicity.

Meanwhile, since the "fix" is not so difficult I will simply combine them following your advice of discarding plays differing by seconds. I don't use scrobbles at all so using only %played_times_js%  would be good enough for me, but thinking again about it... your plugin is mostly used by people who use lastfm, so it makes sense to use both features even if it requires a bit more of work.

Quote
I honestly don't know if anyone besides you or me is even using the actual played times for anything currently
Honestly, being so easy to add thinks using js to Foobar, I plan to expand the scripts more to add complex UI/statistics features (specially if SMP is developed with those aims in mind).

This was just a "top tracks" playlist generation script, but I could add anything seen on web players... like music recommendations using played tracks history, weighting tracks for inclusion on other playlist generation scripts, etc. the sky is the limit. So I see some potential on having %played_times_combined% for simplicity.

Also it would be great to update the entire library on demand with your plugin using a menu option or a popup after installation  (as far as I know the variables are only updated after playing the track for the first time).

And maybe adding 'artificial' play counts to last date, if first play count and last play count were from same year/month. I know you can't retrieve the real date, but that would at least preserve some info about the most aprox. date. Otherwise, on next play, the variables are updated, that info is lost and playcount and js variable differ in size.
Code: [Select]
playcount: 9
firstPlay : 2011-Sep
lastPlay: 2011-Dec
--> We can be sure those 9 playcounts must be from Sep to Dec.

Installation. After playing it now, with your plugin:
playcount: 10
firstPlay : 2011-Sep
lastPlay: 2021-Mar
playcount_js [2011-Sep, 2011-Dec,2021-Mar]
--> Previous info is lost.

My suggestion:
playcount: 10
firstPlay : 2011-Sep
lastPlay: 2021-Mar
playcount_js [2011-Sep, 2011-Dec, 2011-Dec, , ...8 times more on Dec ...., 2021-Mar]
--> Info is at least partially accurate for any date previous to installation

Thanks

PD: answered the pms, sorry for the delay. That's why I use the email

Re: [SMP] Music Graph development

Reply #52
Some updates about merging all playlist tools.
- Added library tag checking tool script and entry on menu (tools). Checks all tag values from selected tracks for spelling errors or misplacing values in wrong tags, and reports identified errors (true positives), other posible errors, and possible fix. See this:  https://hydrogenaud.io/index.php?topic=120738.msg995165#msg995165


- Some config and variables are saved as properties to be maintained on script reload. Global variables are configurable.


- Menus are created dynamically according to the components or scripts installed. i.e. without playcount_enhanced component, the related entries are not created and are substituted with query functionality. The same for scripts, if something is not found, then that menu is not created.
- Added multiple greyed headers entries explaining the menus.
- Multiple bugfixes.
- Added multiple new special playlists.
- Moved remove duplicates and filtering to Tools submenu (along check tags).
- Separated config for remove duplicates and filtering, now they use different set of tags (configurable).
- Created a button to call the menu. Can be integrated with bars, and other buttons using the buttons framework.
- Added a tooltip function which shows info from focused track (the one to be used by the menus).



Re: [SMP] Music Graph development

Reply #53
Just sent an email to anyone who wrote me at some point with all scripts. Have tried to solve all bugs and make things as easy as possible. All previous reports for the playlist manager were fixed too.
If anyone is interested please drop me a line
regorxxx@protonmail.com

Left to do:
- Waiting for WilB's response about notifying tags on playback (for world map integration).
- Waiting for TheQwertiest's response about SMP methods to work with fpl (for playlist manager and Search by distance)
- Waiting for MordredKLB's response about play count future (for top tracks per year)

As soon as those things get solved, I think they are ready for public release.

Re: [SMP] Music Graph development

Reply #54
New update:
- Contextual menu to find playlists where the selected tracks reside in.
- Contextual menu to remove selected tracks from playlist where they reside in.
- Locked playlists are grayed on remove menu (but shown).
- Current playlist is grayed on find menu (but shown).
- See this: https://hydrogenaud.io/index.php?topic=120761.msg995424;topicseen#new
- In any case, only playlist with the tracks are shown; contrary to legacy command, which shows all and gives no indication about playlist having the tracks or not... being totally useless then.
X

- Splits list at 10 or 20 elements (> 100) per sub-menu if more than 10 playlists are to be shown. (fixes the UI cluttering of the legacy command with infinite entries shown at the same time) (for demonstration purpose, here it's split at 2 elements)


Have not made any other big change, so I can send new links now without further testing. If anyone is interested please drop me a line
regorxxx@protonmail.com

Re: [SMP] Music Graph development

Reply #55
regor I have this error :
Error: Spider Monkey Panel v1.4.1 (Playlist Generation Menu: Playlist Generation Menu by xxx)
GetQueryItems failed:
Invalid filter expression

File: search_same_by.js
Line: 230, Column: 29
Stack trace:
  do_search_same_by@search_same_by.js:230:29
  func@playlist_tools_menu.js:160:120
  _menu/this.btn_up/<@menu_xxx.js:222:5
  _menu/this.btn_up@menu_xxx.js:220:19
  newButtons.menuButton<@<main>:56:8
  SimpleButton/this.onClick@buttons_xxx.js:134:31
  on_mouse_lbtn_up@buttons_xxx.js:211:17

This happens when I do this : Playlist Tools - Special Playlists - Music by same composer(s) as artist(s)

This is the selected file that makes this error to appear :
Brad Fiedel - It's Over (Remastered 2017).flac
Album: Terminator 2: Judgment Day (Remastered 2017)
Genre: Filme/Jocuri video; Muzică de film

Also, that photo that you posted... on the right of the album art, where you have :
Field             Value
Metadata   
Artist           A flor de piel

What component is that ? Or is it a script?


Re: [SMP] Music Graph development

Reply #56
regor I have this error :
Error: Spider Monkey Panel v1.4.1 (Playlist Generation Menu: Playlist Generation Menu by xxx)
GetQueryItems failed:
Invalid filter expression

File: search_same_by.js
Line: 230, Column: 29
Stack trace:
  do_search_same_by@search_same_by.js:230:29
  func@playlist_tools_menu.js:160:120
  _menu/this.btn_up/<@menu_xxx.js:222:5
  _menu/this.btn_up@menu_xxx.js:220:19
  newButtons.menuButton<@<main>:56:8
  SimpleButton/this.onClick@buttons_xxx.js:134:31
  on_mouse_lbtn_up@buttons_xxx.js:211:17

This happens when I do this : Playlist Tools - Special Playlists - Music by same composer(s) as artist(s)

This is the selected file that makes this error to appear :
Brad Fiedel - It's Over (Remastered 2017).flac
Album: Terminator 2: Judgment Day (Remastered 2017)
Genre: Filme/Jocuri video; Muzică de film

The problem is the query created. You must check the console logs to see what the problem was (?) I can not give you any more info about it, without the query. The query is logged before executing it, so it will be present even if it crashes. It may be a problem with the forced query you set or a specific problem with that track.

For sure, I can execute the menu without problems with the latest release on tracks with or without composer tags (maybe you are using a previous version? I fixed something related on last release). Anyway I will warn with a popup instead of a crash when the created queries are invalid on next releases. I already do that for forced queries, but created queries should never be wrong (that was the point).

For ex, a track with composer tags: Michael Kiwanuka; Dean Josiah Cover
On console:
Quote
[20:01:30] Playlist created: (artist IS Michael Kiwanuka OR artist IS Dean Josiah Cover) AND 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

The plugin is Item Properties panel from Columns UI (I think it's a panel from the UI, not another plugin).

Re: [SMP] Music Graph development

Reply #57
It seems I wasn't using the latest scripts, I posted the message on 1, April and the email with the new scripts arrived in 31, March , and I wasn't aware of that, sorry I didn't checked the emails in that day. BUT , even with the new scripts, I have the same error, this is the console log :
Playlist created: (artist IS ) AND 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
foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.4.1 (Playlist Tools Menu: Playlist Tools Menu by xxx)
GetQueryItems failed:
Invalid filter expression

File: search_same_by.js
Line: 230, Column: 29
Stack trace:
  do_search_same_by@search_same_by.js:230:29
  func@playlist_tools_menu.js:161:120
  _menu/this.btn_up/<@menu_xxx.js:221:5
  _menu/this.btn_up@menu_xxx.js:219:19
  newButtons.menuButton<@<main>:56:8
  SimpleButton/this.onClick@buttons_xxx.js:134:31
  on_mouse_lbtn_up@buttons_xxx.js:211:17

It seems this might be the problem "(artist IS )"?
I don't have the composer tag for this file , BUT I tried on other files without composer tag and no crash happens.
Also the file is not corrupt ( I verified with foobar component, File Integrity Verifier and also other tools)
For me this is not a big problem, because until now this error happened only for this file but I thought you should know.

Re: [SMP] Music Graph development

Reply #58
It seems I wasn't using the latest scripts, I posted the message on 1, April and the email with the new scripts arrived in 31, March , and I wasn't aware of that, sorry I didn't checked the emails in that day. BUT , even with the new scripts, I have the same error, this is the console log :
Playlist created: (artist IS ) AND 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
foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.4.1 (Playlist Tools Menu: Playlist Tools Menu by xxx)
GetQueryItems failed:
Invalid filter expression

File: search_same_by.js
Line: 230, Column: 29
Stack trace:
  do_search_same_by@search_same_by.js:230:29
  func@playlist_tools_menu.js:161:120
  _menu/this.btn_up/<@menu_xxx.js:221:5
  _menu/this.btn_up@menu_xxx.js:219:19
  newButtons.menuButton<@<main>:56:8
  SimpleButton/this.onClick@buttons_xxx.js:134:31
  on_mouse_lbtn_up@buttons_xxx.js:211:17

It seems this might be the problem "(artist IS )"?
I don't have the composer tag for this file , BUT I tried on other files without composer tag and no crash happens.
Also the file is not corrupt ( I verified with foobar component, File Integrity Verifier and also other tools)
For me this is not a big problem, because until now this error happened only for this file but I thought you should know.

Yep, obviously the problem is "(artist IS )". In this case, your file probably has a composer tag but its value is a blank space, some strange char or simply empty (null tag?). A blank space is a valid tag value, but on queries that translates into an error. On future versions, the script will not crash but give an error popup. So while your problem is not a bug with the scripts but an error on your files, it will at least warn about those issues without crashing.

Btw, the new scripts have a tools/check tags menu. Try it on your entire library and it will probably report that error and some more ;)
X

Re: [SMP] Music Graph development

Reply #59
New update on Playlist tools:

- Contextual menu to find playlists where the current playing track resides in. Also indicates which one is the playing playlist. Obviously clicking on the playing playlist is equivalent to 'Active now playing' foobar's menu, the difference here is that you can find the track in other playlist too (or find the playing playlist name without activating it).


- Contextual menu to filter playlists by query: A predefined set of queries is given, but they can be added or removed using the menus. These options complement the filtering by tags (usually used to remove duplicates), allowing to filter a playlist in any imaginable way.


- Added multiple config menus for all tools.

- Find in/ remove from Playlists menus can be set to only be created when selecting a max. number of tracks. Why? Because selecting 100 tracks means trying to find them, one by one, in all your playlists... which can slow down the UI when creating the button. Common use case is trying to find 1 or a few tracks in different playlists, not too many. This option solves the problem.

Re: [SMP] Music Graph development

Reply #60
New update on check_library_tags:
- Identified errors like empty tags, blank spaced tags (any number) & multivalued tags not split are always found and reported first, for the entire list of tracks selected. (will report problems like this: https://hydrogenaud.io/index.php?topic=120394.msg995807#msg995807)
- Then other errors according to the freq. threshold of apparition and max number of tag values per tag to report are shown.
- Some speed improvements and minor fixes. Takes 1-2 secs for 70 K tracks.


- Added an option to check tags against an user configurable dictionary. de_DE, en_GB, en_US & fr_FR are provided for demonstration, and en_US set as default. Other Hunspell-style dictionaries can be added. Obviously, checking tags against a dictionary is slower than any other method (+30 secs), so it's only done if it's configured at the properties panel. (planned to add configs as menus too)
-  The dictionary method also suggest some alternative terms. Right now the alternatives are unfiltered. Although pretty good, I plan to fine tune them showing only those that pass some threshold according to their Levenshtein distance. (85% like the other suggestions found when comparing tag values among them)



Re: [SMP] Music Graph development

Reply #61
regor, thanks for the message and for your help. Yes, I tried tools/check tags menu (and I replaced the code from check_library_tags.js as you said) but it didnt worked. The file doesn't have a composer tag or the value is a blank space, some strange char . This is how I solved the issue :
Solution 1- I converted the file (actually the entire album because the error appeared for all the files from this album) in flac again ( I tried in mp3 also), keeping the tags the same without any modification , problem solved no more errors, the script doesnt crash.
Solution 2 - I noticed the files don't have BPM in the tags so I used Serato to get the BPM ---problem solved without quality loss, no more errors. This was my fav solution , because I didn't wanted to convert the files again. What is strange is that I tried to add manually the value for BPM, but that error doesn't disappear. I even tried to add the BPM with the foobar plugin for BPM but the result was the same, the error was still there. I don't know what Serato did, but it did a good job :) Maybe is not tag related?

A few things about BPM and Key . I tried to do a comparison between MusicBrainz Picard and Serato, about the accuracy of detecting BPM and Key. From what I tested both are doing a great job (obviously is not 100% accurate) without significand differences in results.
A few differences exists:
Advantages for Serato ; the speed, the values for the tags are obtained much quickly
Disadvantages for Serato ; it's not free. Also the value from Date tag is modified after analyzing the files : for example 1991-01-01 it becomes : 1991 ( the day and the month disappear) .You can solve this by copying the values from the Date tag in another tag , before analyzing the files (obviously not a perfect solution)
Advantages for MusicBrainz Picard : It's free
Disadvantages for MusicBrainz Picard : it's not so fast like Serato , it involves a few more steps to do, to obtain the values for the tags.
Also for the BPM these deserve to be also mentioned :  foo_beatit https://hydrogenaud.io/index.php?topic=104631.0 and foo_bpm
https://www.foobar2000.org/components/view/foo_bpm
Let's say for example that both Serato and MusicBrainz Picard have obtained a wrong value for BPM, you can use one of these foobar components to analyze the file or you have the option to do it manually (Manually tap BPM) , which is great (MusicBrainz Picard can't do that)

Many days ago I wanted to ask you about a problem that Foobar has : the lack of a contextual menu to find ONLY the playlists where the selected tracks reside in . Fortunately you were much quicker and you solved the problem before I even had the chance to ask. So, huge congrats for this :) I use Foobar from 2005, I have also used Winamp, Aimp, Jriver,  and a few years ago I used MusicBee for a year. before I returned to Foobar again, MusicBee had this feature, contextual menu to find ONLY the playlists where the selected tracks reside in, so it was a bit frustrating that this wasn't possible in foobar. But now it is, thanks to you. Also I had the values for the Key tag but they were useless in audio players (they were useful only in dj programs like Serato, where you can do Harmonic Mixing) . More than a year ago MusicBee released a plugin that finally used the Key tag , so obviously your scripts are a very very good news for foobar, because it adds features that foobar was lacking , making it an even more complete audio player

Now a few suggestions (if it's possible and if you like the ideas):
1.Is it possible to have a component or SMP script that can replace this :  https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Playlist_Revive_(foo_playlist_revive) ? The component does a great job BUT there is a problem : when you change the drive letter (lets say from D to G) then the component is useless:  dead items in a playlist are not replaced  with the matching ones in media library.
2 A script for SMP:  Spectrogram Seekbar? https://pastebin.com/6n0ZmTtB  This one is for WSH panel it requires SoX and ffmpeg to analyze the files. In CUI is not possible to add to the layout the Spectogram , only in DUI.

Re: [SMP] Music Graph development

Reply #62
regor, thanks for the message and for your help. Yes, I tried tools/check tags menu (and I replaced the code from check_library_tags.js as you said) but it didnt worked. The file doesn't have a composer tag or the value is a blank space, some strange char . This is how I solved the issue :
Solution 1- I converted the file (actually the entire album because the error appeared for all the files from this album) in flac again ( I tried in mp3 also), keeping the tags the same without any modification , problem solved no more errors, the script doesnt crash.
Solution 2 - I noticed the files don't have BPM in the tags so I used Serato to get the BPM ---problem solved without quality loss, no more errors. This was my fav solution , because I didn't wanted to convert the files again. What is strange is that I tried to add manually the value for BPM, but that error doesn't disappear. I even tried to add the BPM with the foobar plugin for BPM but the result was the same, the error was still there. I don't know what Serato did, but it did a good job :) Maybe is not tag related?

Well if the files are corrupted in some way, then that's beyond the scripts capabilities... sure foobar has some built in tools to check for malformed tags (that's not the point of my script anyway, which only checks their values).

Quote
A few things about BPM and Key . I tried to do a comparison between MusicBrainz Picard and Serato, about the accuracy of detecting BPM and Key. From what I tested both are doing a great job (obviously is not 100% accurate) without significand differences in results.
A few differences exists:
Advantages for Serato ; the speed, the values for the tags are obtained much quickly
Disadvantages for Serato ; it's not free. Also the value from Date tag is modified after analyzing the files : for example 1991-01-01 it becomes : 1991 ( the day and the month disappear) .You can solve this by copying the values from the Date tag in another tag , before analyzing the files (obviously not a perfect solution)
Advantages for MusicBrainz Picard : It's free
Disadvantages for MusicBrainz Picard : it's not so fast like Serato , it involves a few more steps to do, to obtain the values for the tags.
Also for the BPM these deserve to be also mentioned :  foo_beatit https://hydrogenaud.io/index.php?topic=104631.0 and foo_bpm
https://www.foobar2000.org/components/view/foo_bpm
Let's say for example that both Serato and MusicBrainz Picard have obtained a wrong value for BPM, you can use one of these foobar components to analyze the file or you have the option to do it manually (Manually tap BPM) , which is great (MusicBrainz Picard can't do that)

Right. I simply mention Picard as one utility that can do it, but there are many more. I also use one of those foobar plugins to manually edit BPM from time to time as you noted. Its your choice to use the tool that suits your needs. Anything that gives a BPM is good enough (since tags can be mass renamed later).

Quote
Now a few suggestions (if it's possible and if you like the ideas):
1.Is it possible to have a component or SMP script that can replace this :  https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Playlist_Revive_(foo_playlist_revive) ? The component does a great job BUT there is a problem : when you change the drive letter (lets say from D to G) then the component is useless:  dead items in a playlist are not replaced  with the matching ones in media library.
Have to look at it, but if my understanding of playlists is right, then it should be pretty trivial to do it with a script. The playlists store the handle's path of every item, so I can easily find a match if the only thing that changes is the path. Doable.
I would also prefer to have it done via script, to reduce the number of components being loaded by an exe on windows (I'm already at the max which creates bugs on VST plugin loading).

You can also save the playlist as m3u, and edit it replacing drive letters. Or use an external tool like listfix (recommended):
https://sourceforge.net/projects/listfix/

Quote
2 A script for SMP:  Spectrogram Seekbar? https://pastebin.com/6n0ZmTtB  This one is for WSH panel it requires SoX and ffmpeg to analyze the files. In CUI is not possible to add to the layout the Spectogram , only in DUI.
I use CUI and I'm not sure what the problem is? You can not add multiple SMP bars to the menu bar (which I find annoying and I would suggest to change that). But that's a foobar's design decision.  I don't see why you can't add a new bar as an independent panel just below the menu bars (?) I mean, if that script is working in WSH, my own version will not do anything differently. You should ask marc2003 @snotlicker to update it for SMP though, if he has interest. I'm not so interested in UI scripts if they are just eye candy, so that would be really low in my priority list.
X

Re: [SMP] Music Graph development

Reply #63
The playlists store the handle's path of every item, so I can easily find a match if the only thing that changes is the path.

But what if the drive letter isn't the only change? For example you move the files on another drive but also in different folders? Is this still possible? Thanks anyway, for trying to do something about this, when you'll have time.
Yes, I know about listfix, great tool indeed but obviously it will be awesome if this can be done in foobar without the need of another external tool (and also it will complement the other tools that you already have for playlists).
About a possible script for SMP:  Spectrogram Seekbar , Sorry, I wasn't clear enough. What I wanted to say is this. For those that use DUI , they already have the possibility to add a Spectrogram panel to the layout, for us on CUI this is not possible (sure, you can do this: View - Visualizations - Spectrogram . But it's only a popup panel, you can't add a panel with the Spectrogram to your layout). To solve the problem this script (Spectrogram Seekbar) for WSH panel exists.
But I understand your opinion, so no problem. Maybe snotlicker will try to do it. It's not entirely useless, to have a visual look about the quality of a song. and it looks great too :)

Re: [SMP] Music Graph development

Reply #64
The playlists store the handle's path of every item, so I can easily find a match if the only thing that changes is the path.

But what if the drive letter isn't the only change? For example you move the files on another drive but also in different folders? Is this still possible? Thanks anyway, for trying to do something about this, when you'll have time.
Yes, I know about listfix, great tool indeed but obviously it will be awesome if this can be done in foobar without the need of another external tool (and also it will complement the other tools that you already have for playlists).
About a possible script for SMP:  Spectrogram Seekbar , Sorry, I wasn't clear enough. What I wanted to say is this. For those that use DUI , they already have the possibility to add a Spectrogram panel to the layout, for us on CUI this is not possible (sure, you can do this: View - Visualizations - Spectrogram . But it's only a popup panel, you can't add a panel with the Spectrogram to your layout). To solve the problem this script (Spectrogram Seekbar) for WSH panel exists.
But I understand your opinion, so no problem. Maybe snotlicker will try to do it. It's not entirely useless, to have a visual look about the quality of a song. and it looks great too :)
Finding the same track at different folders is possible but requires some guessing. If all tags are stored in database and you did not change them, then it's trivial with 100% accuracy. Otherwise, the tool could replace a missing track with another "similar" enough track, but I would prefer 100% accuracy whenever it's possible.

Ok now I get your point. You are right. But anyway I'm only working on SMP scripts, so creating a component for such panel is out of my list.
It can be done on SMP, but being already done on WSH, it's not a priority for me since you can install both components and integrate it into a  WSH panel. And then snotlicker should be the one updating his scripts, but if I find time to port it at some point and it's easy enough I will take care of it.

I would ask CUI's author in his thread about integrating DUI panels into CUI panels. It has been already suggested many times and it was in the ToDo list (I think). That would solve the issue along many others (for ex. facets being only available as popup too).

Right now I consider:
      - Revive dead items on playlist.
      - Reuse the sorting logic of Special Playlists to sort playlists already created by the user:  the idea is getting the best of both worlds, playlists manually created and intelligent sorting to make them sound "right"
            - Using harmonic mixing (already coded)
            - Incremental keys (they must be translated into Camelot wheel notation, already coded)
            - Scattering instrumentals (already coded)
            - BPM (can be done using foobar sorting, but since I will add the others, will add this one too to the menus for simplicity)
            - ...
      - Expand the world map code:
             -  Show statistics about the location of all artist on library.
             -  Merge near enough locations into "zones", to draw the points for multiple artists.
             -  Use the points to create playlists based on the zone selected with artist from that zone.
             -  ...

Re: [SMP] Music Graph development

Reply #65
The playlists store the handle's path of every item, so I can easily find a match if the only thing that changes is the path.

But what if the drive letter isn't the only change? For example you move the files on another drive but also in different folders? Is this still possible? Thanks anyway, for trying to do something about this, when you'll have time.
Yes, I know about listfix, great tool indeed but obviously it will be awesome if this can be done in foobar without the need of another external tool (and also it will complement the other tools that you already have for playlists).
About a possible script for SMP:  Spectrogram Seekbar , Sorry, I wasn't clear enough. What I wanted to say is this. For those that use DUI , they already have the possibility to add a Spectrogram panel to the layout, for us on CUI this is not possible (sure, you can do this: View - Visualizations - Spectrogram . But it's only a popup panel, you can't add a panel with the Spectrogram to your layout). To solve the problem this script (Spectrogram Seekbar) for WSH panel exists.
But I understand your opinion, so no problem. Maybe snotlicker will try to do it. It's not entirely useless, to have a visual look about the quality of a song. and it looks great too :)
Finding the same track at different folders is possible but requires some guessing. If all tags are stored in database and you did not change them, then it's trivial with 100% accuracy. Otherwise, the tool could replace a missing track with another "similar" enough track, but I would prefer 100% accuracy whenever it's possible.
Got it working. Workflow is simple, gets the list of tracks (from selection or playlist) and finds the dead items.
Then applies a query to the library according to their title (to make it faster), and compares length and file size.
If an exact match is found, it stops, otherwise it continues with the tags (a track may have changed path and other tags).
If the new track's tags is a superset of the old tags, then it's a match. Otherwise, there is a similarity Threshold... (note the tracks are already filter by title, so a 50% similarity means changing other tags)

Have integrated into the menu, like the other tools. And added different options (on selection, on entire playlist or just simulate)
X

In any case, the results are explained on the console. On simulation, that's the only output (no changes made to playlist)
X
The one chosen is the one with the highest scoring (but on simulation, all possibilities are logged for info). And as always, it can be undo.

Would want to take away the pre-filtering by title at some point (to allow title changes too, replacing it with artist), but it's good enough by now, surpassing the original component functionality.

 

Re: [SMP] Music Graph development

Reply #66
.. was for SMP thread

Re: [SMP] Music Graph development

Reply #67
New update on playlist_revive: (new script)
   Alternative to foo_playlist_revive.
   Playlist Revive makes dead items in a playlist alive again by replacing them with the matching ones in media library.
   A handy utility for those who often move or rename their media files/folders.
   
   Matching:
      - Audio MD5 (Exact Match)
      - Title + Length + Size (Exact Match)
      - Tags (Similarity)
   
   Usage:
      - Select the tracks in the relevant playlist.
      - Apply script (using a button, menu entry, main menu SMP, etc. associated to it).

(more images on previous replies)

Playlist tools:
- Integrated playlist revive.
   + On selected items.
   + On entire playlist.
   + On all playlist.
   + Simulate: outputs only to console without making changes.
   + Find only: Find dead items on all playlist and shows the playlist names.


(more images on previous replies)

World Map:
- Integrated with Biography 1.1.3 script'.
   + Requires mod version (given along my scripts) until it gets updated by its author.
   + Can write locale tags automatically if not present on local files.
- Menus to configure:
   + Following selection or Playback.
   + Enable / Disable.
   + Enable / Disable WilB's Biography integration.


Check tags:
- Added even more error checks which are shown on the report if identified. The last batch should cover most of them.
- Added multiple comments and tips on the report which explain how to solve the errors found.
- Added queries (foobar search / mp3tag) and TF expressions (facets) auto-generated according to the errors found to easily identify the related tracks.


All scripts:
- Multiple bugfixes, Checks for queries to avoid crashes (show popup instead).

Re: [SMP] Music Graph development

Reply #68
New updates on World Map:
- Integrated with Biography 1.1.3 script'.
   + Can write tags to json file instead of track's tags.
   + json data is used even when Biography script is disabled, being an offline database of the tags.
- Search Locale tag, by order, using these sources.
   + Track's tag.
   + json data
   + Biography Script (online)
- Menus to configure:
   + Writing tags (3 options)
- Mouse info:
   + On mouse over a point, a tool-tip is shown with the country name. Point changes color.
X

- AutoPlaylist creation:
   + On click over a point, an autoplaylist is created with any artist on your library from the selected country. Checks for the track's tags, the JSON local database and online data for current playing / selected artist (i.e. it uses the 3 sources if possible).
X

   + Configurable forced query is added too.  (like in all my playlist scripts)
- Info:
   + Added a popup on first execution explaining a bit how the panel works. (plan to add something similar to ALL scripts)
X

TODO:
   + Picard's Plugin to get the tags on batch
   + Autoplaylist creation alternative: Force same genre or style than current track on ctrl + left click. That way it would search any artist from same country and same genre/style, showing culturally related music.

New updates on Playlist tools:
- Added top_rated_tracks script.
   + rating tag and limits (like 1-4) can be configurable. "Top track rating" is automatically calculated with that, getting first higher value, and then lowering it until the playlist is full (configurable playlist size).
   + On menu, it's used along a year or a range of years. So you can easily create a playlist with the most rated tracks from the 70s or a configurable date (or range). (dates are automatically calculated using current year)
   + Configurable forced query added too.
X
X

- Added multiple errors checks on properties, popups, etc. Should be pretty error proof now.
- Added configurable menus, which can be added/removed by the user. Allowing to create your own entries and functionality. (defaults can always be restored)
X
X

- Menu is now enabled when there is no selected, focused or playing track. Any entry which needs a selected track is now greyed out. (previously I simply disabled the entire menu). That way you can use tools not related to a selection even when the active playlist is empty.
X

Re: [SMP] Music Graph development

Reply #69
New updates on World Map:
- Works with multiple selected tracks (draws all points on the map), allowing to show statistics of an entire playlist or library.
- Mouse info:
   + Tool-tip shows the tags added at properties for playlist creation (ctrl modifier).
   + Tool-tip shows the number of tracks for a given country..
X

- AutoPlaylist creation:
   + On click over a point, an autoplaylist is created with any artist on your library from the selected country. It also checks for the any know artist from that country, so those artists are always matched (even if your files have no tags updated yet). Also uses the data from the JSON file, covering any possibility. The rationale is simple, if Ziggy Marley is from Jamaica, the query will look for any track with locale = Jamaica but also for any track with artist = Ziggy Marley... since that artist is always associated to the same country.
X

   + Ctrl modifier: forces an autoplaylist  with artist from selected country AND same tags (2 ,configurable). Currently set to style and genre. When selecting only 1 track is easy, the autoplaylist created forces same genre or style. When selecting multiple tracks, the auto-playlist must match any of the combinations of genres or styles of any given track. In other words, selecting a rock artist's track and a folk artist's track from USA would produce an autoplaylist with artists from USA and genre Rock or Folk.
X

- Config:
   + 2 tags for ctrl modifier autoplaylists:
X

   TODO:
      - Picard's Plugin does not exist yet.

Notes:
Obviously, something similar can be done with "Search same by tags" from previous post. Setting to match the last locale tag and same genre or styles.
But there are some differences:
- The map works even without tracks tagged (while the playlist tool creates the queries based on tags from the selection). Therefore the map works in more situations.
- Playlist creation is done visually selecting a point. To do the same with the other script, you would need to select specifically a track from X country first. With the map you can select the entire library and filter your country with a mouse click.
- The map approach uses all tags from all tracks selected (linked to the selected country), linking easily similar music from the same culture, i.e. you can create autoplaylist from Mali with X different genres just by selecting some of your favorite tracks from Mali. Doing the same with the other script requires a lot more of work.
- Obviously the map is an UI panel, the other is just a tool for playlist creation.
- And the map panel can also tags your files while the other tool is only meant to read and use them.

Re: [SMP] Music Graph development

Reply #70
regor, we have Top Tracks from a year (let's say 2020), I think it's this script:  top_tracks_from_date.js ,  which is great already. But, can we also have Top tracks , from the last 14 days,1 month, 3 months, 6 months?
Btw, great job with Top rated tracks, and the world map.

Re: [SMP] Music Graph development

Reply #71
For simplicity the entry named "From year... " lets you select any year, but I don't allow adding a query like "DURING LAST 57 WEEKS" as you noted. I will change that to allow both inputs.

Re: [SMP] Music Graph development

Reply #72
Update on top_tracks_from_date:
- Allows a 'last' argument which lets you use time expressions instead of an specific year.
   + Only Weeks and Days are allowed.
   + Coded to be easily expandable to new time units if they are added later.
- Works the same than the standard use, but outputs most played tracks within that period.
- Checks if the component (foo_enhanced_playcount) is installed when called. Previously it was only checked at menu creation, now on the function too... since someone may call it at its own buttons or scripts, just for safety.

Update on playlist tools:

- Added a new input entry for the previous feature.

X

Obviously the new functionality requires foo_enhanced_playcount the same than using a year.

Now working on this:
X
search_bydistance.js has a feature which allows to scatter instrumental tracks after playlist creation, to prevent multiple instrumental tracks being in consecutive order. I have taken that base and coded it to be more general, allowing any tag and value to be checked. Just select the items on a playlist and they will be reordered according to the tags (not matched tracks being untouched)....

Next step is sorting by Key using Camelot Wheel notation. Since Keys are strings and not numbers, they can not be sorted using standard foobar functionality without translating the keys into something understandable. Again, the same script has already the code for that translation, so I will port it to allow sorting of any selection by keys (going from 1 to 12).



Finally, I will implement as a standalone utility the harmonic mixing functionality. Since it will be used on an already generated playlist, it will only reorder the items to follow a random harmonic mix. Any track not able to follow the path will be deleted afterwards.

At that point I think all scripts will be more or less done and ready for public release on github. Although I'm still waiting for an SMP update to work with fpl playlists... (otherwise the playlist manager will be incomplete)

Re: [SMP] Music Graph development

Reply #73
For simplicity the entry named "From year... " lets you select any year, but I don't allow adding a query like "DURING LAST 57 WEEKS" as you noted. I will change that to allow both inputs.
Thank you

Re: [SMP] Music Graph development

Reply #74
Update on World Map:
- Previously, Biography integration required a modified version of the script (since the author has not updated it yet) I was supplying along my files. Now the integration is added via script too. There is a menu option to install the mod (it looks for the original file, edits the relevant lines and creates a backup). Is done step by step and can be reverted back. Therefore it's as easy as it can be and I don't need to provide the original file.
- Integration has been expanded and not the Biography panel exposes its entire properties lists to other panels.
- Selection mode changes automatically when changing it on Biography panel, therefore syncing the changes. (previously it would simply broke the sync functionality). A popup is shown to warn about it.
- Since World Map script allows drawing multiple points (therefore allowing multiple selections and not only the focused track) but Biography Panel allows only 1 track (now playing or focused one), handle lists on drawing are compared to only sync the locale tag for the relevant track. That solves the problem produced when selection mode was different in both panels. (anyway it has been fixed too with the sel mode syncing, this is just another check)
- Previous change allows to save the locale tag to files or json even if nothing is drawn on the map. Biography lets you write tags on demand, this lets you write tags as soon as the panel gets refreshed with new data.
- Some bug fixes.
X

Update on Playlist Tools:
- Added readme to most scripts.
- Added readme menu to show the readme of every utility included.
X
- Main readme is shown the first time the script is installed.
- Added sort by Key menu: sorting by Key using Camelot Wheel notation. Since Keys are strings and not numbers, they can not be sorted using standard foobar functionality without translating the keys into something understandable for foobar. The script does that first and  then sorts the playlist using TF.
- Added harmonic mixing menu: DJ-like playlist creation with key changes following harmonic mixing rules using the entire playlist or just the selection. Note something similar was already added on 'Special Playlists'. The main difference is that this menu uses only the current selection/playlist as pool, while the other used 1 track to find similar tracks using complex algorithms (and then used that pool to create the harmonic mix playlist).
X

Update on Search by Distance:
- Added readme. Shown the first time the script is installed.

Update on Playlist Manager:
- Added readme. Shown the first time the script is installed.
- Added menu to edit the playlists path. (instead of using properties panel).
X

Quote
At that point I think all scripts will be more or less done and ready for public release on github. Although I'm still waiting for an SMP update to work with fpl playlists... (otherwise the playlist manager will be incomplete)
This is the only thing missing now.

Meanwhile I will check all files, clean unused things and add comments or explanations to the readmes whenever it's needed for public release. Should be on github on a few days or weeks.