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: Playlist-Tools-SMP (Read 87541 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Playlist-Tools-SMP

A collection of Spider Monkey Panel Scripts for foobar2000, built within a menu, which serves as a hub for 'usage examples' and shortcuts to the most requested foobar missing functionalities: remove duplicates by tags, revive dead items, check errors on tags, spotify-like playlist creation, advanced queries, etc.



Features


It's impossible to offer a complete list of the things that can be done with these tools, in a few words: anything related to playlist creation, sorting, library maintenance, automation, etc. But a readme for every utility can be found using the corresponding menu.

The sky is the limit once you use the current scripts to create your own buttons and tools. Currently contains pre-defined use-cases for these scripts:
  • Most played tracks from...
       .\xxx-scripts\top_tracks.js (requires foo_playcount)
       .\xxx-scripts\top_tracks_from_date.js (requires foo_enhanced_playcount)
  • Top Rated tracks from...
       .\xxx-scripts\top_rated_tracks.js (requires foo_playcount)
  • Same by...
       .\xxx-scripts\search_same_by.js
  • Dynamic queries...
       .\xxx-scripts\dynamic_query.js
  • Similar by... (aka Search-by-Distance-SMP)
       .\xxx*scripts\search_bydistance.js
  • Special Playlists... (contains functionality from the other scripts)
       .\xxx-scripts\search_bydistance.js 
       .\xxx-scripts\search_same_by.js
  • Tools...
    • Remove duplicates
            .\xxx-scripts\remove_duplicates.js
    • Query filtering 
            .\xxx-scripts\filter_by_query.js
    • Harmonic mix (aka Camelot-Wheel-Notation)
            .\xxx-scripts\harmonic_mixing.js
    • Sort by key (aka Camelot-Wheel-Notation)
            .\xxx-scripts\sort_by_key.js
    • Scatter by tags
            .\xxx-scripts\scatter_by_tags.js
    • Check tags
            .\xxx-scripts\check_library_tags.js
    • Write tags 
            .\xxx-scripts\tags_automation.js
    • Find track(s) in...
            .\xxx-scripts\find_remove_from_playlists.js
    • Remove track(s) from...
            .\xxx-scripts\find_remove_from_playlists.js
    • Playlist Revive
            .\xxx-scripts\playlist_revive.js

The menus are highly customizable. They are created on demand according to the selected tracks or current playlist, and many entries can be added, removed or edited to suit your needs. Also if some scripts are missing, the menu is rebuilt skipping those entries (letting you to install selectively what you need).



Also integrates
 1. Search-by-Distance-SMP: creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.
 2. Music-Graph: An open source graph representation of most genres and styles found on popular, classical and folk music.
 3. Camelot-Wheel-Notation: Javascript implementation of the Camelot Wheel, ready to use "harmonic mixing" rules and translations for standard key notations.
 4. Menu-Framework-SMP: Helper which allows to easily create customizable and dynamic menus.


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

There are buttons bars and independent buttons for each script and the playlist tools menu. 'buttons_playlist_tools_menu.js' is associated to the tools menu seen on the gifs, while '_buttons_merged.js' is the entire bar.

Download latest release (or nightly releases) at github:
https://github.com/regorxxx/Playlist-Tools-SMP

Re: Playlist-Tools-SMP

Reply #1
For the next release I'm working on macros. i.e. the ability to record and save multiple calls to different menu entries. For ex:
"My macro" -- DO  -> "Most played Tracks" then "Select All" then "Incremental key"
X

Then calling it...
X

It works in conjunction with the menu framework I have already shared, which lets you call menu entries by name, even when the menu has not been drawn. Therefore it's feasible to record where the user clicks when calling the menu, and store the different entries clicked for later usage.

At that point the sky is the limit.... for example, you can create a playlist with top rated tracks from 2021, filter playlist to only allow 1 track per artist, then select 1/4 of the playlist and sort it by key and select the rest and filter to only keep tracks with >4 rating. All that in just one click, totally configurable.

Re: Playlist-Tools-SMP

Reply #2
Finally got macros fully working, with a configurable list, like other submenus previously done.
Only limitation:  Can not save user input on popups. Using entries which make use of those on macros will require user input every time they are called later.
X

To complement the use of macros, 3 new menus has been added: sort, select and cut playlist length.
Sort lets you do standard sorting (randomize, reverse, bpm, date or mood) but also advanced sorting which requires extra logic (by key using Camelot Wheel or by DynGenre).
The key logic was introduced previously, so no need to explain it again.
DynGenre sorting sorts tracks by genre/style considering a continuous line from Industrial music to Downtempo music. Thus similar styles/genres are grouped together. Uses notation described at 'dyngenre_map' on dyngenre_map_xxx.js.
X

The select menu lets you select specific parts of a playlist (like the third quarter), clear the selection, delete selected or unselected tracks, etc.
Obviously it can be used as a standalone utility, but it's real power comes when used along macros.
It allows to automate playlists manipulation along the other tools in the same macro without needing user input.
(for ex.. create a playlist by similar genre -> then select half of the tracks and sort then by incremental key -> then select the other half and sort them by decremental key)
X

The last tool lets you crop playlist length to the desired number, either starting from the beginning or the end of the playlist.
X

Since tools that create new playlists always change focus to those, it should be pretty easy to even create a macro which creates 10 playlist (similar by genre, by key, harmonic mix, etc.) at once with different settings, sortings, lengths, etc. linked -for ex.- to the currently playing track.

Re: Playlist-Tools-SMP

Reply #3
Update the rest of the scripts too (specially the playlist manager) when used along this. The menu framework has a breaking change and it affects multiple scripts.

This release add macros and greatly expanded playlist and selection tools.

## [1.1.0] - 2021-05-26
### Added
- Macros: Pre-recorded multiple calls to different menu entries. Save clicked entries by name.
- Select Menu: New menu meant to be used along macros. Select All / Clear selection. Select first / last track. Select random track (single) /random # tracks (multiple). Delete selected tracks / Non selected tracks. Select by halves. Select by thirds. Select by quarters.
- Cut playlist Menu: New menu meant to be used along macros. From start. From end. (multiple numbers)
- Sort Menu: New menu meant to be used along macros. Randomize, reverse, by BPM, by Mood, by Date, by Key (Camelot Wheel), by genre/style (DynGenre)
- Send playlist to playlist: New menu meant to be used along macros. Sends all tracks from current playlist to another playlist.
- Close playlist: New menu meant to be used along macros.
- Go to playlist: New menu meant to be used along macros.
- Find or create playlist: New menu meant to be used along macros.
- Send selection to playlist: New menu meant to be used along macros.
- Harmonic mixing: multiple debug additions.
- Search by Distance: New config menu.
- Search by Distance: Entry to compute and show graph on browsers.
- Search by Distance: Entries to descriptors.
- Search by Distance: New tool to find genre or styles not set on the graph (descriptors).
- Search by Distance: New entry to test the Graph on demand for errors.
- Search by Distance: New entry to test the Graph on demand against a set of paths predefined on 'music_graph_test_xxx.js'.
- Search by Distance: New entry to reset the Graph cache on demand.
- Search by Distance Cache: is now saved to a json file and reused between different sessions. Cuts loading time by 4 secs for 70K tracks on startup (!).
- Search by Distance Cache: gets automatically refreshed whenever the descriptors crc change. i.e. it will be recalculated with any change by the user too.
- Search by Distance Descriptors: Multiple new additions.
- Portable: Additional checks for portable installations.
### Changed
- Harmonic mixing: small changes and optimizations.
- Harmonic mixing: code for pattern creation moved to camelot_wheel.js.
- Harmonic mixing: code for sending to playlist moved to helpers and reused in multiple scripts.
- Search by Distance: updated with latest changes.
- Search by Distance Debug: Greatly expanded the debug functions to check possible errors or inconsistencies in the descriptors. It should be foolproof now.
- Split tools menu into 3 submenus: Playlist\Selection\Other tools.
### Removed
- Removed all lodash dependence and deleted helper.
### Fixed
- Search by Distance Descriptors: Multiple fixes on descriptors found with the new debug code.
- Buttons framework: icon bugfix.
- 'Top rated Tracks from...\From year' crash on input.
- 'Most Played Tracks from Date' crash.

Re: Playlist-Tools-SMP

Reply #4
Next release will have fully configurable menus, which can be disabled/enabled by pressing shift + click on the button. Pressing on any entry will not load the associated menu anymore. (this in addition to only load entries when the scripts files are present, so they may be disabled either this way or removing the files)

The menu approach is more fine grained, since it allows to delete even parts of the same script (for ex. Only showing 1 Search Similar method).

X

Standard queries have been added too, just like regular foobar search. But entries can be saved, and reused later (like autoplaylist presets). With sorting. Dynamic queries have sorting added too now.

Finally, have added the possibility to add sorting entries to the sort menu (just like the regular foobar sorting). They work in conjunction to the advanced sorting logics (like key or grouping by similar genre), and are meant to be used along macros. Since macros allow to save any set of menu entries, they can now be used as an advanced alternative to autoplaylist and random pools component. Some examples of what you can do with a macro:
- You can set a query, a sort order, remove duplicates by any tag, filter and finally limit length to X tracks.
- Create 5 playlist, with different queries or sources, and use them as pools for a final playlist. (random pools has 2 main limitations: only 1 playlist associated to pools, and no way to mix specific pools to a final playlist -all or nothing-)
- Auto tag tracks found on a playlist (using Go to Playlist -> Select all -> Write tags).
- Send automatically all new added tracks on the library to a playlist for other processing. (Standard query 'Recently added' -> Send to -> ...)
- Etc.

Re: Playlist-Tools-SMP

Reply #5
## [1.2.0] - 2021-05-28
### Added
- Dynamic Queries: sorting can be set (on user configured entries).
- Alt Menu: Shift + L. Click on menu button allows to switch some entries functionality. Individual tools or entire submenus may be disabled/enabled. When all entries from a tool are disabled, the entire script files associated are omitted at loading.
- Standard Queries: new menu to apply standard queries and save user configured entries. Sorting too. (meant to be used along macros as an "autoplaylist" tool combined with other tools)
- Selection: added Global Playlist length as random # selection.
- Cut playlist length: added Global Playlist length as option (from start and end).
- Configuration: can set to which entries forced query is applied: Standad Queries, Dynamic Queries, Search same by tags. In any other case, it's always applied.
### Changed
- Macros: Entry name for last call and forced entries now omits ('main\' or the main menu name) when the entry resides on the main menu. i.e. just use the entry name for main menu entries, and submenu\entry name for the rest.
- Menu framework: updated.
- Legacy Sort: arbitrary sort entries can be added / removed. Standard foobar sorting. Can be undone.
- Advanced Sort: Can be undone.
### Removed
### Fixed
- Dynamic Queries: adding a new entry no longer executes it (thus creating a playlist too).
- Search same by tags: didn't apply user set playlistLength and forcedQuery to created playlists (using functions defaults instead).
- Standard Queries: didn't work when current playlist was empty.
- Cut playlist length: didn't allow undo.
- Send playlist's tracks to...: didn't allow undo.
- Remove tracks from...: didn't allow undo.
- Send selection to...: didn't allow undo.

Also updated the readme (on github) to explain much better what each thing does.

Re: Playlist-Tools-SMP

Reply #6
## [1.3.0] - 2021-05-31
### Added
- Pools: playlist creation similar to Random Pools component. Multiple playlists sources (pools) can be set to fill a destination playlist. Configurable selection length per source, query filtering, picking method (random, from start, from end) and final sorting of destination playlist. Arbitrary presets can be added / removed.
- Pools: the library becomes a source when no playlist name is given. In that case the query is used to retrieve items from the library. At that point is equivalent to using a playlist as a source. i.e. you can mix sources using playlists and library, or even using multiple times the library as source. (This is obviously a shorthand to recreate first the source playlists with macros using queries)
- Pools: queries can also use dynamic queries format, where #TAG# is replaced with value for the currently focused track. i.e. it can create dinamic pools where the query changes according to the selection, thus not forcing an specific playlist type. A 'GENRE IS #GENRE#' source would translate into a rock, jazz, ... playlist according to current selecion. (This is obviously a shorthand to recreate first the source playlists with macros using dynamic queries)
- Presets: entire user preset list can be exported, for editing on a text editor or later importing in another Playlist Tools panel. (Only works for presets added from this release version and future ones)
- Presets: a presets json file can be imported, merging them with current ones (without overwritting).
- Readmes: Sscatter by tags readme added.
- Playlist history: New tool to traverse through the last active playlists by name or simply previous one (useful for macros since you can go back and forth between 2 arbitrary playlists without knowing their names). The tool tries to track playlists even if they are reordered after saving them to the history, only possible if names are unique.
### Changed
- Query filtering: some new default presets.
- Dynamic Queries...: now allow working with multivalue tags by default. i.e. 'GENRE IS #GENRE#' translates into '(GENRE IS Folk) AND (GENRE IS World)' automatically. When using using TF expressions, multivalue tags are not converted, thus the expression is executed 'as is'.
- Dynamic Queries...: standard queries may be added -only- to the end of a dynamic query expression. i.e. 'GENRE IS #GENRE# AND NOT (%rating% EQUAL 2 OR %rating% EQUAL 1)' translates into '(GENRE IS Psychedelic Rock) AND (GENRE IS Hard Rock) AND NOT (%rating% EQUAL 2 OR %rating% EQUAL 1)'. Merging both types of expressions in other positions will not work as intended.
- Dynamic Queries...: to work reliably with multiple dynamic queries on the same expression they must be enclosed on parenthesis, that way the code knows up to what point it must expand the queries. i.e. '((GENRE IS #GENRE#) OR (STYLE IS #STYLE#))' translates into '(((GENRE IS Psychedelic Rock) AND (GENRE IS Hard Rock)) OR ((STYLE IS Acid Rock) AND (STYLE IS Live)))'. Doing it in any other way will not work as intended.
- Query filtering\Filter playlist by... (query): also converts multivalue tags when using dynamic queries.
- Reset all configuration: resetting all no longer deletes all user presets, but asks to merge them with the default ones (or discards them). Presets can also be exported (previous change) before resetting and later re-imported to do essentially the same. If merging is not chosen, then a backup is automatically created.
- Readmes: all readmes entries now follow the same name of the menus automatically.
- Readmes: Dynamic Queries's readme updated with examples and usage rules.
### Removed
### Fixed
- Search same by tags...\By... (pairs of tags): was using default search paramaters no matter the input.
- Search same by tags...\Add new entry: error when remap tags was empty.
- Query filtering\Filter playlist by... (query): last argument used was not being saved.
- Configuration: setting global forced query or playlist length only updated the properties panel, thus not applying the changes until next script reload.
- Missing font fontawesome-webfont (just cosmetic arrow on button).
- Advanced Sort...\Incremental genre/style (DynGenre): Missing sort_by_dyngenre.js file, so menu entry was missing on previous release.
- Changing Global Forced Query via menus also changed Global Playlist Length.



Recommended to use 'Configuration\Reset all configuration...' after installing (to reload the new presets) (*). You will lose any user configured entry on the process (make a backup of the properties panel if needed).

From now on, user presets can be exported and maintained when using "Reset all", thus making easier to update the panel in the future. Or sharing presets, etc.

3 main changes have been added:
-    Pools (i.e. a total replacement of Random Pools component with many more features). They can obviously be expanded even more with macros.
-    Dynamic queries improvements: see changelog for details... but essentially they allow now complex queries and even multivalue tags expansion. 'GENRE IS #GENRE#' translates into '(GENRE IS Folk) AND (GENRE IS World)'
-    Presets: already mentioned at top.

Re: Playlist-Tools-SMP

Reply #7
Am I correct in assuming that all of your scripts go into the root of 'xxx-scripts' instead of subfolders like 'xxx-scripts\Playlist-Tools-SMP'? If so, that seems to me like that could be problematic in the long term just from a management/updating perspective.


Re: Playlist-Tools-SMP

Reply #8
Am I correct in assuming that all of your scripts go into the root of 'xxx-scripts' instead of subfolders like 'xxx-scripts\Playlist-Tools-SMP'? If so, that seems to me like that could be problematic in the long term just from a management/updating perspective.


As you note they are all added to the same root (which is only used by my scripts).

The other scripts (playlist manager, world map) use different files, so there is no mixing, except the main helper which is shared between all of them (and I don't plan to change it more). I know it could bring some problems (if I edit the helper, update a repository but no the rest, and someone installs the oldest files over the new ones, thus using an old helper version) , but right now it makes my life easier so... I can not care less about it since these are clearly WIP things updated every week.

At some point I will simply split the main helper to fix that, use packages, different folders or simply create an additional repository for the helpers, so they are always up to date and a requirement for any other script. The last option is the most probable one I will take, since all the panels require the menu framework, the buttons framework and the main helper.

PD: Also the change-logs clearly indicate if I edit one of those helpers and which things could break if mixing files. And I try to follow semantic versioning, so no such changes should happen between minor releases.

PD2: I would love to use packages but it becomes a nightmare when updating things every week and it totally breaks the buttons bar and the idea of having selectively installed things just by deleting/adding files. Or having other people using my scripts as a base for their own ones. Packages are a zip not meant to be touched. So.. I'm more inclined on the additional repository. (open to suggestions though)

Re: Playlist-Tools-SMP

Reply #9
I know it could bring some problems (if I edit the helper, update a repository but no the rest, and someone installs the oldest files over the new ones, thus using an old helper version)...
This is my point. It becomes much easier to mix up files and much harder to troubleshoot if everything is in the same root directory. Secondly, if all the scripts are in subdirectories a user can just checkout the repositories from git and then just git pull each subdirectory when updates are available.

create an additional repository for the helpers
That is definitely a good solution, but it still doesn't completely solve the problem of everything being convoluted in the root directory. These scripts really need some sort of better organizational structure if your project is going to continue long term and evolve, and it is best to keep that in mind earlier on than changing it later when your project is more mature.

Re: Playlist-Tools-SMP

Reply #10
Quote
This is my point. It becomes much easier to mix up files and much harder to troubleshoot if everything is in the same root directory. Secondly, if all the scripts are in subdirectories a user can just checkout the repositories from git and then just git pull each subdirectory when updates are available.
I don't see whay you can not do that right now? I would not really advise at all to do that with SMP scripts, which sometimes require a bit of thinking  ::)  If someone wants to just pull my changes without checking the changelog can do it, but it will probably break things whether I add 20 subfolders more or not. That's why I add the releases, I don't expect people doing that.

create an additional repository for the helpers
That is definitely a good solution, but it still doesn't completely solve the problem of everything being convoluted in the root directory. These scripts really need some sort of better organizational structure if your project is going to continue long term and evolve, and it is best to keep that in mind earlier on than changing it later when your project is more mature.
Can't say more... Only planned change is to move scripts without buttons to another subfolder, but that's all. That would mean only 3 or 4 scripts in the root folder (if that's what you mean). But I will simply not move the Playlist manager to a directory, and then Playlist tools to another, and then...  Anything which can be loaded within foobar as a panel will be in the main directory (which will be 3 or 4 files, not the 20 files I have right now yep)

Re: Playlist-Tools-SMP

Reply #11
This is the current structure for future releases, that has the planned change I wrote (most files on 'Main').

X

X

Also ngraph and typo will be moved to helpers-external. Good enough?

Re: Playlist-Tools-SMP

Reply #12
For people using All Music and Last. FM tags, here is a pack of presets which use those tags that can be imported using the config menu (they will be included on next releases)

Feel free to share your own presets too, since that's the point of being a tool fully configurable  :) (and I plan to have multiple presets pack which can be installed as addons)


Re: Playlist-Tools-SMP

Reply #13
And another 5 presets for pools, they use standard (*) mood, genre and bpm tags. (in next release pools will be able to use the global forced query too, removing that way low rated tracks, etc. easily)

To install, just use the import menu entry:
X

(*) Neither All Music, nor Last FM tags. But the standard ones you got at picard and found in any program (mood, genre, bpm). If you want to use the others, copy the tags with any editor to standard tags or edit the presets -before importing- by yourself replacing "MOOD" with "ALL MUSIC...", etc.

Re: Playlist-Tools-SMP

Reply #14
v1.4.0 - File restructuring and cleanup + Presets, shortcuts & bugfixes

2 new experimental features (shortcuts and include other scripts), along the file restructuring discussed, new presets and many bugfixes.

## [1.4.0] - 2021-06-07
### Added
- Search by Distance: 4 sets of buttons, one for each method: GRAPH, WEIGHT, DYNGENRE + ONE CONFIGURABLE (method at properties). (This in addition to the fully customizable buttons)
- Shortcuts: Some shortcuts have been added (global shortcuts without requiring panel to be in focus). Are shown on the related menu entries tabbed to the right. Experimental feature, read the popup before activating it at config menu.
- Other tools\Include Scripts: easily include ('merge') multiple SMP scripts into the same panel, thus not wasting multiple panels. Useful for those scripts that don't require any UI, user interaction,... like scripts which set the main menu SPM entries (File\\Spider Monkey Panel). Experimental feature, read the popup before activating.
- Configuration: pools have toogable forced query now.
- Presets: All Music and Last FM presets which use their genre/mood tags (for Search by tags, Dynamic Queries, Playlist Filters and Pools). Pools moods presets (Happy Mix, Sad Mix, Angry Mix, Chill Mix and Slow Chill Mix). Pools genre presets (Rock mix, Hip-Hop mix, etc.).
- Macros: 2 macros examples to test all tools (with or without input). Since all input box have defaults, you can simply press enter and process all without reading for testing.
### Changed
- Search by Distance\GRAPH: mean distance is now also divided by the number of genre/styles of the reference track. That should give more results for tracks with too many tags, while not changing so much for the rest. Distance filters have been updated accordingly in all buttons to reflect the change (and users should do the same in their customized buttons).
- Search by Distance: All buttons have not needed properties deleted to not confuse users about things changed on properties not being reflected on the buttons.
- Buttons framework: updated for better shortcuts and macros compatibility.
- Helpers: Moved all external libraries to 'helpers-external'.
- Helpers: Split 'helpers_xxx.js' file into multiple ones for easier future maintenance.
- Moved all SMP scripts without UI (those not meant to be loaded directly on panels) to 'main'.
### Removed
### Fixed
- Search Same By: button did not work correctly due to bad property parsing.
- Search Same By: bypass query checking if current track has no tags configured on new entry addition. Previously it was not saved due to checking error.
- Playlist manipulation\Harmonic mix: was not working on entire playlist, only on selection in both cases.
- Search by Distance: crashes when trying to access non present properties on the arguments (found while applying the previous changes).
- Search by Distance: crash when sharing cache between 2 panels due to a typo.
- Search by Distance: crash when pool was smaller than set playlist length.
- Pools: using random picking method, sometimes the last element was omitted, thus resulting on (total length - 1) tracks per source choosen.
- Pools: when only 1 track is retrieved from a source, skips picking methods and adds it directly to the final playlist. Previously it was simply skipped (due to previous bug).
- Pools: not working when current playlist was empty. It tried to check for dynamic queries even when there was none, thus failing wihtout a track to check against.
- Pools: random picking method was not really random due to using sort + random method. Using an array shuffle now instead.
- Select...\Select random...: not really random due to using sort + random method. Using an array shuffle now instead.
- Search by Distance: in key mixing and random picking not really random due to using sort + random method. Using an array shuffle now instead.
- Harmonic mix\Harmonic mix from...: not really random due to using sort + random method. Using an array shuffle now instead.
- Tooltip: missing new line before shortcuts tips.

Re: Playlist-Tools-SMP

Reply #15
Finally the integration with Playlist Manager is working, and pools will be able to use either playlists within foobar as source or playlist files in folders tracked by any Playlist Manager instance... This feature allows to use virtual playlists as containers, where you can easily collect tracks (since Playlist Manager allows to send tracks directly to a file without loading it) to be used later on pools without polluting the UI with tons of dummy playlists.

It would be an alternative to tagging files with custom tags (like 'Rock Ballads') to then create queries to send those tracks to playlists (which could also be done with pools). Instead, you could simply send the tracks to a playlist named 'Rock Ballads' and use it later as a source, while not having the playlist loaded within foobar but just on the manager. Obviously there are many other uses (like having an arbitrary number of playlists used as sources: for ex. a mix of all Summer playlists of the last 10 years which obviously could be archived as m3u8 files but makes no sense to have them loaded within foobar polluting the UI).

In resume, sources may be a mix of any of these 3: library (query filtering), playlists within foobar (query filtering optional) and playlist files (idem).

Next release will also have some quality of life changes for presets, with descriptions popups before importing, summary of menu entries which will be added, etc. along better documentation for some tools

A playlist file within a manager instance is used as source using Pools tool. Duplicated tracks are omitted, so only 5 tracks are used (although the total reported count is 12). On the example, 1 more track is taken from the library.
X

An example of a preset created within foobar and exported to json. Used on the screenshot above. Note the queries reported on the console an the ones here doesn't match because a global forced query is added to all sources (configurable).
X

Re: Playlist-Tools-SMP

Reply #16
Continuing with the presets, search by distance buttons will be able to use pre-defined sets of tags (saved as json) instead of a track as source for playlist creation. That's exactly what MusicIp's moods did and here is called "themes". I plan to expand that functionality allowing to save tracks as "themes" on demand and also allow using a playlist as a source (instead of a json file)... but right now it simply uses a json file which emulates one track.

Themes may be added to the properties panel of custom search by distance buttons either as a file path or directly as a JSON string. Whenever that property is set, the theme is used as source instead of the current track.

To make it easier to work with them, custom buttons now have a contextual menu called with shift + L. Click which lets you select any theme file in the presets folder or 'none' (current track standard behavior). Themes may be created easily with any text editor, allowing to create your own sets of buttons for custom playlist creation. An example file is provided.

X

X

X

Finally, continuing the pools feature, search by distance's output may be used as a source (apart from playlist and Library queries), greatly surpassing what Random Pools component and MusicIp allow. Setting a pool this way requires importing a preset file, since it's not viable to add so many arguments via popups.

Allows any of the 3 methods (GRAPH, WEIGHT and DYNGENRE) and uses the previous feature (Themes) along another one "Recipes". Themes would be the "virtual track" used as reference and Recipes work the same than MusicIp's recipes allowing to define how the playlist should be created (the arguments passed to 'do_searchby_distance').

After applying the recipe and theme, under the hood, it does the same than using any search by distance's button or menu entry named Search similar by [graph, ...]. But instead of sending the resulting tracks to a playlist, those tracks are used as source for the pool. Then they are processed the same than any other source on the pool. Any type of source can be mixed too (i.e. using a playlist named 'Rock', a playlist file 'summer.m3u8' in the manager, a library query '%RATING% GREATER 3' and the output of SearchBy to get tracks similar by key and genre to a given reference.

X

Recipe and pools preset example are provided to test it.

In theory the same behavior could be emulated using "macros" feature, creating first the playlist with the appropriate tool, then selecting tracks by any desired order, sending them to the final playlist and repeating the process as long as needed. The difference here is the use of recipes and themes, which allow easy customization and the possibility to use them in multiple presets. Also recipes allow far more detailed config than using menus + macros, since many advanced features are only used/configurable on custom buttons and recipes may set the same arguments than those. And themes allow to create playlists without a reference track, while the menus for [graph, ...] are always associated to a track.

In the end, both tools are complementary and have their uses. Pools is meant as a direct replacement of Random Pools and MusicIp's, offering many more possibilities than them. Macros is a general tool to automatize anything, but obviously is the "hard" way to do it.

Re: Playlist-Tools-SMP

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

See changelog for all changes.

    Playlist manager integration for pools.
    Search by distance integration for pools.
    New presets for pools.
    Recipes and themes for Search by distance.
    Major buttons rework with easy to install and configure toolbars which allow to add\remove buttons on the fly.

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


## [2.0.0] - 2021-06-15
### Added
- Playlist Manager Integration: Listeners to retrieve tracked playlist paths from Playlist Manager panels.
- Pools & Playlist Manager Integration: May now use playlist files tracked by Playlist Manager panels as source. i.e. Playlist A would match first a playlist within foobar with same name, then a playlist file with matching '#PLAYLIST:Playlist A' tag and finally anu playlist file named 'Playlist A.m3u8'. Autoplaylists are excluded (use queries instead) and fpl files too. This feature allows to use virtual playlists as containers, where you can easily collect tracks (since Playlist Manager allows to send tracks directly to a file without loading it) to be used later on pools without polluting the UI with tons of dummy playlists.
- Pools & Search by GRAPH\WEIGHT\DYNGENRE: May now use the output from 'Search by (method)' as source, setting source name as '_SEARCHBYGRAPH_X', '_SEARCHBYWEIGHT_X', etc. (where X is any number). Therefore it allows intelligent playlist creation instead of using queries for the pool. Multiple sources can be set this way (beware of computing time) and mixed with the other sources (library and playlists). This new source may only be used by creating a preset pool with a text editor, since it requires to set so many arguments that is not reasonable to do it via popups. 'recipe' and 'theme' (see below) keys must be set when using this type of source (a recipe may force a theme too). Both may point to a filename (i.e. another preset like themes -see below-) or contain the arguments object. Examples are offered in the presets folder for all use-cases.
- Search by GRAPH\WEIGHT\DYNGENRE: now allows user configurable menus (which can only be added using the properties panel or loading presets). Reasoning: it's not practical to add so many popups to just set a new entry but it makes sense to be able to add new entries to the tool... so it's left to the user to add them manually. The presets may link to recipes and themes as arguments too (see below).
- Search by distance: Recipes presets may be used to set variables of the function. Whenever the argument is set, it's used instead of related property. Custom button now allows to use a recipe file. Once set, button would always use the recipe as arguments instead of the properties variables. A recipe may force the use of a theme.
- Search by distance: custom button now allows to set the recipe file used by pressing Ctrl + L. Click. 'None' would use the current properties variables, which is the default behaviour.
- Search by distance: themes presets may be used as reference instead of tracks. Whenever the argument is set, it's used instead of the selection. Custom button now allows to use a theme file. Once set, button would always use the theme as reference instead of the current selection.
- Search by distance: custom button now allows to set the theme file used by pressing Shift + L. Click. 'None' would use the current selection, which is the default behavior.
- Search by distance: custom button now allows to create a theme file using the currently focused track's tags.
- Configuration\Search by distance: new entry to create a theme file using the currently focused track's tags.
- Readmes: for Presets usage, Global Shortcuts, Include Script, Search by GRAPH\WEIGHT\DYNGENRE (specific readmes for each method) and Recipes\Themes.
- Presets: new presets for Search by GRAPH\WEIGHT\DYNGENRE.
- Buttons: new 'buttons_toolbar.js' toolbar which can be customized without editing the js file. Allows to enable/disable buttons -even add multiple copies- on demand and customize toolbar background color (L. Click on the bar).
- Buttons: new 'buttons_playlist_history.js' button. On click switches to previous playlist (since it's a switch, pressing it indefinitely always switches between the same 2 playlists). Shift + L. Click shows the entire list of previous playlists.
### Changed
- Popups: all titles renamed to script name + sub menu name.
- Presets: current date is added as description when exporting user presets or creating a backup.
- Presets: now include a description ('readme' key) which is shown after importing them. Property associated is also shown (the one linked to each configurable menu), along the entries -ny name- which will be imported. Presets are not imported until popup is accepted.
- Search by distance: shows on console the track or theme used as reference (name and path).
- Search by distance: custom button code cleanup and improvements on name changing.
- Search by distance: custom button tooltip shows the theme and recipe being used, along tips to change them.
- Readmes: updated pools readme with latest changes.
- Data: json file for presets is now formatted to be readable.
- Portable: when properties are set for the first time, now use relative paths on profile folder for portable installations (>= 1.6). When possible, any other stored path is also stored as relative paths (for example themes or recipes on buttons).
- Buttons: icons to all buttons.
- Buttons framework: skip icon drawing if font is not found.
- Buttons framework: allow a menu when clicking on the panel (and not on buttons).
- Helpers: warn about missing font on console if trying to load a font and is not found.
- Code refactoring and cleanup.
- Split all buttons into examples, toolbar and buttons folder. 'buttons_toolbar.js' is now the main script -in root folder- which can be loaded within a panel for easy configuration of buttons from this repository or any other. 'buttons_playlist_tools.js' is the independent button.
### Removed
### Fixed
- Presets: after resetting all config, presets were not being deleted.
- Presets: duplication after adding multiple presets.
- Pools: crash removing entries due to a typo.
- Search by distance: setting both genre and style weights to zero output nothing with GRAPH method instead of using the values for the graph and not for weighting.
- Search by distance: when playlist length is set to Infinite, warnings are no longer shown about number of tracks being less than it (which obviously always happened).

Re: Playlist-Tools-SMP

Reply #18
A small gif to show how the buttons work now:
X

Everything is now configurable on the bar, either with menus or properties. If you want multiple copies of the same button, just add it again. Buttons can be repositioned and the background is customizable.

Playlist tools also has the enable/disable menu to switch functionality of its entries.

And search by distance buttons are fully configurable with either themes, recipes or individual arguments set on menus to your liking. Recipes may link to (forced) themes. And pools may link to both. So presets can be created inheriting multiple files easily.

This should be the end of the file restructuring, making it easier to update thins on the future too.

Re: Playlist-Tools-SMP

Reply #19
v2.0.1 - Bugfixes and shortcuts/query improvements
Minor bugfixes and improvements. See changelog.
Recommended to call 'Configuration\Reset all configuration...'  to load the new changes. You can maintain your presets (see the popups), so only new changes are applied ;)
Don't forget to apply 2.0.0 recommendations too if updating from a earlier version!


## [2.0.1] - 2021-06-17
### Added
- Shortcuts: now saved as json file (at '.\profile\js_data\playlistTools_shortcuts.json'), to be easily configurable. Shortcuts can be arbitrarily added, changed or deleted. Menu entries linked to a shortcut will show the keys in their name tabbed to the right. See popup when enabling them. New entry to open shortcuts file.
- Standard queries...: New default standard queries to retrieve entire library with or without forced query. Restore defaults to load them. (To be used with macros)
- Macros: New default macros to check all library tags (automates retrieving entire library and using check tags). Restore defaults to load them.
- Global Forced Query: 'Playlist Manipulation\Query filtering' is now also added to the list of toogable forced query application.
### Changed
- Queries behavior on Standard queries, Dynamic queries, Query filtering and Pools menus is now unified. 'ALL' always retrieves entire source, no matter if global forced query is enabled or not. Empty retrieves source filtered with forced query (or behaves as 'ALL' if it's disabled). Updated related readmes with the changes.
- Config menu: reworked a bit the menus for Global forced query, Shortcuts and presets.
### Removed
### Fixed
- Check tags: Fixed typo on dictionaries path after file restructuring on latest release. Recommended to reset folder calling 'Other Tools\Check tags\Configure dictionary...\Sets dictionaries folder...' and deleting the current value. Then the default one will be restored.
- Duplicates and Tag filtering:  User settings (tags and number allowed) were not being loaded at startup.
- Standard queries...: menu error when using a query with 'ALL' and global forced query was enabled.
- Typo on 'Top rated Tracks from...\From year...'. Adjusted 'Test Tools (with input)' macro with the change. Recommended to restore defaults for macros to apply the change (and change any user-set macro with that entry).

Re: Playlist-Tools-SMP

Reply #20
v2.0.2 - Symlink zip decompressing hotfix
This is just a copy of the previous release with replaced symlinks, using duplicated files instead. Some file archivers (like 7zip) don't manage symlinks well and gave errors decompressing the zip... so this fixes it. PeaZip works fine, but since 7zip is pretty popular...

There are no other changes, so if you had no problems using the previous release, can be skipped


## [2.0.2] - 2021-06-20
### Added
### Changed
- Duplicates of main buttons files are now on the root, instead of using symlinks. Some file archivers, like 7zip, did not decompress correctly the releases...
### Removed
### Fixed

.

Re: Playlist-Tools-SMP

Reply #21
A problem about playlist revive.....When I move a file from a partition to another partition , let's say D\music to E\music (obviously the folders are included in the media library) or when I rename a folder this is what happens

Playlist Tools - Other Tools - Playlist Revive - Replace dead items on selection (or if I use Replace dead items on current playlist), I have this kind of errors :

Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

I don't know why but I can't revive dead items in a playlist....

Problem number 2.
Most played tracks from.....from last -- 1 week (for example)
It seems that songs that have a high playcount are favoured, so they get at the top of the playlist
I'll give you this example: Let's say that in the last week I have listened Bon Jovi - Always , ONLY once, BUT the total playcount for this song is 30.
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed

Re: Playlist-Tools-SMP

Reply #22
Ups missed the comment. Sorry.

Quote
A problem about playlist revive.....When I move a file from a partition to another partition , let's say D\music to E\music (obviously the folders are included in the media library) or when I rename a folder this is what happens

Playlist Tools - Other Tools - Playlist Revive - Replace dead items on selection (or if I use Replace dead items on current playlist), I have this kind of errors :

Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

I don't know why but I can't revive dead items in a playlist....
Will check it since that's clearly a bug! The second query is the MD5 of the file, you are probably using MP3s (or a format without audio crc checksums), they have no MD5, so the query becomes undefined and throws a query error just after testing it.

It was supposed to skip that tag, but I clearly made a mistake. Will be solved on next release, thanks!

Quote
Problem number 2.
Most played tracks from.....from last -- 1 week (for example)
It seems that songs that have a high playcount are favoured, so they get at the top of the playlist
I'll give you this example: Let's say that in the last week I have listened Bon Jovi - Always , ONLY once, BUT the total playcount for this song is 30.
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed
I understand you use both statistics plugins (the one that comes with foobar, and the advanced one which adds playcounts stamps). That tool only works if both are installed, there is a check to disable the tool if they are not found... but just to be sure.

Now you are seeing the tracks are sorted by total playcount,  instead of playcount on the period. Are you are right, I coded it that way (the final sorting after getting the tracks), which It's clearly a typo. Again, will be fixed on next release.
Thanks for both reports

Re: Playlist-Tools-SMP

Reply #23
regor, good news, I solved the mystery with playlist revive. After I read your comment I looked more closely at the audio files. I tested only on flac files (they had tags for Artist, Title, and other tags) I didn't used mp3
I was confused because if you do right click on a file in foobar - Properties - Details , if you look at the panel at section General , you have Audio MD5.
So, I thought, ohh, it's ok. But it wasn't . If you use foo_audiomd5, you'll have in metadata AUDIOMD5...
After I scanned the files with foo_audiomd5, it works (AUDIOMD5 was added in metadata) the dead items in the playlist are replaced correctly
So, this is why these error reports appearred :
Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

and in the console I had this:
Called: Playlist Revive\Replace dead items on selection
Found 1 dead item(s) on active playlist: test
query_combinations(): tagsArray [] was null, empty or not an array

So, if I understood correctly AUDIOMD5 must be present in metadata ( using the component foo_audiomd5), in all the files in the library.

Maybe its possible to add a little warning in the error report about this, to be more explicative, something like this : "files must have a value for AUDIOMD5 tag , scan the files using foo_audiomd5 component " or something else :)

"I understand you use both statistics plugins (the one that comes with foobar, and the advanced one which adds playcounts stamps). That tool only works if both are installed, there is a check to disable the tool if they are not found... but just to be sure."

Yes, I use both plugins (Playback Statistics and Enhanced Playback Statistics). Most Played Tracks in a Year works great  , problems were only with Most played tracks in a period of time (weeks, days), as I said




Re: Playlist-Tools-SMP

Reply #24
No no... Audio MD5 tag is used for query creation, if and only if it's found. It was an "extra" if you also use that plugin (which I do), because it would find the files faster.

But that it's only used at query creation, and should have been skipped if not found. That's the error. Therefore there is no need to warn about foo_audiomd5 since it's not a requirement at all (BUT I could add a note in the readme about it being useful for faster matching).

At a later point I compare md5 info (from file), which as you noted, it's found on the details panel. And only exists for some formats. When there is no md5 info, it simply matches file size. If there is not a match, then it compares tags. and computes a similarity. So... the audio md5 tag is not used at all at later points.

The tools allow to only replace with exact matches or by some similarity threshold. That's why there are so many entries on the tool. Also the "simulate option" just simulates the processing, but does nothing. I prefer to do that always before editing a playlist so I know what will be going on. And finally the console always shows the tracks changed, contrary to what the plugin revive did (which changed things without telling you what was changed).

By the way, there is a readme for every tool at config/readmes. If something doesn't work as the readme says, feel free to report it since that's probably a bug. (and I will add some of these comments there too).