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: Charts & Stats (using Statistics framework) (Read 894 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Charts & Stats (using Statistics framework)

Based on this thread: (all images below can be clicked on to expand them)
https://hydrogenaud.io/index.php/topic,127666.0.html

And applying this already existing framework to create your own charts on foobar:
https://regorxxx.github.io/foobar2000-Framework-SMP.github.io/scripts/statistics-framework-smp/

As shown on this user-ready package:
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/timeline-smp/


I have decide to tweak the timeline package to offer multiple charts within a same panel thus being similar to the original thread script by mjm716. Pretty much WIP (the integration of multiple charts + layout, all other functionality is already found at timeline package). Since I had already done the back-end and most of the work, it's just mixing the pieces. Obviously the following gifs don't aim to look good or choose a pretty palette of colors , just showcasing most functionality.

Spoiler (click to show/hide)



Spoiler (click to show/hide)





The reasons to offer an alternative to that script are:
- Avoid AI usage whenever possible, which has social, environmental and many other types of implications.
- Use an already existing and proven framework for statistics.
- Offer real listen stats contrary to fake stats based on last played/first played (that was fixed on last release). Needs foo_enhanced_playcount or foo_playcount_2003. (only one of them)
- Offer ListenBrainz listen syncing support.
- Properly de-duplicate listens, not counting multiple times different versions of the same album/tracks (for ex. 2 editions of the same album share the same playcount stats and thus would count as listened 2 times the real amount).
- Also listens de-duplication even if you have multiple components offering playcount stamps or ListenBrainz syncing. It will only count unique listens from all available sources.
- Handle multi-value artists.
- Handle tags with special chars (current script supposes no tag will contain '|||' which is obviously prone to be broken, as an easy search at Spotify can prove).
- Totally configurable tags (i.e. not hardcoded to artists/album artists).
- Async processing, not blocking entire UI.
- Data refresh may be manually forced or set at specific actions

Further improvements due to using the framework:
- Totally configurable axis' and data with builtin presets or user input (i.e. you may set listens per artists, but also listens per decade, or even rating per artist)
- Listens histogram per day, week, month or year
- Data range may be easily changed using the mouse wheel.
- Data sorting may be changed by any axis,  for ex. to show least played artists instead of more played ones. Or alphabetic display.
- Configurable tracks sources: library, current playlist, playing playlist, playlists by name
- Configurable tracks query filtering. It even allows dynamic queries, i.e. based on actual selection like "ARTIST IS #ARTIST#" where #ARTIST# is internally replaced everytime a new track is selected (so you can create dynamic charts for the selected artist for ex).
- Fully configurable UI for charts: different chart types, sorting, colors, labels, etc. the same than the timeline script.
- Fully configurable background by colors, art, artist images, etc.
- Everything is configured via menus. No need to touch the script or know how to code.



I'm updating the framework and timeline github repositories with latest changes, so anyone could try something similar using multiple panels. To get stats by time range, choose Listens (range) at Y-axis and whatever you want at X-Axis. Note in this mode, there are additional options at X-axis (by day, week, etc.), hidden otherwise. An example of a stats panel using foo_flowin and multiple timeline packages:


And I will upload a WIP report package as shown in the gifs in 1 or 2 days as soon as I find time to add the list at bottom and polish a few things.

Opening this thread now to not clutter the other one and listen to UI ideas or reasonable requests about what should be included. Right now I'm "cloning" the original UI, but that may not necessarily true in a few days... so open to ideas.

Re: Charts & Stats (using Statistics framework)

Reply #1
Looking very impressive !!

Re: Charts & Stats (using Statistics framework)

Reply #2
Ok, so this is how it looks for now:


Needs foo_enhanced_playcount or foo_playcount_2003. (only one of them)

Currently set to display 2025 stats. Some global stats still missing.  JSplitter / SMP package.

Note listening history is only available since those components were first installed; but the charts may be tweaked, anyone missing such data could change the charts to display raw playcounts, rating or whatever available.

To switch time ranges, not only the 'Time range' setting must be changed but also the 'Data filtering' query; the latter it's set to only use tracks played at 2025 by default. While it's not strictly needed to use a query filter, it speeds up calcs, since it directly discards a big portion of your library.

Note some settings affect the entire panel (like the data source or filters, background, etc.), while others affect only the focused chart. It should be intuitive enough.

It's a bit raw, but should work fine. Stats should be 100% accurate (since they work on my other packages), other parts not sure ::) I reused everything from Timeline-SMP and disabled some menu entries related to 3-d graphs, if you spot something which seems to be "useless" let me know. Maybe I missed something.

Right now there is no scrollbar support, so adjust size to your liking. Also data calculations will be improved, since it's currently async but done in parallel, which is not desirable for UI responsiveness. More will come later, since this was just joining the puzzle and did not really add a lot of new code.

Re: Charts & Stats (using Statistics framework)

Reply #3
Uh oh ...

X

Re: Charts & Stats (using Statistics framework)

Reply #4
If I remember right, that happened months/years ago when people used an outdated foo_enhanced_playcount version. I added a workaround, but since the plugin has been updated and it's their fault, I removed it and now it will crash.

Check if that's the case. In any case that points to a failure of that component, which outputs garbage instead of proper data. Also report what %PLAYED_TIMES_JS% outputs for never played tracks.

Re: Charts & Stats (using Statistics framework)

Reply #5
I have been using foo_playcount_2003 for quite some time now. Prior to that I did use foo_enhanced_playcount, and no longer installed in my foobar.

Does this mean that my database has the "garbage data" from the past, therefore I cannot use this script?

Is there any workaround? Will installing the "good" foo_enhanced_playcount now help in any way?


Code: [Select]
Core (2025-03-07 12:27:52 UTC)
    foobar2000 core 2.24.3
foo_beefweb (2025-02-27 20:58:44 UTC)
    Beefweb Remote Control 0.10
foo_converter (2025-03-07 12:28:24 UTC)
    Converter 2.24.3
foo_dsd_processor (2025-03-25 07:22:35 UTC)
    DSD Processor 1.3.4
foo_dsp_amp (2025-03-29 11:22:10 UTC)
    Amplify 1.0.5
foo_dsp_convolver (2024-02-12 10:22:24 UTC)
    Convolver (gapless) 0.4.8
foo_dsp_eq (2025-03-07 12:28:28 UTC)
    Equalizer 1.2.3
foo_dsp_mdadither (2023-03-16 06:06:42 UTC)
    mda Dither 0.3
foo_dsp_replaygain (2025-03-27 05:22:04 UTC)
    ReplayGain DSP 0.2.19
foo_dsp_resampler (2024-05-02 11:28:50 UTC)
    SoX Resampler 0.8.7.+
foo_dsp_std (2025-03-07 12:28:30 UTC)
    Standard DSP Array 2.24.3
foo_dsp_vst3 (2024-04-09 05:38:38 UTC)
    VST 2.x/3.x Adapter 0.12
foo_enhanced_spectrum_analyzer (2023-05-06 10:54:08 UTC)
    Enhanced Spectrum analyzer 1.9.2.0
foo_fileops (2025-03-07 12:28:34 UTC)
    File Operations 2.24.3
foo_flowin (2024-11-24 16:25:16 UTC)
    Flowin 0.2.2
foo_freedb2 (2025-03-07 12:28:38 UTC)
    Online Tagger 0.10
foo_headphone_eq (2024-04-17 02:58:10 UTC)
    MathAudio Headphone EQ 1.5.2
foo_input_sacd (2025-03-25 07:17:43 UTC)
    Super Audio CD Decoder 1.6.3
foo_input_std (2025-03-07 12:28:18 UTC)
    CD Audio Decoder 2.24.3
    FFmpeg Decoders 6.0
    FLAC Decoder 1.5.0
    Monkey's Audio Decoder 10.93
    Opus Decoder 1.5.2
    Standard Input Array 2.24.3
    WavPack Decoder 5.8.1
foo_loudness_peakmeter (2023-05-19 13:52:34 UTC)
    Loudness Peakmeter 1.0.0.0
foo_nds (2023-03-16 06:06:30 UTC)
    No Display Standby 1.1.4
foo_osd (2023-08-06 00:53:12 UTC)
    On-Screen Display 1.74.2
foo_out_asio (2024-12-27 09:28:34 UTC)
    ASIO Output 2.2.4
foo_outinfo (2025-02-09 11:00:02 UTC)
    Output Info 1.2.7
foo_playcount (2023-03-14 06:04:18 UTC)
    Playback Statistics 3.1.5
foo_playcount_2003 (2024-11-27 09:49:20 UTC)
    Playcount 2003 0.3.0
foo_quicksearch (2024-06-17 04:09:24 UTC)
    Quick Search Toolbar 3.9
foo_record (2024-12-18 10:51:28 UTC)
    Recorder 0.2.6
foo_run_main (2024-11-27 09:47:00 UTC)
    Run Main 1.1.0
foo_scheduler_mod (2023-10-23 14:08:56 UTC)
    Scheduler mod 4.21
foo_skipcount (2024-04-13 07:06:14 UTC)
    Skip count 2.0.5
foo_truepeak (2025-01-02 09:42:04 UTC)
    True Peak Scanner 0.6.15 preview 2025-01-02
foo_ui_std (2025-03-07 12:28:04 UTC)
    Album List 2.24.3
    Decoding Speed Test 2.24.3
    Default User Interface 2.24.3
    File Integrity Verifier 2.24.3
foo_uie_albumlist (2025-02-19 14:15:20 UTC)
    Album list panel 2.0.4
foo_uie_jsplitter (2025-02-16 03:23:12 UTC)
    JSplitter 3.6.1.14
foo_uie_webview (2024-12-15 03:26:22 UTC)
    WebView 0.2.1.0
foo_vis_spectrum_analyzer (2024-08-18 09:01:30 UTC)
    Spectrum Analyzer 0.8.0.0-beta2
foo_vis_vumeter (2025-03-08 11:16:54 UTC)
    VU Meter Visualisation 0.10.2.0
foo_wave_minibar_mod (2024-01-16 05:24:36 UTC)
    Waveform Minibar (mod) 1.2.58

Re: Charts & Stats (using Statistics framework)

Reply #6
Ok, got it. In the published package I somehow made foo_enhanced_playcount a forced requisite instead of optional if foo_playcount_2003 was installed, so output was obviously garbage in such case.

Fixed now. Have not tested it with only foo_playcount_2003, but let me know if it fails again. For people using foo_enhanced_playcount, nothing changes on this update.

Re: Charts & Stats (using Statistics framework)

Reply #7
Thank you! It loads now ...


Re: Charts & Stats (using Statistics framework)

Reply #8
Don't forget to adjust background transparency / color until texts have enough contrast. I have to tweak that in the future.

Re: Charts & Stats (using Statistics framework)

Reply #9
Ok, got it. In the published package I somehow made foo_enhanced_playcount a forced requisite instead of optional if foo_playcount_2003 was installed, so output was obviously garbage in such case.

Fixed now. Have not tested it with only foo_playcount_2003, but let me know if it fails again. For people using foo_enhanced_playcount, nothing changes on this update.
Just confirming that this means there was never any actual malformed JSON output from foo_enhanced_playcount?

Re: Charts & Stats (using Statistics framework)

Reply #10
Ok, got it. In the published package I somehow made foo_enhanced_playcount a forced requisite instead of optional if foo_playcount_2003 was installed, so output was obviously garbage in such case.

Fixed now. Have not tested it with only foo_playcount_2003, but let me know if it fails again. For people using foo_enhanced_playcount, nothing changes on this update.
Just confirming that this means there was never any actual malformed JSON output from foo_enhanced_playcount?
Not in this case. I supposed the user was using your component, which was not the case. False alarm.

There was a problem some time ago, now I have doubts if it was your components, the 'skip' timestamps component or marc's one. But it was fixed some time ago anyway, so we can ignore it.

Re: Charts & Stats (using Statistics framework)

Reply #11
There was a problem some time ago, now I have doubts if it was your components, the 'skip' timestamps component or marc's one. But it was fixed some time ago anyway, so we can ignore it.
Cool, cool. I hadn't heard anything about corrupted timestamps so just wanted to make sure there wasn't something I'd missed.

I don't record skipped songs (assuming they're skipped before 1 minute of playback) so I guess it was probably something else.