Git Product home page Git Product logo

regorxxx / playlist-tools-smp Goto Github PK

View Code? Open in Web Editor NEW
41.0 4.0 6.0 73.34 MB

A collection of Spider Monkey tools for foobar2000: from removing duplicates, to dynamic queries or "spotify-like" playlist creation.

Home Page: https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-tools-smp/

License: GNU Affero General Public License v3.0

HTML 0.28% JavaScript 99.50% Batchfile 0.20% CSS 0.02%
foobar2000 foobar2000-component spidermonkey-engine music-player playlist-generator foobar2000-smp-script playlist-tools-addon lastfm

playlist-tools-smp's Introduction

Playlist-Tools-SMP

version CodeFactor CodacyBadge GitHub
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.

pt_topplayed

Features

pt_searchbygraph

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 (on configuration).

The collection of scripts provided here are not only an alternative to Random Pools or MusicIp but an improvement and generalization in many aspects of those tools. To use this plugin at its best and to benefit the most from your library, you will want to make sure that your songs have the most possible information on genre, style, key, moods, etc.

  • Macros: allows to record and save the menus entries used, as a macro, to be called later. Automatic custom playlist creation and edits without limits. Works with all tools. (only limitation are popups, which still require user input)
  • Dynamic Queries: queries which adapt to the currently selected track. i.e. placeholders tags are substituted with the actual values of the currently selected track, then the query is evaluated as usual. Queries created this way are pretty situational, save a lot of writing time and are meant to be used by multiple playlist creation tools. Expands foo_quicksearch contextual menus functionality, and works with multiple selection too.
  • Pools1: playlist creation similar to Random Pools component. Multiple playlists \ library 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. They may even use dynamic queries changing the way the pools behave according to selection (for ex. a pool which outputs tracks with same key than selected track + another one which outputs same genre tracks), the main limitation of Random Pools component.
  • Harmonic mixing: Dj-like selection ordering by key or with special patterns. Compatible with Camelot, Open and Standard keys.
  • Fully configurable submenu entries: shift + left click on menu button allows to switch tools 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.
  • User configurable presets: many tools allow you to add your own presets (for ex. Standard Queries) as menu entries for later use. They may be used along macros to greatly expand their functionality, exported and imported as "addons".
  • Keyboard shortcuts: keyboard shortcuts may be assigned to most of the tools (without requiring panel to be in focus). Shown on the related menu entries tabbed to the right. They are assigned the same than native keyboard shortcuts.
  • Include other scripts (experimental): 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).
  • Reduce components loaded: one of the main limitations of windows (and thus foobar) is there is a limit of plugins (dlls) that can be associated to a given process. Thus, in some installations, specially those using VSTs, when the limit is reached strange things start happening, random crashes, bugs, etc. Something I have experienced myself when running a few VSTs. It's not so hard to reach that limit since many components use multiple dlls! When you count the ones by foobar itself, VSTs, etc. as soon as you configure a bit your installation you come into problems. Therefore Playlist Tools is a solution that can help in that sense, replacing multiple components whose functionality is already included (or improved): Random Pools, Playlist Revive, Best version picker, Database Search, ...
  • Online controller integration (ajquery-xxx): online controller fully compatible with most of the offered tools, which can be called as any other main menu entry. Also available with CMD scripting.
  • Wine - Unix - non IE SOs compatible: all the UI, tools, popups, configuration and external helpers have been carefully designed to work in all systems without requiring IE installation, HTML popups or editing the panel properties. Scripts are expected to work 100% the same in any SO.
  • Configurable UI and accessibility design: most of the UI is configurable (size, colors, position, draggable buttons). All the UI is managed within menus, so it may be used with a narrator (for blindness).

pt_customizable

pt_ssametages

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...: from a year or period. (requires Enhanced Playback Statistics)
    .\xxx-scripts\top_tracks.js
    .\xxx-scripts\top_tracks_from_date.js
  • Top Rated tracks from...: from a year or range of years.
    .\xxx-scripts\top_rated_tracks.js
  • Search same by tags...: dynamic queries matching X tags from selection.
    .\xxx-scripts\search_same_by.js
  • Standard Queries: like foobar search but allowing presets.
    .\xxx-scripts\dynamic_query.js
  • Dynamic Queries: queries with placeholders evaluated with selection.
    .\xxx-scripts\dynamic_query.js
  • Similar by...: spotify-like playlist generation. (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
  • Playlist manipulation: multiple tools for playlist edits.
    • Remove duplicates: using configurable tags.
      .\xxx-scripts\remove_duplicates.js
    • Query filtering: filters current playlist with a query.
      .\xxx-scripts\filter_by_query.js
    • Harmonic mix: Dj-like playlist generation by key. (aka Camelot-Wheel-Notation)
      .\xxx-scripts\harmonic_mixing.js
    • Find or create playlist
    • Cut playlist length (for macros)
    • Send playlist's tracks to (for macros)
    • Go to playlist (for macros)
    • Close playlist (for macros)
  • Selection manipulation:
    • Harmonic mix: Dj-like selection ordering by key. (aka Camelot-Wheel-Notation)
      .\xxx-scripts\harmonic_mixing.js
    • Sort
      • Randomize
      • Reverse
      • By Mood
      • By Date
      • By BPM
      • By key: translates keys (Fm -> 4A) and sorts them. (aka Camelot-Wheel-Notation)
        .\xxx-scripts\sort_by_key.js
      • By Dyngenre: similar genres/styles are grouped together. (aka Search-by-Distance-SMP)
        .\xxx-scripts\search_bydistance.js
    • Scatter by tags: reorders selection to avoid consecutive tracks with the same configurable tag.
      .\xxx-scripts\scatter_by_tags.js
    • Find now playling track in...
      .\xxx-scripts\find_remove_from_playlists.js
    • Find track(s) in...
      .\xxx-scripts\find_remove_from_playlists.js
    • Remove track(s) from...
      .\xxx-scripts\find_remove_from_playlists.js
    • Send selection to playlist... (for macros)
    • Select (for macros)
      • By halves
      • By thirds
      • By quarters
      • First / Last track
      • Random track / Random # tracks
      • Delete selected / non selected tracks
  • Other tools:
    • Check tags: checks selection to find errors on tags (useful on entire library).
      .\xxx-scripts\check_library_tags.js
    • Write tags: "macro" to write some tags.
      .\xxx-scripts\tags_automation.js
    • Playlist Revive: replaces and expands playlist revive component.
      .\xxx-scripts\playlist_revive.js
    • Playlist History: history of previously active playlists (for macros).
      .\xxx-scripts\helpers\playlist_history.js
    • Include scripts: add multiple SMP scripts into the same panel.
  • Pools: use playlist(s), (dynamic) queries, etc. as source pool(s) for a destination playlist. 1
  • Macros: record and save menus entries used, as a macro, to be called later.
    .\xxx-scripts\helpers\playlist_tools_menu_macros.js
  • Other scripts integration:
    • Playlist-Manager-SMP: Pools may use tracks from playlists files tracked by the manager, not requiring to have playlists loaded within foobar. i.e. Random Pools component-like playlist creation, using not only queries as sources, but also other playlists or playlists files.
    • ajquery-xxx: Online controller fully compatible which allow to use most of the available tools within the web browser.
    • SMP Dynamic menus: tools are also available as main menu entries -if enabled-, which allows to bind them to keyboard shortcuts, toolbar buttons or executing them using command line.

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).

pt_availablemenus

pt_dynamicqueries

Compatible with (toolbar)

  1. Search-by-Distance-SMP: creates intelligent "spotify-like" playlist using high-level data from tracks and computing their similarity using genres/styles.
  2. ListenBrainz-SMP: Integrates Listenbrainz's feedback and recommendations.
  3. Autobackup-SMP: Automatic saving and backup of configuration and other data in foobar2000.
  4. Device-Priority-SMP: Automatic output device selection.
  5. Fingerprint-Tools-SMP: ChromaPrint and FooId fingerprinting tools.
  6. Wrapped-SMP: Outputs a report similar to Spotify's wrapped and personalized playlists.

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.

pt_Toprated

Installation

See _TIPS and INSTALLATION (txt) and the Wiki. Not properly following the installation instructions will result in scripts not working as intended. Please don't report errors before checking this.

Footnotes

  1. Note for sensitive souls: SQL database functionality from Random Pools will not be replicated since I consider it an inferior and user-inaccessible feature -with slower performance- which may be easily replicated by other means. On the other hand, things like duplication removal are totally absent on the original plugin, which may be a reason to switch to this alternative in some libraries. Advanced pools may be created using JSON presets, which allow to create really complex actions with different sources or built-in harmonic mixing. It's not a matter of which implementation is "better"; so if you feel some functionality is missing (not replicable in conjuction with the other tools available), let me know. ;) 2

playlist-tools-smp's People

Contributors

imgbotapp avatar regorxxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

playlist-tools-smp's Issues

Update github page

Update readme and gifs to reflect current state of script: new UI, draggable buttons, color configuration, etc.

Extract Problem

Here's the error I'm getting when extracting the latest version.

image

I've tried running 7-zip in admin mode.
https://superuser.com/questions/1076527/7zip-cannot-create-symbolic-link-access-is-denied-to-libhdfs-so-and-libhadoop-s

Both these files below seem to only contain a single line:

buttons/toolbars/_buttons_toolbar.js
buttons_playlist_tools.js

Install issue was my own fault.
When I extract using PeaZip successfully it doesn't load then in fb.

Here's the path that I'm using (I'm running a portable version)
W:\Apps (Portable)\Music Apps\foobar2000\profile\scripts\SMP\xxx-scripts

[BUG] Custom pool

I've seen two other things with Custom pool:

  • Playlist Tools > Pools > Custom pool... only works the first time. I need to restart foobar to use it again.
  • One track from each playlist is missing from the number of tracks (with the start method).

For example, I ask this:

Playlist A,5;Playlist B,8
Playlist A,ALL;Playlist B,ALL
Playlist A,start;Playlist B,start
Playlist C
%PLAYLIST_INDEX%

The result is 11 tracks in Playlist C. It should be 13.

The console says that:

Playlist Tools Pools: source -> Playlist A
Playlist Tools Pools: pool size -> 4 (29) tracks
Playlist Tools Pools: source -> Playlist B
Playlist Tools Pools: pool size -> 7 (35) tracks
Playlist Tools Pools: sorting (%PLAYLIST_INDEX%)
Playlist Tools Pools: playlist -> Playlist C: 11 tracks

[BUG] Pools

Hi,

I'm trying Playlist-Tools (today's version) and I'm finding errors:

  • Playlist Tools > Pools > Custom pool...
Error: Spider Monkey Panel v1.6.1-mod ({FCB3B1F8-4C12-45C8-BEEB-8FB920E8879B}: Playlist Tools: Button v3.5.0 by regorxxx)
inputPool is not defined

File: playlist_tools_menu_pools.js
Line: 241, Column: 22
Stack trace:
  func@playlist_tools_menu_pools.js:241:22
  _menu/this.btn_up/<@menu_xxx.js:439:15
  _menu/this.btn_up@menu_xxx.js:429:24
  ["Playlist Tools"]<@buttons_playlist_tools.js:59:9
  themedButton/this.onClick@buttons_xxx.js:510:21
  @buttons_xxx.js:838:21
  fireEvents/</<@callbacks_xxx.js:149:37
  fireEvents/<@callbacks_xxx.js:145:30

Screenshot

1

  • Playlist Tools > Pools > Classic Pools (50 artists current genre)
Error: Spider Monkey Panel v1.6.1-mod ({FCB3B1F8-4C12-45C8-BEEB-8FB920E8879B}: Playlist Tools: Button v3.5.0 by regorxxx)
pool.deDuplicate is undefined

File: pools.js
Line: 163, Column: 22
Stack trace:
  _pools/[email protected]:163:22
  async*func@playlist_tools_menu_pools.js:231:12
  _menu/this.btn_up/<@menu_xxx.js:439:15
  _menu/this.btn_up@menu_xxx.js:429:24
  ["Playlist Tools"]<@buttons_playlist_tools.js:59:9
  themedButton/this.onClick@buttons_xxx.js:510:21
  @buttons_xxx.js:838:21
  fireEvents/</<@callbacks_xxx.js:149:37
  fireEvents/<@callbacks_xxx.js:145:30
Screenshot

2

Path does not point to a valid file: helpers\buttons_xxx.js

With the latest beta, I've unzipped the contents of the zip file to:
W:\Apps (Portable)\Music Apps\foobar2000\profile\scripts\SMP\xxx-scripts

I get this error when I load the buttons_toolbar.js

Error: Spider Monkey Panel v1.6.1 (Playlist Tools Menu)
include failed:
Path does not point to a valid file: helpers\buttons_xxx.js

File: <main>
Line: 40, Column: 3
Stack trace:
  @:40:3

I'm using a portable build.

EDIT
If I edit the buttons_toolbar.js file to the direct path it works.

It does have these errors though.

Buttons bar file not found:
W:\Apps (Portable)\Music Apps\foobar2000\profile\js_data\buttons_6iFiq.json
Buttons bar file not found:
W:\Apps (Portable)\Music Apps\foobar2000\profile\js_data\buttons_3rXJZ.json
Buttons bar file not found:
W:\Apps (Portable)\Music Apps\foobar2000\profile\js_data\buttons_iddIw.json

Find in/Remove from/Send To/Go to playlist commands and too many playlists usability

Having to many playlists loaded at the same time may make those menu entries a bit cluttered, and hard to search what you are looking for.

This is the list of points I'm considering:

  • Adding a playlist filter- configurable- to pre-filter those lists (for send selection/playlist to or Go to Playlist). That would greatly reduce the number of results. Rationale: Usually sending tracks or going to a playlist is related to a small set of playlists, and others are left untouched (for tagging purpose, classification, etc).
  • 'Go To favorite playlist' button and/or menu, which only lists a pre-defined set of playlists. If you have 60 playlists but you usuallly need to move between 4 or 5 playlists frequently, those could be pinned to the menu for easy access. (have done something similar with Macro buttons, Pools button and configurable Search by Distance Button)
  • Having a large number of playlists makes the menu slower to load (on click) since Find in.../Remove from... entries need to check all the playlists (and tracks within them). Another pre-filter for those menus would greatly speed up menu creation for extreme setups with hundreds of playlists. ( I would recommend the use of Playlist Manager SMP for those cases though).
  • Around those lines, currently playlists within Playlist Manager are not considered at all for these menus. Maybe I could expand integration and allow to find/remove tracks in playlists files tracked by the manager too. That would allow to have most playlist un-loaded while still allowing to work with them.

If you have any suggestion around that, feel free to write them for next releases.

Convert static menus to dynamic menus

In particular, current SMP main menu integration, which is fully configurable, should be rewritten to use Dynamic menus.

Bonus: menus can now be renamed, so when used on standard foobar buttons, the tool-tip will show the action description.

Property value is wrong

Describe the bug
Done a fresh install of SMP and get this error. Using Foobar v2.1 preview build.

Property value is wrong. Using default value as fallback:
'Duplicates RegExp title matching?'

Wrong value: true

Replaced with: %RATING%|$ifgreater($strstr($lower(%GENRE%', '%STYLE%', '%FOLKSONOMY%),live),0,0,1)|$ifgreater($if2($strstr($lower(%GENRE%', '%STYLE%', '%FOLKSONOMY%),instrumental),$strstr($lower(%LANGUAGE%),zxx)),0,0,1)

Value obey this condition: function isStringWeak(str){
	return (typeof str === 'string') ? true : false;
}

To Reproduce
Steps to reproduce the behavior:

  1. Done a fresh install
  2. Removed the old toolbar for good measure and loaded the .js file in the root folder xxx-scripts

Desktop (please complete the following information):

  • OS: Wind 10 Build 19045

Additional context
Add any other context about the problem here.

"Similar Tracks" button creates invalid queries

The Similar Tracks button does not work for me - here's the output from a random The Weeknd track:

Query not valid. Check query:
(($ascii(%genre%) IS R&B OR $ascii(%genre%) IS Pop OR $ascii(%genre%) IS Electronic) OR ($ascii(%style%) IS Synthpop OR $ascii(%style%) IS Alternative R&B) OR ("$year(%date%)" GREATER 2005 AND "$year(%date%)" LESS 2035)) 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 AND TITLE PRESENT AND ARTIST PRESENT AND DATE PRESENT)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.