getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: zkhcohen on July 15, 2018, 09:13:11 PM

Title: (Version 1.7.4) Spectrogram Panel Plugin
Post by: zkhcohen on July 15, 2018, 09:13:11 PM
Spectrogram-Display


---     ---     ---     ---     ---     ---     ---     ---

(https://i.imgur.com/VJFdj0K.png)


NOTE: I supplied the 64 bit version of FFMPEG in the Dependencies folder. This will not work on some Operating Systems. Download a 32-bit build here:  https://ffmpeg.zeranoe.com/builds/





(UPDATED) Latest Release (Requires MusicBee 3.3.7001 or NEWER): Click Here. (http://www.mediafire.com/file/6pknhwmxt6kdw5k/MusicBee_Spectrogram_1.6.zip/file)

For users on MusicBee version 3.3.6996 or OLDER: Click Here. (https://www.mediafire.com/file/7o0vuy4p8023la3/MusicBee_Spectrogram_1.5_-_LEGACY.zip/file)


Changelog:

Update 1: Fixed scaling issues.
Update 2: Added height-resizing.
Update 3: Added support for mobile installations / updated installation instructions.
Update 3.1: New instructions / troubleshooting tool to fix spectrogram when it fails to appear (incorrect ffmpeg.exe path).
Update 4: Fixed percent and quotation symbols causing incorrect filenames. Added support for songs with identical filenames.
Update 5: Added a configuration panel which allows you to take advantage of all the ffmpeg 'showspectrumpic' switches. Added the ability to clear files on each restart of the add-in. Updated installation instructions due to (new) built-in debugging.
Update 5.1: Updated names of programs, structure of files, fixed support for mobile installations, debugging message, Readme and other back-end improvements.
Update 5.2: Added ability to set your own path to Ffmpeg. Removed unnecessary files. Many back-end improvements.
Update 5.3: Additional improvements including debugging and previously-set Ffmpeg path populating Config. Panel automatically.
Update 5.4: Streams no longer cause Ffmpeg to hang. Ability to prevent the header (title bar) from being shown by manually creating a text file called "noheader.txt" in the Dependencies folder (USE AT YOUR OWN RISK).
Update 5.5: Configuration panel now integrated with MusicBee. Debug logging to "MBSpectrogramLog.txt" in Dependencies folder (cleared on restart). Other general improvements.
Update 5.6: Attempt to fix stream image generation. Code optimizations.
Update 5.7: Fixed stream image generated bug. Fixed track seeking when frequency legend is enabled.
Update 5.8: Debugging Mode made optional. Fixed MusicBee error log spam. Code optimizations. Updated README.
Update 5.9: Fixed identical tracks with different file-types preventing unique image from being generated. Added ability to set Placeholder image for streams (place "placeholder.png" in the Dependencies folder). Switched to Zerandoe FFMPEG build so that the Magma color scheme works.
Update 6: Spectrogram now always shows the full frequency spectrum of the track, regardless of the size of the panel. This works by finding the closest resolution (multiple of 2) and then stretching the image to fit the panel. This also means that substantially fewer images will be generated, and accidental/minor resizes won't trigger new image generation (it will use the best-fit).
Update 6.1: You can now access the Spectrogram Configuration Panel by right-clicking the panel. Bug fixes. More efficient image generation / resolution matching.
Update 6.2: Fixed prompt. Changed defaults to the popular configuration. Removed right-click configuration menu -> moved to the header drop-down menu.
Update 7: Added two experimental features to the Configuration Panel - Enable Seekbar and Disable Header.  Added ability to pause/play by right-clicking the Spectrogram.
Update 7.1: Added dynamic indicator (tooltip) of time in song. Fixed version.
Update 7.2: Attempt at fixing multi-threading crash and tooltip issues. Changed cursor.
Update 7.3: Fixed an issue which caused a System.OverflowException when listening to radio streams for extended periods with the seekbar enabled.
(BETA) Update 7.4: Re-fixed the issue using a Bind.


Planned Updates and Fixes (in no particular order):

None, currently.



Description:

This plugin displays the spectrogram for the currently playing song. It also works as a seekbar,
allowing you to select the location in the track by clicking on it.

The program works by sending a command to ffmpeg (a free-ware program located in the
Tooltips folder) which generates a spectrogram. Afterwards, the .png image
it generated is displayed by the plugin.

After the image has been generated once, it will be used for any future plays, meaning
that it will load almost instantly, with no CPU usage.

The Plugin:
(https://i.imgur.com/wgmhQxc.png)



Installation Instructions:

1. With MusicBee off, extract the file located in the "Plugins" folder to your MusicBee Plugins directory.
2. Start MusicBee.
3. A message will appear telling you where to place the plugin's "Dependencies" folder;  extract the whole folder there now.
4. In MusicBee navigate to Edit > Edit Preferences > Plugins. Ensure that "spectrogram-display" appears. Enable it, and hit Save.
5. Navigate to View > Arrange Panels...
6. Drag the "spectrogram-display" element from the "available elements" window to the "main panel" section to your desired position, for instance above the "now playing bar" element. Note: This is not the required location of the plugin, but it is HIGHLY RECOMMENDED that you position it here.  Hit Save.
7. Drag the top of the Spectrogram window where you have placed it to the desired height.
8. Try playing a song. After a second or two of processing, the spectrogram should appear.  You can seek through the song if desired within the spectrogram window.
9. See the first post of the plugin's thread on the MusicBee forum for instructions on using the plugin's built-in Configuration Panel and other important information.



Using the Configuration Panel:

1. To open the configuration panel, go to Edit > Edit Preferences > Plugins, then locate "Spectrogram-Display" and click "Configure" or click on the header drop-down:

(https://i.imgur.com/JGPJn6a.png)

2. The settings are rather intuitive, but for further information on what they do, please go to the following link:

 https://ffmpeg.org/ffmpeg-filters.html#showspectrumpic


NOTE: Adding a .png file called "placeholder.png" in the Dependencies folder will allow the plugin to display an image of your choice while streams are being played.


The Configuration Panel:
(https://i.imgur.com/sFg1UY6.png)



Example Configuration:
(https://i.imgur.com/ue1anvb.png)
Title: Re: Spectrogram Panel Plugin
Post by: Steven on July 15, 2018, 10:11:28 PM
MusicBee 3.2 is prone to crashes when enabling new plugins. Expect for it to crash up to 3 times before it becomes permanently stable.
Can you expand on that and provide me with more info? I am not aware of a general issue with plugins crashing. It might be better to reply on the developers section
Title: Re: Spectrogram Panel Plugin
Post by: boroda on August 16, 2018, 04:15:12 PM
Quote
. Extract the files located in the "Plugins" folder to your MusicBee Plugins directory:

 C:\Users\YOUR_USERNAME\AppData\Roaming\MusicBee\Plugins

 Note: If you aren't using this directory, you'll have to change the "folderPath"
 variable in the source files to the appropriate destination, and then rebuild it.
so your plugin wont work with portable mb at all? you could store any settings under path returned by MB_GetPersistentStoragePath() API function.
Title: Re: Spectrogram Panel Plugin
Post by: zkhcohen on August 16, 2018, 04:31:29 PM
Quote
. Extract the files located in the "Plugins" folder to your MusicBee Plugins directory:

 C:\Users\YOUR_USERNAME\AppData\Roaming\MusicBee\Plugins

 Note: If you aren't using this directory, you'll have to change the "folderPath"
 variable in the source files to the appropriate destination, and then rebuild it.
so your plugin wont work with portable mb at all? you could store any settings under path returned by MB_GetPersistentStoragePath() API function.

Interesting - I didn't realize that was an issue. If I have some free time this afternoon, I'll push out an update following your advice.

Thanks!
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on August 17, 2018, 12:57:29 AM
Latest update is live. Let me know if you have any issues.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: boroda on August 17, 2018, 10:45:31 AM
hmm... not sure whats the matter, but spectrogram panel displays nothing for me (portable mb if its important). i suspect that you use predefined path for Tooltips folder (i.e. C:\Program Files (x86)\MusicBee\).
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on August 17, 2018, 03:07:27 PM
hmm... not sure whats the matter, but spectrogram panel displays nothing for me (portable mb if its important). i suspect that you use predefined path for Tooltips folder (i.e. C:\Program Files (x86)\MusicBee\).

Hm... I'll look into this. I decided to use GetCurrentDirectory for the ffmpeg path, which appears as Tooltips for me. I'm not sure if this is standard for all MusicBee instances.

Frankly, I have no idea why Tooltips would be the working directory for plugins as standard.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on August 17, 2018, 08:46:07 PM
Updated.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: rudolph on October 26, 2018, 10:16:03 PM
Useful, but it will still not replace spek that I'm using to check if song is fake mp3 or anything like that because it doesn't show numbers on any of the sides of the spectrum, so i can't guess where it goes above 16 kHz and 20khz.

Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on October 26, 2018, 10:30:06 PM
Ah yeah, I disabled that. You can have the ffmpeg output contain the numbers as an overlay on the image.

I'm planning on updating this soon, anyway, so I'll give it a shot.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: mrbenn on November 11, 2018, 01:46:38 AM
Hi.

I think I found a bug - if a track has the same Artist and Title, the plugin shows the same output for both files.

My test was "Chic - Good Times", (which is a common dupe in my library as I have a *lot* of disco.)

Over several different versions, lengths and bitrates, the files tagged "Chic - Good Times" all gave an identical image (which I think is the one from the first track with those tags that is played), but the one marked "Chic - Good Times (Original 12" Mix)" had a unique image.

My guess is that these two tags are used to tag the image in the cache for the next time its played?

Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on November 11, 2018, 02:02:34 AM
Hi.

I think I found a bug - if a track has the same Artist and Title, the plugin shows the same output for both files.

My test was "Chic - Good Times", (which is a common dupe in my library as I have a *lot* of disco.)

Over several different versions, lengths and bitrates, the files tagged "Chic - Good Times" all gave an identical image (which I think is the one from the first track with those tags that is played), but the one marked "Chic - Good Times (Original 12" Mix)" had a unique image.

My guess is that these two tags are used to tag the image in the cache for the next time its played?



Oh, yeah. I should probably fix that.

I'll work on it asap.

I also created a version with the frequencies shown, but it's really only practical if you put it on another tab of its own.

I'll release both.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on November 16, 2018, 10:38:11 PM
Hi.

I think I found a bug - if a track has the same Artist and Title, the plugin shows the same output for both files.

My test was "Chic - Good Times", (which is a common dupe in my library as I have a *lot* of disco.)

Over several different versions, lengths and bitrates, the files tagged "Chic - Good Times" all gave an identical image (which I think is the one from the first track with those tags that is played), but the one marked "Chic - Good Times (Original 12" Mix)" had a unique image.

My guess is that these two tags are used to tag the image in the cache for the next time its played?





Here's a fixed version:

http://www.mediafire.com/file/eamoioe1483muj0/MusicBee_Spectrogram_Plugin.zip/file


Let me know if you have any issues.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on November 16, 2018, 10:52:50 PM
Useful, but it will still not replace spek that I'm using to check if song is fake mp3 or anything like that because it doesn't show numbers on any of the sides of the spectrum, so i can't guess where it goes above 16 kHz and 20khz.



Here's a version with the legend enabled. Personally I don't like the look of it. I'm hoping I can modify the source files of ffmpeg to use a much smaller legend:


http://www.mediafire.com/file/cm4ie9b7s5jj7mv/mb_Spectrogram-Display.dll/file
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: phred on November 17, 2018, 03:30:01 AM
IMPORTANT NOTE: MusicBee 3.2 is prone to crashes when enabling new plugins. Expect for it
 to crash up to 3 times before it becomes permanently stable. If you continue
 to have issues, try reinstalling the plugin, or reconfiguring the panels.
I suggest that you change this text since MB is -not- prone to crashes. It may be the -plugin- that causes MB to crash. Especially since you told Steven (in the developers sub-forum) that the issue was fixed.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on November 17, 2018, 03:59:45 AM
IMPORTANT NOTE: MusicBee 3.2 is prone to crashes when enabling new plugins. Expect for it
 to crash up to 3 times before it becomes permanently stable. If you continue
 to have issues, try reinstalling the plugin, or reconfiguring the panels.
I suggest that you change this text since MB is -not- prone to crashes. It may be the -plugin- that causes MB to crash. Especially since you told Steven (in the developers sub-forum) that the issue was fixed.

Good point. Doing that now.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: boroda on January 12, 2019, 11:13:40 AM
@zkhcohen, could you somehow colorize spectrogram? grayscale coloring is not very funny :)
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: eeik on January 15, 2019, 10:32:55 AM
@zkhcohen, when you revise this plug-in next, might you also be able to enable the hide/display header menu option of the pane within the layout so that the header title word "Spectrogram" can be omitted tightening up the view of the pane with the pane above it?

Thank you for your plug-in contribution!
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: Kolya on February 11, 2019, 11:19:22 PM
Frequency scales would be nice. And yeah, color. Basically I was hoping for something like this: https://academo.org/demos/spectrum-analyzer/
Thank you for your work.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 14, 2019, 05:28:18 PM
@zkhcohen, when you revise this plug-in next, might you also be able to enable the hide/display header menu option of the pane within the layout so that the header title word "Spectrogram" can be omitted tightening up the view of the pane with the pane above it?

Thank you for your plug-in contribution!

Frequency scales would be nice. And yeah, color. Basically I was hoping for something like this: https://academo.org/demos/spectrum-analyzer/
Thank you for your work.

@zkhcohen, could you somehow colorize spectrogram? grayscale coloring is not very funny :)

Well... I missed all of these. I do have a version with the frequency scale enabled - I'll try to dig it up. The primary issue is that the scale doesn't adjust based on the size of the spectrogram. This is a limitation of FFMPEG.

In terms of the colors, I could try integrating on-the-fly color switching at some point... but for now, you can choose a color from the link below and I can compile it:

https://ffmpeg.org/ffmpeg-filters.html#showspectrum-1

I can also look into removing the header, but I'm not sure if Steven has allowed that in the embedded-plugin section of the API.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: Kolya on February 14, 2019, 05:54:12 PM
It's hard to say since the linked document only specifies color schemes, without showing what they look like. But I think you can never go wrong with 'plasma'.

EDIT: I noticed that the plugin saves the generated PNGs for every song played, to speed up display time. That's nice, but could you make it optional?
I have >40 000 files. I don't want to save a PNG for each one. On the fly generation will be enough in most cases.

EDIT2: I'm interested in the frequency scales, because I don't want to use the plugin as eye candy. I want to check actual audio quality as described here: http://www.walterdevos.be/how-to-check-quality-of-mp3-file
So if the frequency scales don't scale with the display, maybe there is a way to lock the display size?
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 16, 2019, 02:38:34 AM
EDIT: I noticed that the plugin saves the generated PNGs for every song played, to speed up display time. That's nice, but could you make it optional?
I have >40 000 files. I don't want to save a PNG for each one. On the fly generation will be enough in most cases.

A huge +1 on that
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 21, 2019, 08:39:58 PM
It's hard to say since the linked document only specifies color schemes, without showing what they look like. But I think you can never go wrong with 'plasma'.

EDIT: I noticed that the plugin saves the generated PNGs for every song played, to speed up display time. That's nice, but could you make it optional?
I have >40 000 files. I don't want to save a PNG for each one. On the fly generation will be enough in most cases.

EDIT2: I'm interested in the frequency scales, because I don't want to use the plugin as eye candy. I want to check actual audio quality as described here: http://www.walterdevos.be/how-to-check-quality-of-mp3-file
So if the frequency scales don't scale with the display, maybe there is a way to lock the display size?

Yeah, I can definitely implement both. I might just compile a couple of versions of these for everyone...

That being said, I've been extremely busy IRL recently, so I haven't had any time to work on this. I'll try to do it this weekend, but I can't make any promises.

All of the source files are included in the download, so it is technically open-source. If you know basic C#, feel free to make any modifications and releases you'd like.

Actually, I'll open this up on my lunch hour in a couple of minutes and provide some instructions on how to compile your own versions.

Edit: I'm going to figure out how to make a configure menu through the API and just implement it through there.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 23, 2019, 05:13:18 AM
Last call on anything you're dying to have in this interface:


(https://i.imgur.com/QuofqnM.png)
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 23, 2019, 05:59:15 AM
Man, this is GREAT.  Almost too good to be true, haha..  Wonderful options, can't see it's missing a thing, would love to see what you've got in the drop-down boxes :)
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 24, 2019, 04:27:41 PM
Man, this is GREAT.  Almost too good to be true, haha..  Wonderful options, can't see it's missing a thing, would love to see what you've got in the drop-down boxes :)


Here's the beta release of 1.5:

CHECK FIRST PAGE FOR LINK


Excuse my crap programming skills. A friend of mine is going to help me clean it up later. That being said, I've tested every feature on a couple of machines and everything is working! It's a miracle.


EDIT: The instructions and download link on the first page of this thread are updated. Please read through them. The link on the official plugin page has not been updated yet.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 24, 2019, 06:55:31 PM
Would it be possible to include an option to point to an already existing installation of ffmpeg.exe instead of needing to use the one in the install package?
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 24, 2019, 08:10:53 PM
Would it be possible to include an option to point to an already existing installation of ffmpeg.exe instead of needing to use the one in the install package?

Technically, yes, but there are two issues:

1) Rewriting a portion of the code / interface to check for previous installations and point to them.
2) Ffmpeg is open-source, so there are many different builds floating around. Some builds may not contain some or all of the switches for showspectrumpic. I would have to create debugging for that as well.

I've tried to directly modify and rebuild the Ffmpeg source a couple of times, but haven't had the best results.

In the future, I'll either implement your suggestion or create my own stripped-down build of Ffmpeg for this plugin.

When I do my edits later today/this week, I'll probably take care of this.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 24, 2019, 08:42:53 PM
Thanks for your reply and for looking into this.  I was thinking of just a settings box where the user could fill in the path to the external ffmpeg.exe themselves, as opposed to expecting your code to do its own checking for it which I understand is a PITA;  since the one I use (the latest "release" Zeranoe build) is on a "portable" path an auto-check probably wouldn't find it anyway.  You could stipulate that the user would be "on their own" with that option as far as compatibility with the plugin.

Thanks again for all your work and continued improvements to this plugin!
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 24, 2019, 10:14:52 PM
Updated names of programs, structure of files, fixed support for mobile installations, debugging message, readme and other back-end improvements:


SEE FIRST PAGE.


Note that the Configuration Menu's name has changed and will now be located wherever the config.xml and ffmpeg.exe files reside.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 25, 2019, 12:49:56 AM
The link in your latest post is producing the following message from MediaFire:

"The key you provided for file access was invalid. This is usually caused because the file is no longer stored on MediaFire. This occurs when the file is removed by the originating user or MediaFire."
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 25, 2019, 02:23:28 AM
The link in your latest post is producing the following message from MediaFire:

"The key you provided for file access was invalid. This is usually caused because the file is no longer stored on MediaFire. This occurs when the file is removed by the originating user or MediaFire."

Give it another shot. The link is working for me, even in incognito mode.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 25, 2019, 02:49:51 AM
OK, here is what is happening--  this link (update: now removed) is still producing the page indicating the file is not available, but with a big "Download" button below the message that is linked to some non-mediafire url that takes you to a page with it's own download button that wants to install an extension--no way man.   The link on your FIRST post, which is http://www.mediafire.com/file/2633b0bywddf2pm/MusicBee_Spectrogram_1.5.zip/file (http://www.mediafire.com/file/2633b0bywddf2pm/MusicBee_Spectrogram_1.5.zip/file) (different than the other one), does lead to a normal Mediafire download page and result in a download.  So, is the plugin linked on that first post also the one with the newest changes?  If so you should probably delete the "wonky" link in case somebody ends up with an uninvited guest.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 25, 2019, 02:53:50 AM
OK, here is what is happening--  this link http://www.mediafire.com/file/5q1nciar25f6q2s/MusicBee_Spectrogram_1.5.zip/file (http://www.mediafire.com/file/5q1nciar25f6q2s/MusicBee_Spectrogram_1.5.zip/file) is still producing the page indicating the file is not available, but with a big "Download" button below the message that is linked to some non-mediafire url that takes you to a page with it's own download button that wants to install an extension--no way man.   The link on your FIRST post, which is http://www.mediafire.com/file/2633b0bywddf2pm/MusicBee_Spectrogram_1.5.zip/file (http://www.mediafire.com/file/2633b0bywddf2pm/MusicBee_Spectrogram_1.5.zip/file) (different than the other one), does lead to a normal Mediafire download page and result in a download.  So, is the plugin linked on that first post also the one with the newest changes?  If so you should probably delete the "wonky" link in case somebody ends up with an uninvited guest.

Yikes! Good catch. I removed that link. I uploaded it for about five minutes until I realized that fixing mobile support required that I modify some stuff. I deleted that file and didn't remove the link from that post.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 25, 2019, 03:57:04 AM
OK zkhcohen thanks,  I took the bum link out of my reply also.  Have grabbed the plugin now from your first post on page one and look forward to giving your new revision some testing tomorrow!
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 25, 2019, 04:21:28 PM
Okay, let me know if you encounter any issues! I'm going to be traveling for business the next couple of days, so I don't know if I'll be able to make many changes.

I'm currently looking for a workaround to having two ClassMgrLibrary files while still preserving the ability to use mobile installations of MusicBee.

I'll also implement the ability to use your own installation of ffmpeg, but I want to do that without creating a secondary config file. Unfortunately my current implementation uses MD5 hashes to differentiate between configs (and cut down on image creation), which means if I create another NON-ffmpeg-specific setting, and a user changes it, it could regenerate every single file...
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 26, 2019, 03:17:12 AM
1.  Extracted the 2-file contents of the Plugins folder (ConfigurationManagerLibrary.dll and mb_Spectrogram-Display.dll) into the MB Plugins directory, and started MusicBee.

2.  Without entering prefs/plugins, immediately receive message to place 3 files--ConfigurationManagerLibrary.dll, ffmpeg.exe and config.xml--into the MusicBee directory.  Note that the readme says to ALSO put ConfigurationMenu.exe there, so did that as well.  Then, went to prefs/plugins and enabled plugin/save.  Restarted MusicBee.

3.  Went to configure layout and dragged spectrogram entry to bottom of Main panel, where it appears just above the bottom panel player controls.

4.  Began to play a song, no spectrogram is displayed.  Opened the settings panel by clicking in upper left corner, opens fine, saved default settings and option to remove png's on restart.  Still no display;  however, clicking inside the empty spectrogram window does seek through the song.

5.  Restarted MB, still no display. I do get a "Spectrogram images deleted" message upon restart, confirming the setting I made in its options.  Just don't get any visible waveform.  Tried disabling/re-enabling plugin, also removing my Classic Spectrum graphic vis from the right sidebar, still no-go. :(
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 03:27:49 AM
1.  Extracted the 2-file contents of the Plugins folder (ConfigurationManagerLibrary.dll and mb_Spectrogram-Display.dll) into the MB Plugins directory, and started MusicBee.

2.  Without entering prefs/plugins, immediately receive message to place 3 files--ConfigurationManagerLibrary.dll, ffmpeg.exe and config.xml--into the MusicBee directory.  Note that the readme says to ALSO put ConfigurationMenu.exe there, so did that as well.  Then, went to prefs/plugins and enabled plugin/save.  Restarted MusicBee.

3.  Went to configure layout and dragged spectrogram entry to bottom of Main panel, where it appears just above the bottom panel player controls.

4.  Began to play a song, no spectrogram is displayed.  Opened the settings panel by clicking in upper left corner, opens fine, saved default settings and option to remove png's on restart.  Still no display;  however, clicking inside the empty spectrogram window does seek through the song.

5.  Restarted MB, still no display. I do get a "Spectrogram images deleted" message upon restart, confirming the setting I made in its options.  Just don't get any visible waveform.  Tried disabling/re-enabling plugin, also removing my Classic Spectrum graphic vis from the right sidebar, still no-go. :(


Refresh this thread then try the new release on the first page. I fixed a bunch of stuff and implemented your idea.

If you continue to have issues with no spectrogram appearing, check the Dependencies folder and ensure that images are being created inside of the "Spectrogram_Images" folder it generates. Let me know if they don't appear there.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 26, 2019, 03:47:23 AM
If you continue to have issues with no spectrogram appearing, check the Dependencies folder and ensure that images are being created inside of the "Spectrogram_Images" folder it generates. Let me know if they don't appear there.

Should I have put the actual Dependencies FOLDER into MB, instead of just the files it contains?  Neither the readme.txt or the pop-up message from the plugin when first starting MB indicated to do that, just to extract the files themselves into the main MusicBee folder.  If so, therein may lie the rub.  I'm rather beat right now so will try again tomorrow, this time with your new release with the fixes.  You mentioned also implementing my user-supplied path to ffmpeg idea, a big thank-you for that!  Will let you know how it goes.  Hopefully we'll get some other testers posting too by then.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 04:01:34 AM
If you continue to have issues with no spectrogram appearing, check the Dependencies folder and ensure that images are being created inside of the "Spectrogram_Images" folder it generates. Let me know if they don't appear there.

Should I have put the actual Dependencies FOLDER into MB, instead of just the files it contains?  Neither the readme.txt or the pop-up message from the plugin when first starting MB indicated to do that, just to extract the files themselves into the main MusicBee folder.  If so, therein may lie the rub.  I'm rather beat right now so will try again tomorrow, this time with your new release with the fixes.  You mentioned also implementing my user-supplied path to ffmpeg idea, a big thank-you for that!  Will let you know how it goes.  Hopefully we'll get some other testers posting too by then.

On the new release you'll copy the folder itself instead of its contents.

I have this working on a couple of machines ATM. Hopefully it's not a fluke.

Edit: Now confirmed on 3 machines, new and old installations and portable.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 08:06:25 PM
@zkhcohen, when you revise this plug-in next, might you also be able to enable the hide/display header menu option of the pane within the layout so that the header title word "Spectrogram" can be omitted tightening up the view of the pane with the pane above it?

Thank you for your plug-in contribution!

Hey, here's a copy of the latest version, but if you put a .txt file named "noheader.txt" into the Dependencies folder, then re-enable the plugin/restart MusicBee, the Header will be gone.

I can't seem to re-size it with the header disabled, so this isn't really working and I won't release it...


http://www.mediafire.com/file/ba31bdb8lns5n99/MusicBee_Spectrogram_1.5_-_modified.zip/file
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 26, 2019, 08:26:38 PM
Same issue--no image is being generated.  Here is the setup:

1.  "Dependencies" folder with all contents (config.xml, ConfigurationMenu.exe, ffmpeg.exe) placed in c:\MusicBee\Appdata as the pop-up instructed (changed I noticed from last ver. which said to place in c:\MusicBee--assume change was deliberate);  the single file "mb_Spectrogram-Display.dll" from the "Plugins" directory in zip package (which formerly contained two files) placed in the MB Plugins folder.

2.  Plugin enabled, settings set to default.  Window inserted via layout button.

3.  Play file.  No image is generated, although seek works.  No image exists in the "Spectogram_Images" subfolder created within c:\musicbee\appdata\dependencies.  Tried inserting a path to an ffmpeg.exe elsewhere than the Dependencies folder, still no-go.

Is there something in your build like a specific Visual-C dependency??  OS here is Windows 7 SP1 32-bit, with VC redists  2008/2010/2013/2015 installed.  For some reason no PNG is being generated.

Am also using the Classical Spectrum graphic vis, but disabling that yesterday made no difference so didn't do that today.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 08:38:47 PM
Same issue--no image is being generated.  Here is the setup:

1.  "Dependencies" folder with all contents (config.xml, ConfigurationMenu.exe, ffmpeg.exe) placed in c:\MusicBee\Appdata as the pop-up instructed (changed I noticed from last ver. which said to place in c:\MusicBee--assume change was deliberate);  the single file "mb_Spectrogram-Display.dll" from the "Plugins" directory in zip package (which formerly contained two files) placed in the MB Plugins folder.

2.  Plugin enabled, settings set to default.  Window inserted via layout button.

3.  Play file.  No image is generated, although seek works.  No image exists in the "Spectogram_Images" subfolder created within c:\musicbee\appdata\dependencies.  Tried inserting a path to an ffmpeg.exe elsewhere than the Dependencies folder, still no-go.

Is there something in your build like a specific Visual-C dependency??  OS here is Windows 7 SP1 32-bit, with VC redists  2008/2010/2013/2015 installed.  For some reason no PNG is being generated.

Am also using the Classical Spectrum graphic vis, but disabling that yesterday made no difference so didn't do that today.

Hmmm... I definitely think your environment could have something to do with it. Do you have .NET 4.6.2 enabled? What build number of MusicBee are you using?

For reference, all of my test machines are running Windows 10 1809.

The extraction location it specifies is automatically generated  by the MB_GetPersistentStoragePath() API function. If images aren't being generated, my guess is that there's an issue with the Ffmpeg command...

I'll look into adding additional debugging features.

Edit: Just for the heck of it, I tried it on another Windows 10 machine and it works here too. Unfortunately I don't have access to a Windows 7 machine to test on, atm.

Edit 2: It was built in Visual Studio Community 2017. You could try installing some of the later C++ redists.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 26, 2019, 09:00:38 PM
Latest NET, latest MB 3.3x update.  I think the "bingo" is the Visual C++ 2017, which I as mentioned I do NOT have;  will install that redist later and let you know if it does the trick, my money is on "yes."
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 09:03:21 PM
Latest NET, latest MB 3.3x update.  I think the "bingo" is the Visual C++ 2017, which I as mentioned I do NOT have;  will install that redist later and let you know if it does the trick, my money is on "yes."

I would guess so as well. I also have the latest .NET and MB updates. I've also tried it on MB 3.2 a couple of times without any issues.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 26, 2019, 10:11:28 PM
Well I give up on this.  Installed the 2017 re-dist and started over with a fresh copy of MB from my back-ups, no change, no PNG will draw.  Could be something as basic as "not compatible with Windows 7", or even my video drivers.  At any rate, maybe somebody else who is using Windows 7 can chime in if it's working for them.  Thanks anyway zkhcohen for the effort you have put into this, much appreciated.  I plan on updating to Windows 10 (and a new PC) anyway this year, so I'll revisit it then.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 10:14:29 PM
Well I give up on this.  Installed the 2017 re-dist and started over with a fresh copy of MB from my back-ups, no change, no PNG will draw.  Could be something as basic as "not compatible with Windows 7", or even my video drivers.  At any rate, maybe somebody else who is using Windows 7 can chime in if it's working for them.  Thanks anyway zkhcohen for the effort you have put into this, much appreciated.  I plan on updating to Windows 10 (and a new PC) anyway this year, so I'll revisit it then.

No problem! I'm sorry that it's not working.

If I get a chance, I'll try to spin up a Windows 7 image in a VM and troubleshoot it myself.

Hopefully other people will test it and report back about compatibility issues.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 26, 2019, 11:22:21 PM
Well, blow me down, as Popeye used to say.  FOUND IT!  Found that you supply a 64-bit version of ffmpeg.exe with the plugin, which of course is not compatible with a 32-bit OS like poor me has.  Yours was the only copy I used in my tests.  Swapped it with my 32-bit version of ffmpeg 4.1.1, and there is the display!

Also tested the external path feature, I used "c:\ffmpeg\ffmpeg.exe" despite the note saying "use /ffmpeg in the path" (forward slash) and works just fine.

Default settings of Saturation=0 will show black & white for any color setting unless set to something other than "0"--which makes sense but maybe worth a note in the readme.

As expected, will display no image if a radio stream is played;  however, this also "hangs" ffmpeg.exe which then must be killed with Task Manager before the plugin can function again with an audio file, even upon MB exit.  Unfortunately, because I go back and forth between stations and files regularly, this sort of kills the usability for me.  Is there a way to tell it to ignore streams (not load ffmpeg)?

Man I love it when a plan comes together though.  The frequency legend is buff, BTW! 8)
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 26, 2019, 11:28:33 PM
Well, blow me down, as Popeye used to say.  FOUND IT!  Found that you supply a 64-bit version of ffmpeg.exe with the plugin, which of course is not compatible with a 32-bit OS like poor me has.  Yours was the only copy I used in my tests.  Swapped it with my 32-bit version of ffmpeg 4.1.1, and there is the display!

Also tested the external path feature, I used "c:\ffmpeg\ffmpeg.exe" despite the note saying "use /ffmpeg in the path" (forward slash) and works just fine.

Default settings of Saturation=0 will show black & white for any color setting unless set to something other than "0"--which makes sense but maybe worth a note in the readme.

As expected, will display no image if a radio stream is played;  however, this also "hangs" ffmpeg.exe which then must be killed with Task Manager before the plugin can function again with an audio file, even upon MB exit.  Unfortunately, because I go back and forth between stations and files regularly, this sort of kills the usability for me.  Is there a way to tell it to ignore streams (not load ffmpeg)?

Man I love it when a plan comes together though.  The frequency legend is buff, BTW! 8)



Oh, crap.... I totally forgot that I supplied the 64bit version. I should fix that lol.

Forward and backslashes are interpreted the same way in this case.

Yep - saturation 0 causes it to be black and white. To be honest, the only reason I set it to that as the default is because I'm a lazy dev who prefers black and white, myself. The rest of the default settings are taken directly off of the Ffmpeg documentation site as their preferred defaults.

It's interesting that radio streams cause it to hang for you. To be honest, I never implemented any sort of check in there because streams don't cause my ffmpeg session to hang (or even execute in the first place). Now that I know it does, I'll take a look into it.

I have another flight tonight so I'll see what I can do.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 27, 2019, 12:20:16 AM
It's interesting that radio streams cause it to hang for you. To be honest, I never implemented any sort of check in there because streams don't cause my ffmpeg session to hang (or even execute in the first place). Now that I know it does, I'll take a look into it.

Here once you switch to a stream, ffmpeg executes and hangs in memory;  while no image is shown in the window, a PNG with the initial track name is indeed generated inside Spectrogram_Images.  Maybe there is some way to have it recognize a url and not execute in that case.  Hey man forget it for today and enjoy that flight :)
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 27, 2019, 04:28:44 PM
It's interesting that radio streams cause it to hang for you. To be honest, I never implemented any sort of check in there because streams don't cause my ffmpeg session to hang (or even execute in the first place). Now that I know it does, I'll take a look into it.

Here once you switch to a stream, ffmpeg executes and hangs in memory;  while no image is shown in the window, a PNG with the initial track name is indeed generated inside Spectrogram_Images.  Maybe there is some way to have it recognize a url and not execute in that case.  Hey man forget it for today and enjoy that flight :)


New update to the link on page 1.

Update 5.4: Streams no longer cause Ffmpeg to hang. Ability to prevent the header (title bar) from being shown by manually creating a text file called "noheader.txt" in the Dependencies folder (USE AT YOUR OWN RISK).
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 27, 2019, 06:20:21 PM
Version 5.4:  streams no longer cause ffmpeg to hang.  Current behavior:

1.  If you start with playing a stream, no image is displayed or saved, continuing that way when switching streams (expected behavior).

2.  If you then play a song, image is displayed/saved (expected) with that song title.

3.  Once you switch back to a stream, no image is displayed, but an image identical to the song previously played is generated "behind the scenes" and saved with the stream's current title.  Continuing to a different stream produces no additional saved images, until you play a song, and switch back to a stream, in which case the behavior repeats.

To sum up, once the spectrogram is "activated" by playing a song, when you switch to streams a non-displayed image will be generated once for the first stream that is a copy of the previously-played song's image, and named/saved with the stream title.

Of course, all images get deleted on MB restart when that option is selected.  Question: is it possible to delete them instead on MusicBee's EXIT?  Also, can the "images have been deleted" message be suppressed?

So, the hanging ffmpeg problem is solved (thanks!).  The anomaly described above can be lived with IMO, but does generate unneeded additional images.  Thanks again for your work.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 27, 2019, 07:10:28 PM
Version 5.4:  streams no longer cause ffmpeg to hang.  Current behavior:

1.  If you start with playing a stream, no image is displayed or saved, continuing that way when switching streams (expected behavior).

2.  If you then play a song, image is displayed/saved (expected) with that song title.

3.  Once you switch back to a stream, no image is displayed, but an image identical to the song previously played is generated "behind the scenes" and saved with the stream's current title.  Continuing to a different stream produces no additional saved images, until you play a song, and switch back to a stream, in which case the behavior repeats.

To sum up, once the spectrogram is "activated" by playing a song, when you switch to streams a non-displayed image will be generated once for the first stream that is a copy of the previously-played song's image, and named/saved with the stream title.

Of course, all images get deleted on MB restart when that option is selected.  Question: is it possible to delete them instead on MusicBee's EXIT?  Also, can the "images have been deleted" message be suppressed?

So, the hanging ffmpeg problem is solved (thanks!).  The anomaly described above can be lived with IMO, but does generate unneeded additional images.  Thanks again for your work.

Great catch. Thanks for all the troubleshooting.

I'll find a fix for this ASAP.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 27, 2019, 08:49:56 PM
Actually, this isn't happening on my system. It might take a little while to trace it back to the source...
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 27, 2019, 09:53:33 PM
By "not happening", I assume you're seeing no PNG is being generated  by a stream just after switching from playing a file?  Just so I can supply some visual evidence that this indeed is happening here, below are two images:

Image #1, generated/displayed/saved by playing a song file just after starting MusicBee:

(https://i.imgur.com/MxaxqEJ.png)


Image#2, generated and saved "incognito" but not displayed after first switching to a radio stream, identical to the song played beforehand:

(https://i.imgur.com/wZ221LC.png)


The duplicate was however NAMED as being from the radio stream (vk.com--), as shown in the image folder contents:

(https://i.imgur.com/opmbNOJ.jpg)

If you're not seeing this, I can only guess it might be due to differences in how your version of ffmpeg is working as opposed to mine.  I am using the Zeranoe static build version 4.1.1, 32-bit.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 27, 2019, 10:34:55 PM
There are so many things that would have to happen for this to happen. Super weird.

Can you also ensure that there isn't another, older version of the add-in .dll located in App Data or something?

Could you run this debugging version and let me know what the pop-up says when it generates the 'incognito' one? I'm assuming that it creates a new Ffmpeg process, and this will enable you to see which commands it's passing to it.

https://www.mediafire.com/file/cgi7tg4ujboz8bt/mb_Spectrogram-Display.dll/file



I also realized that if you have the legend enabled, clicking on the track doesn't seek to the correct location due to the extended borders. I'm going to try to fix that.
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: sveakul on February 27, 2019, 11:56:19 PM
Done;  here's the message generated after switching to a radio stream immediately after playing a song.  It first cites the previous song file's title, then shows an image being saved with the name of the radio stream instead:

(https://i.imgur.com/V0hUCNg.png)

No, there are no copies of the older plugin files around, I start every test of your new releases with a fresh MusicBee Portable backed up before I ever installed it.

SOMETHING funny is going on  :-\
Title: Re: (Updated) Spectrogram Panel Plugin
Post by: zkhcohen on February 28, 2019, 07:59:00 AM
Done;  here's the message generated after switching to a radio stream immediately after playing a song.  It first cites the previous song file's title, then shows an image being saved with the name of the radio stream instead:

(https://i.imgur.com/V0hUCNg.png)

No, there are no copies of the older plugin files around, I start every test of your new releases with a fresh MusicBee Portable backed up before I ever installed it.

SOMETHING funny is going on  :-\

The only thing I can think of is that for some reason it momentarily interprets the track duration to be greater than 0ms, so it triggers the generation of a new image. Since I added "mbApiInterface.NowPlaying_GetDuration() > 0" to prevent streams from prompting images to be generated (and it did prevent Ffmpeg from hanging), I believe that it might interpret buffered data from the stream as having a duration shortly after it begins playing.

Not only that, but ALSO, "mbApiInterface.NowPlaying_GetFileUrl()" would have to have a bug where it reports the last-played track, rather than the current stream name.


I don't have the time to fix the track-seeking issue tonight, but here's a version which will debug both of the API functions I referenced above. It will be a bit spammy with the prompts. In the future I might implement debugging which will go directly to a .txt file, but since this should be the last major issue for now, I'm doing it the crappy way.

LINK REMOVED

Thanks, again.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on February 28, 2019, 07:29:14 PM
When I try to get the new debug file, MediaFire returns with "Download not available yet because the upload for this file is still in progress. Approximate completion time below (no time appears-svk)
Download ready soon…"
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on February 28, 2019, 07:39:32 PM
When I try to get the new debug file, MediaFire returns with "Download not available yet because the upload for this file is still in progress. Approximate completion time below (no time appears-svk)
Download ready soon…"

Mediafire didn't like it. Here you go:


EDIT: Wrong one, hold on.

EDIT 2: Ah crap. I overwrote it. Major changes in the next version anyway. I'll just send that one over when it's done.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 01, 2019, 09:56:03 PM
When I try to get the new debug file, MediaFire returns with "Download not available yet because the upload for this file is still in progress. Approximate completion time below (no time appears-svk)
Download ready soon…"

Update 5.5: Configuration panel now integrated with MusicBee. Debug logging to "MBSpectrogramLog.txt" in Dependencies folder (cleared on restart). Other general improvements.

https://www.mediafire.com/file/en7mdu45c773amb/MusicBee_Spectrogram_1.5.zip/file
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 02, 2019, 01:28:09 AM
Link in your last post gives the "Upload in progress.." error message from MediaFire, downloaded plugin from first page post.

Positive:  superb work integrating the option menu into the MB plugin panel, works fine.

Negative:  after playing a music file (which generates/displays an image), playing a stream afterwards still generates a duplicate PNG to the previous file, and names it according to the stream title.  Subsequent streams do not exhibit the problem, however, if you then go back and play a file that generates an image and go back to streams, the first stream played after THAT music file will also save a stream-named image, repeat.

Also noticed that starting MB with no images at all in the Spectrogram_Images folder (nothing to delete) will create an entry in the debug log indicating "Image found..."  The start of that log (before playing anything) looks like this:

3/1/2019 7:52:40 PM: Spectrogram Images Deleted..
3/1/2019 7:52:40 PM: Track changed or Plugin Startup..
3/1/2019 7:52:40 PM: Current Song Duration: 0.
3/1/2019 7:52:41 PM: Raw Title: --701-222 ////// Processed Title: --701-222.
3/1/2019 7:52:41 PM: Current Song Duration: 0.
3/1/2019 7:52:41 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\--701-22206adc5a76f5844dca05007858ab172af3.png.
3/1/2019 7:52:41 PM: Image found..
3/1/2019 7:52:41 PM: Raw Title: --701-222 ////// Processed Title: --701-222.
3/1/2019 7:52:41 PM: Current Song Duration: 0.

Here is an abridged version of the log after a music file is played, then a stream right after:

3/1/2019 7:54:03 PM: Track changed or Plugin Startup..
3/1/2019 7:54:03 PM: Current Song Duration: 221120.
3/1/2019 7:54:03 PM: Raw Title: Bashed Out-This Is the Kit-701-222 ////// Processed Title: BashedOut-ThisIstheKit-701-222.
3/1/2019 7:54:03 PM: Current Song Duration: 221120.
3/1/2019 7:54:03 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\BashedOut-ThisIstheKit-701-2222211206adc5a76f5844dca05007858ab172af3.png.
3/1/2019 7:54:03 PM: Beginning generation of image..
3/1/2019 7:54:03 PM: FFMPEG Custom Path Set To: c:\ffmpeg\ffmpeg.exe
.
3/1/2019 7:54:03 PM: Raw Title: Bashed Out-This Is the Kit-701-222 ////// Processed Title: BashedOut-ThisIstheKit-701-222.
3/1/2019 7:54:03 PM: Current Song Duration: 221120.
3/1/2019 7:54:03 PM: FFMPEG Arguments: -i "E:\New Mx\This Is the Kit - Bashed Out.flac" -lavfi showspectrumpic=s=701x222:mode=combined:legend=enabled:saturation=2:color=rainbow:scale=log:win_func=hann:gain=1 "C:\MusicBee\AppData\Dependencies\Spectrogram_Images\BashedOut-ThisIstheKit-701-2222211206adc5a76f5844dca05007858ab172af3".png.
3/1/2019 7:54:05 PM: Process ended..
3/1/2019 7:54:05 PM: Raw Title: Bashed Out-This Is the Kit-701-222 ////// Processed Title: BashedOut-ThisIstheKit-701-222.
3/1/2019 7:54:05 PM: Current Song Duration: 221120.
3/1/2019 7:54:05 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\BashedOut-ThisIstheKit-701-2222211206adc5a76f5844dca05007858ab172af3.png.
3/1/2019 7:54:05 PM: Image found..
3/1/2019 7:54:05 PM: Raw Title: Bashed Out-This Is the Kit-701-222 ////// Processed Title: BashedOut-ThisIstheKit-701-222.
3/1/2019 7:54:05 PM: Current Song Duration: 221120.
3/1/2019 7:54:05 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\BashedOut-ThisIstheKit-701-2222211206adc5a76f5844dca05007858ab172af3.png.
3/1/2019 7:54:05 PM: Raw Title: Bashed Out-This Is the Kit-701-222 ////// Processed Title: BashedOut-ThisIstheKit-701-222.

<cut out dupe info>

3/1/2019 7:54:25 PM: Track changed or Plugin Startup..
3/1/2019 7:54:25 PM: Current Song Duration: 221120.
3/1/2019 7:54:25 PM: Raw Title: Come Home (Zetandel Chillout Remix)-Roman Messer-701-222 ////// Processed Title: ComeHome(ZetandelChilloutRemix)-RomanMesser-701-222.
3/1/2019 7:54:25 PM: Current Song Duration: 221120.
3/1/2019 7:54:25 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\ComeHome(ZetandelChilloutRemix)-RomanMesser-701-2222211206adc5a76f5844dca05007858ab172af3.png.
3/1/2019 7:54:25 PM: Beginning generation of image..
3/1/2019 7:54:25 PM: FFMPEG Custom Path Set To: c:\ffmpeg\ffmpeg.exe
.
3/1/2019 7:54:25 PM: Raw Title: Come Home (Zetandel Chillout Remix)-Roman Messer-701-222 ////// Processed Title: ComeHome(ZetandelChilloutRemix)-RomanMesser-701-222.
3/1/2019 7:54:25 PM: Current Song Duration: 221120.
3/1/2019 7:54:25 PM: FFMPEG Arguments: -i "E:\New Mx\This Is the Kit - Bashed Out.flac" -lavfi showspectrumpic=s=701x222:mode=combined:legend=enabled:saturation=2:color=rainbow:scale=log:win_func=hann:gain=1 "C:\MusicBee\AppData\Dependencies\Spectrogram_Images\ComeHome(ZetandelChilloutRemix)-RomanMesser-701-2222211206adc5a76f5844dca05007858ab172af3".png.
3/1/2019 7:54:27 PM: Process ended..
3/1/2019 7:54:27 PM: Track changed or Plugin Startup..
3/1/2019 7:54:27 PM: Current Song Duration: -1.
3/1/2019 7:54:27 PM: Raw Title: Come Home (Zetandel Chillout Remix)-Roman Messer-701-222 ////// Processed Title: ComeHome(ZetandelChilloutRemix)-RomanMesser-701-222.
3/1/2019 7:54:27 PM: Current Song Duration: -1.
3/1/2019 7:54:27 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\ComeHome(ZetandelChilloutRemix)-RomanMesser-701-222-16adc5a76f5844dca05007858ab172af3.png.
3/1/2019 7:54:27 PM: Image found..
3/1/2019 7:54:27 PM: Raw Title: Come Home (Zetandel Chillout Remix)-Roman Messer-701-222 ////// Processed Title: ComeHome(ZetandelChilloutRemix)-RomanMesser-701-222.
3/1/2019 7:54:27 PM: Current Song Duration: -1.
3/1/2019 7:54:27 PM: Image Check: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\ComeHome(ZetandelChilloutRemix)-RomanMesser-701-222-16adc5a76f5844dca05007858ab172af3.png.

If you need the entire log file, let me know, but the pattern is the same as the above.  BTW the dupe file png named for the stream and saved only stays in the display window for 1-2 secs while the first stream plays, remaining  blank for subsequent streams until a new file is played, when behavior will then repeat.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 02, 2019, 06:08:09 AM
Another suggestion:  ability to not display the "Images Deleted" popup on MusicBee opening, just delete them silently when the delete on startup option is selected.

The new color options make for some nice graphics!!  https://getmusicbee.com/forum/index.php?topic=2258.msg155817#msg155817 (https://getmusicbee.com/forum/index.php?topic=2258.msg155817#msg155817)

Thanks for this plugin,  I hope you are able to diagnose the problem with errant image generation when switching from file to stream.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 02, 2019, 07:46:04 AM
Another suggestion:  ability to not display the "Images Deleted" popup on MusicBee opening, just delete them silently when the delete on startup option is selected.

The new color options make for some nice graphics!!  https://getmusicbee.com/forum/index.php?topic=2258.msg155817#msg155817 (https://getmusicbee.com/forum/index.php?topic=2258.msg155817#msg155817)

Thanks for this plugin,  I hope you are able to diagnose the problem with errant image generation when switching from file to stream.

Hey, that's great!

And yes, I can remove that message. It was really for debugging purposes more than anything else.

Your logs definitely indicate some weird behavior.  It seems to be ignoring a lot of conditions. I'm going to run mine again and compare.

Thanks for sending those over!
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 02, 2019, 04:22:18 PM
Yeah, there's definitely something wrong with ImgCheck(). It also looks like the current song duration was copied from the last-played track the first time you played that stream.

There also might be some weird behavior when you run a stream which resolves the track name instead of just the stream name.

Did you start MusicBee with a specific track queued up or something? I also don't get the blank image log at startup.

Are you on MusicBee 3.3.6996? It really seems like it's a bug with the API, but I'm going to keep looking into it on my end.


EDIT: I managed to replicate the issue, finally. Now I can troubleshoot it.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 02, 2019, 05:22:15 PM
From your *edit* message it seems like you've finally got the info you need to solve this if that's possible on your end, great!!  Yes could be the API.  FYI, yes I'm always running the latest Mb 3.3x patch version, and no, I don't start with anything queued up.  Good luck with this!
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 02, 2019, 05:54:22 PM
From your *edit* message it seems like you've finally got the info you need to solve this if that's possible on your end, great!!  Yes could be the API.  FYI, yes I'm always running the latest Mb 3.3x patch version, and no, I don't start with anything queued up.  Good luck with this!

Update 5.6: Attempt to fix stream image generation. Code optimizations.


The link on the first page should be updated. The debug logs should look a lot cleaner now that I've reduced the number of method calls.


EDIT: I've made some more improvements for the next release. Looking for a more reliable way of preventing streams from being generated because there's definitely an issue with the File Duration API call.

EDIT 2: Fixed it for good by using: mbApiInterface.NowPlaying_GetFileProperty(FilePropertyType.Size) != "N/A". Will release after I do some code cleanup.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 02, 2019, 10:23:20 PM
EDIT 2: Fixed it for good by using: mbApiInterface.NowPlaying_GetFileProperty(FilePropertyType.Size) != "N/A". Will release after I do some code cleanup.

Will hold off on any more testing then until I get a "go" from you here, sounds promising!
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 03, 2019, 12:09:01 AM
EDIT 2: Fixed it for good by using: mbApiInterface.NowPlaying_GetFileProperty(FilePropertyType.Size) != "N/A". Will release after I do some code cleanup.

Will hold off on any more testing then until I get a "go" from you here, sounds promising!


Update 5.7: Fixed stream image generated bug. Fixed track seeking when frequency legend is enabled.

The workaround wasn't quite as simple as I thought it would be. I also had to create a _lastPlayed variable, since it looks like ALL of the API "NowPlaying" calls carry over.

Interestingly, this only occurs for streams with "Continuous" next to them. They seem to start, then immediately restart, sending a second notification.

I'm going to create a bug report for this.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 03, 2019, 03:39:29 AM
Testing version 5.7 with MusicBee 3.3.6998:

1.  The generation of a spurious image when a stream is played immediately after a file is FIXED (hurrah!).  Tried every combination I could to "break" it and could not.  Only file images are now saved/displayed.  Good job, zkhcohen!

2.  The image folder is now silently cleared on startup if that option is selected, no more popup to "OK."

3.  The seek within the spectrogram is now MUCH more accurate (frequency scale is enabled).

I realize the debug log is temporary, but wanted to mention that when an image IS generated for a file, the log gets very "excited":

3/2/2019 10:03:38 PM:

 Track changed or Plugin Startup.
3/2/2019 10:03:38 PM: Current Song Duration: 178901
3/2/2019 10:03:38 PM: Get file path.
3/2/2019 10:03:38 PM: Raw Title: 1000 Tonnen Glück-Grossstadtgeflüster-701-250 ////// Processed Title: 1000TonnenGlück-Grossstadtgeflüster-701-250
3/2/2019 10:03:38 PM: Size: 1.9 MB
3/2/2019 10:03:38 PM: Path: C:\MusicBee\AppData\Dependencies\Spectrogram_Images\1000TonnenGlück-Grossstadtgeflüster-701-2501789016adc5a76f5844dca05007858ab172af3.png
3/2/2019 10:03:38 PM: Beginning generation of image.
3/2/2019 10:03:38 PM: FFMPEG Custom Path Set To: c:\ffmpeg\ffmpeg.exe

3/2/2019 10:03:38 PM: Raw Title: 1000 Tonnen Glück-Grossstadtgeflüster-701-250 ////// Processed Title: 1000TonnenGlück-Grossstadtgeflüster-701-250
3/2/2019 10:03:38 PM: FFMPEG Arguments: -i "E:\New Mx\Grossstadtgeflüster - 1000 Tonnen Glück.opus" -lavfi showspectrumpic=s=701x250:mode=combined:legend=enabled:saturation=2:color=rainbow:scale=log:win_func=hann:gain=1 "C:\MusicBee\AppData\Dependencies\Spectrogram_Images\1000TonnenGlück-Grossstadtgeflüster-701-2501789016adc5a76f5844dca05007858ab172af3".png
3/2/2019 10:03:41 PM: Image generated.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:03:41 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:39 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
3/2/2019 10:04:43 PM: Image found.
<then waits until a new file is played before writing>

I mention that in case all these "calls" are taking unnecessary CPU time and can be reduced.  Also would like to suggest adding the OPTION to disable logging.

I would also like to submit a revised installation instruction for page one that more accurately reflects what I have experienced to get the plugin going (actually nothing needs to be "disabled then re-enabled", etc. like the popup indicates):

1. With MusicBee off, extract the file located in the "Plugins" folder to your MusicBee Plugins directory.

2. Start MusicBee.

3. A message will appear telling you where to place the plugin's "Dependencies" folder;  extract the whole folder there now.

4. In MusicBee navigate to Edit > Edit Preferences > Plugins. Ensure that "spectrogram-display" appears. Enable it, and hit Save.

5. Navigate to View > Arrange Panels...

6. Drag the "spectrogram-display" element from the "available elements" window to the "main panel" section to your desired position, for instance above the "now playing bar" element. Note: This is not the required location of the plugin, but it is HIGHLY RECOMMENDED that you position it here.  Hit Save.

7. Drag the top of the Spectrogram window where you have placed it to the desired height.

8. Try playing a song. After a second or two of processing, the spectrogram should appear.  You can seek through the song if desired within the spectrogram window.

9. See the first post of the plugin's thread on the MusicBee forum for instructions on using the plugin's built-in Configuration Panel and other important information.

NOTE:  If desired, the ffmpeg.exe supplied inside the Dependencies folder can be removed and a path given to your own copy of ffmpeg.exe elsewhere on the PC;  see step #9 for more details.  A 32-bit version of ffmpeg.exe (64-bit supplied) is necessary if you have a 32-bit OS.  The latest static release build at the Zeranoe site has been tested and works fine (https://ffmpeg.zeranoe.com/builds/).

Feel free to use any or none of the suggested modifications above.

Sir, GREAT JOB, and THANK YOU!
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 03, 2019, 03:57:49 AM
Thanks for the feedback! Glad to hear that the issues are finally patched.

The StreamWriter isn't resource intensive but I'll make debugging optional. The "image found" spam is a result of the way that MusicBee re-paints the panel.

I'll also modify the README with your suggestions and consider simply swapping FFMPEG builds entirely.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 03, 2019, 06:47:21 AM
Well, I guess I better report this, dang it...  Just noticed that the MusicBee error log is logging the following error every time MB is opened with the plugin active, though NOT generating any pop-up error window about it (which is why I never noticed until now--spotted an ErrorLog.dat file in my Appdata during a backup):

3/3/2019 1:38:06 AM - 6.1.7601.65536 - 3.3.6998.33948 P - System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MusicBeePlugin.Plugin.CurrentTitle()
   at MusicBeePlugin.Plugin.ImgCheck()
   at MusicBeePlugin.Plugin.ReceiveNotification(String sourceFileUrl, NotificationType type)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at #=zGWVOIIfXVyqY4V9P1w==.#=z4MWx6ZgbQymW()


MB and the plugin continue functioning normally after the "stealth" error message.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 03, 2019, 07:30:04 AM
Well, I guess I better report this, dang it...  Just noticed that the MusicBee error log is logging the following error every time MB is opened with the plugin active, though NOT generating any pop-up error window about it (which is why I never noticed until now--spotted an ErrorLog.dat file in my Appdata during a backup):

3/3/2019 1:38:06 AM - 6.1.7601.65536 - 3.3.6998.33948 P - System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MusicBeePlugin.Plugin.CurrentTitle()
   at MusicBeePlugin.Plugin.ImgCheck()
   at MusicBeePlugin.Plugin.ReceiveNotification(String sourceFileUrl, NotificationType type)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at #=zGWVOIIfXVyqY4V9P1w==.#=z4MWx6ZgbQymW()


MB and the plugin continue functioning normally after the "stealth" error message.



Fixed.



Update 5.8: Debugging Mode made optional. Fixed MusicBee error log spam. Code optimizations. Updated README.

Edit: Let me know if you have issues with songs playing in the background not always generating a picture. Happened once and I'm not sure if it's an issue with the API notifications or not.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 03, 2019, 06:21:11 PM
Version 5.8:  seems like the "money build."  No errors in MB error log are written.  Option to disable debug log works.  Different behavior on install: when first copying plugin dll to the MB Plugins folder and starting MB, a message about where to place Dependencies folder no longer appears (no big deal if you indicate where it should go in the readme).  Placed it myself in Appdata like usual, and followed normally.

Have not seen lack of image generation if minimized during a song change during an initial test, but will let you know if I ever do.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 03, 2019, 07:12:26 PM
Version 5.8:  seems like the "money build."  No errors in MB error log are written.  Option to disable debug log works.  Different behavior on install: when first copying plugin dll to the MB Plugins folder and starting MB, a message about where to place Dependencies folder no longer appears (no big deal if you indicate where it should go in the readme).  Placed it myself in Appdata like usual, and followed normally.

Have not seen lack of image generation if minimized during a song change during an initial test, but will let you know if I ever do.

Awesome! I'll look into the dependencies message. I think I might have killed it when I fixed the error spam.

Steven responded to my other topic (the bug report) so hopefully I'll be able to get him enough info to give me a permanent solution.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 03, 2019, 10:43:30 PM
Hey. Steven fixed the bug in the latest release (3.3.7001) so I created a branch which is a little more efficient/reliable than the main release of 1.5.8:


https://www.mediafire.com/file/gw982nvs9l49csc/MusicBee_Spectrogram_1.5_-_For_3.3.7001_and_Above.zip/file
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 04, 2019, 12:06:53 AM
Is this branch starting from scratch as far as testing?  Sort of getting "plugin fatigue" around here, so would appreciate a recommendation as to if development on the original plugin is being stopped, and continued at this new 7001+ link?  What exactly is not compatible between the branches?  As I am on MB 3.3.7001 now and update regularly, should I forget about ever checking the first project again and stick with this "new" one from now on?  To avoid confusing first-time users, I would just remove all links to the first project and add a line like "this plugin requires MB 3.3.7001 and above" to the first post.  People should be using the latest MB anyway if they expect best results.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 04, 2019, 12:15:44 AM
Is this branch starting from scratch as far as testing?  Sort of getting "plugin fatigue" around here, so would appreciate a recommendation as to if development on the original plugin is being stopped, and continued at this new 7001+ link?  What exactly is not compatible between the branches?  As I am on MB 3.3.7001 now and update regularly, should I forget about ever checking the first project again and stick with this "new" one from now on?  To avoid confusing first-time users, I would just remove all links to the first project and add a line like "this plugin requires MB 3.3.7001 and above" to the first post.  People should be using the latest MB anyway if they expect best results.


I won't update the old branch anymore. I've included the new one on the first page for people who are already on 3.3.7001, but the old one is still the primary release because most people aren't.

Thanks for all the testing! I don't have any plans to update anything for quite some time.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 04, 2019, 02:11:31 AM
Thanks for the reply.  Can you explain what the differences are exactly between the 7001+ and the old 5.8 version, and why the 7001+ is not recommended for lower versions of MusicBee?  Also, I assume all the changes/fixes you have already spent so much time on are included by default in the 7001+ version?

I appreciate your attention/patience.  Just trying to get the full picture before leaving 5.8 for good for 7001+.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 04, 2019, 04:15:55 AM
Thanks for the reply.  Can you explain what the differences are exactly between the 7001+ and the old 5.8 version, and why the 7001+ is not recommended for lower versions of MusicBee?  Also, I assume all the changes/fixes you have already spent so much time on are included by default in the 7001+ version?

I appreciate your attention/patience.  Just trying to get the full picture before leaving 5.8 for good for 7001+.

I basically un-did all of the additional checks which ensured that Ffmpeg wouldn't generate an image for streams. Now it uses the duration to determine whether an image can be generated or not.

The problem with the last version is that in rare cases the workaround causes MusicBee to abort generating an image for a particular file. You would then have to restart MusicBee or generate an image for another previously un-generated file in order for the plugin to generate an image for that problematic file.

Your total performance gains would be negligible, but the version created for 7001+ does eliminate the bug.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 04, 2019, 05:18:23 AM
Thanks, headed for the download now  :)
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 06, 2019, 03:32:58 AM
"Dear Readers", who may have been following the plugin's testing, I have been using the latest "7001+" version and can confirm it functions as-advertised and problem-free;  now in use with MusicBee 3.3.7003.  Thanks zkhcohen for all your work on this.

P.S.  zkhcohen, I would encourage you to take a look at the source files of the "Winamp Classic Spectrum Analyzer" (https://getmusicbee.com/forum/index.php?topic=23345.msg154061#msg154061 (https://getmusicbee.com/forum/index.php?topic=23345.msg154061#msg154061));  what we need is the ability to invoke and use the "options" GUI without crashing MB (see thread).  Maybe you can do an integerated options job on it like you've done for Spectrogram!  Would be much appreciated.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 06, 2019, 07:03:58 AM
"Dear Readers", who may have been following the plugin's testing, I have been using the latest "7001+" version and can confirm it functions as-advertised and problem-free;  now in use with MusicBee 3.3.7003.  Thanks zkhcohen for all your work on this.

P.S.  zkhcohen, I would encourage you to take a look at the source files of the "Winamp Classic Spectrum Analyzer" (https://getmusicbee.com/forum/index.php?topic=23345.msg154061#msg154061 (https://getmusicbee.com/forum/index.php?topic=23345.msg154061#msg154061));  what we need is the ability to invoke and use the "options" GUI without crashing MB (see thread).  Maybe you can do an integerated options job on it like you've done for Spectrogram!  Would be much appreciated.

Hmm... Looks interesting. I'll see what I can do at some point. Very busy IRL at the moment.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: D4RK.50LD13R on March 08, 2019, 08:17:56 PM
Hi,
excellent works, but I can not change the color, continues great job
Thank you.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 08, 2019, 08:25:21 PM
In order to change the color in the preferences GUI, you have to set the "Saturation" value to something other than "0".  I have mine set to 1, and Gain to 2.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 08, 2019, 09:05:44 PM
In order to change the color in the preferences GUI, you have to set the "Saturation" value to something other than "0".  I have mine set to 1, and Gain to 2.

For the record, you warned me that this would happen... lol.

Updated warning on first page.

Thanks.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: D4RK.50LD13R on March 09, 2019, 09:07:05 AM
hi, sveakul, zkhcohen
sorry not seen in the first page, thank you works great and in color, good job.
the top.
and thank you again, great job ...

(https://i.ibb.co/rsN59d0/musicbee.jpg)
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: Mr. Trev on March 10, 2019, 05:27:58 PM
Nice to see how this has developed. I always wanted an onboard spectrograph - as opposed to send things to Spek.

I do have a couple questions/comments.

First, for the life of me I can't seem to figure out how to change the size of the spectrogram window. I'm not sure if its because I'm using Album Cover view (although the other views didn't work either), but as it sits right now, the window is eating up too much vertical real estate for my liking.

Second, my legend only shows up to ~13000Hz (regardless of file format). I see in other pics it does go much higher

Finally, any of the colour themes from Magma on down won't show an image - not a big deal, but I thought I'd point it out

For the record, I'm using your latest release (for .7003+), MB version 3.3.7003, and the abominable Win 10 (1809)

Cheers
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 10, 2019, 06:27:41 PM
First, for the life of me I can't seem to figure out how to change the size of the spectrogram window. I'm not sure if its because I'm using Album Cover view (although the other views didn't work either), but as it sits right now, the window is eating up too much vertical real estate for my liking.

Second, my legend only shows up to ~13000Hz (regardless of file format). I see in other pics it does go much higher


Have you tried the bottom Main Panel location?  You should be able to drag the spectrogram's title bar to whatever height you want.

As far as the spectrogram displayed frequency level, that depends on the file's encoding.  If a lowpass filter was set to say 15kHz, you would see a "chopped off" area higher than that.  I've found that's a lot more common than I thought!

On the color theme, mine shows up all the way down to Green, but not lower.  zkhcohen may be able to help.  Like you said, no big deal to me either.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: Mr. Trev on March 10, 2019, 08:08:55 PM
First, for the life of me I can't seem to figure out how to change the size of the spectrogram window. I'm not sure if its because I'm using Album Cover view (although the other views didn't work either), but as it sits right now, the window is eating up too much vertical real estate for my liking.

Second, my legend only shows up to ~13000Hz (regardless of file format). I see in other pics it does go much higher


Have you tried the bottom Main Panel location?  You should be able to drag the spectrogram's title bar to whatever height you want.

As far as the spectrogram displayed frequency level, that depends on the file's encoding.  If a lowpass filter was set to say 15kHz, you would see a "chopped off" area higher than that.  I've found that's a lot more common than I thought!

On the color theme, mine shows up all the way down to Green, but not lower.  zkhcohen may be able to help.  Like you said, no big deal to me either.

I do have the window set for the bottom of the main panel. The only difference is I have my player controls on the top panel (I did try moving it to the main panel and that was no help - that was an older version of the plug-in though)

I do get the file encoding thing, but what I'm actually referring to the the numbers shown on the legend. In the picture D4RK.50LD13R posted above, you can see the numbers on the left go to ~17000Hz. Even if I'm playing a Flac file, the numbers on my legend top out at ~13KHz and the top of the spectrograph is obviously cut-off. (I'll post a screenshot later)
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 11, 2019, 03:07:31 AM
My scale is numbered up to "17226.56" kHz, and continues upward to around 19000 kHz.  Maybe in your case the problem is related to the inablity to move the header bar of the spectrogram window.

From the readme.txt: "Creating a file called "noheader.txt" in the Dependencies folder will disable the plugin's header/title bar the next time that you restart MusicBee. This isn't working reliably at the moment and you can't seem to resize it with the header disabled."  Have to ask, did you create that file, or?  IS there a header bar visible saying "Spectrogram" in its upper left corner?
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 11, 2019, 03:54:24 AM
@zkhcohen:  Anomaly/bug noticed:  if two music files of the same song with different file format and extensions but exactly the same file name are played, the spectrogram does not re-generate but remains identical to the first one played, even though restarting MB and starting with the "second" file will produce its own distinctive spectrogram from the first, as one would expect.  There should be the ability for the plugin to recognize format extensions not just file names for a re-paint, or just re-calculate on the fly and not re-use an existing PNG.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: Mr. Trev on March 11, 2019, 04:49:53 AM
My scale is numbered up to "17226.56" kHz, and continues upward to around 19000 kHz.  Maybe in your case the problem is related to the inablity to move the header bar of the spectrogram window.

From the readme.txt: "Creating a file called "noheader.txt" in the Dependencies folder will disable the plugin's header/title bar the next time that you restart MusicBee. This isn't working reliably at the moment and you can't seem to resize it with the header disabled."  Have to ask, did you create that file, or?  IS there a header bar visible saying "Spectrogram" in its upper left corner?

OK, I'm a total dumb-ass. Starting digging around my layout settings and found I had locked the layout (disable panel resizing). Not sure why or when I did that but that was the problem with resizing.

I still have the scale problem though. On my system, playing a flac file, the scale will max at 13781.25Hz. The same file in Spek will show a scale up to 22000Hz. I tried one of my 24/96 flac files and that will push the scale up to 30000Hz, so it is somewhat working properly.
I've tried different gain settings, changing the ffmepg.exe to the 32bit version

<edit> playing some more and I find the legend doesn't scale well - I think I remember this being mentioned earlier. If I make the spectrogram window ~50% of my screen height than I can get ~18000Hz on the legend. If I make the spectrogram window bigger than that (say 75% of the height) then the legend shrinks down to ~11000Hz. Not sure if I'll be able to find a happy medium between size and the usability of the legend with my layout - maybe just keep this plugin for the eye candy (minus legend) and use Spek for actual analysis
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 11, 2019, 05:37:24 AM
<edit> playing some more and I find the legend doesn't scale well - I think I remember this being mentioned earlier. If I make the spectrogram window ~50% of my screen height than I can get ~18000Hz on the legend. If I make the spectrogram window bigger than that (say 75% of the height) then the legend shrinks down to ~11000Hz. Not sure if I'll be able to find a happy medium between size and the usability of the legend with my layout - maybe just keep this plugin for the eye candy (minus legend) and use Spek for actual analysis

Yeah that's a problem if the legend isn't changing to match the spectrogram sizing;  when I reduce the height here it does "squish" everything down but that includes the legend and the numbering is extant.  I tried a 24-bit 96kHz FLAC and the scale legend showed 37500kHz and continued up to about 44000k.  You said you had the latest version, which did incorporate changes in handling that, so I don't know what could be causing that for you.  zkhcohen will be checking in soon I'm sure.  BTW, tried Spek per your mention and it's pretty cool, added it to my external tools in MB.  I did miss the lack of a "gain" setting like zkhcohen's plugin has, which allows more subtle info to stand out better.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 13, 2019, 04:22:06 AM
@zkhcohen:  Anomaly/bug noticed:  if two music files of the same song with different file format and extensions but exactly the same file name are played, the spectrogram does not re-generate but remains identical to the first one played, even though restarting MB and starting with the "second" file will produce its own distinctive spectrogram from the first, as one would expect.  There should be the ability for the plugin to recognize format extensions not just file names for a re-paint, or just re-calculate on the fly and not re-use an existing PNG.

@zkhcohen:  in addition to the bugfix mentioned above, here is a brazen "wishlist" request:  when a radio stream is detected and no spectrogram image can normally be displayed, add the option to manually point to an existing static PNG image elsewhere on user's PC which would be displayed instead.  "Nature abhors a vacuum," and so do I  ;D  ...so something can fill up that blank window when playing streams...
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 13, 2019, 04:51:35 PM
@zkhcohen:  Anomaly/bug noticed:  if two music files of the same song with different file format and extensions but exactly the same file name are played, the spectrogram does not re-generate but remains identical to the first one played, even though restarting MB and starting with the "second" file will produce its own distinctive spectrogram from the first, as one would expect.  There should be the ability for the plugin to recognize format extensions not just file names for a re-paint, or just re-calculate on the fly and not re-use an existing PNG.

My scale is numbered up to "17226.56" kHz, and continues upward to around 19000 kHz.  Maybe in your case the problem is related to the inablity to move the header bar of the spectrogram window.

From the readme.txt: "Creating a file called "noheader.txt" in the Dependencies folder will disable the plugin's header/title bar the next time that you restart MusicBee. This isn't working reliably at the moment and you can't seem to resize it with the header disabled."  Have to ask, did you create that file, or?  IS there a header bar visible saying "Spectrogram" in its upper left corner?

OK, I'm a total dumb-ass. Starting digging around my layout settings and found I had locked the layout (disable panel resizing). Not sure why or when I did that but that was the problem with resizing.

I still have the scale problem though. On my system, playing a flac file, the scale will max at 13781.25Hz. The same file in Spek will show a scale up to 22000Hz. I tried one of my 24/96 flac files and that will push the scale up to 30000Hz, so it is somewhat working properly.
I've tried different gain settings, changing the ffmepg.exe to the 32bit version

<edit> playing some more and I find the legend doesn't scale well - I think I remember this being mentioned earlier. If I make the spectrogram window ~50% of my screen height than I can get ~18000Hz on the legend. If I make the spectrogram window bigger than that (say 75% of the height) then the legend shrinks down to ~11000Hz. Not sure if I'll be able to find a happy medium between size and the usability of the legend with my layout - maybe just keep this plugin for the eye candy (minus legend) and use Spek for actual analysis


Sorry, the forum hasn't been notifying me about these posts.

The first one is a really easy fix. The second one (legend scaling) might be a crappy limitation of FFMPEG. I'll take a look into it over lunch.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 13, 2019, 05:07:30 PM
Well... it's definitely not a limitation of FFMPEG. I just generated this:

(https://i.imgur.com/UTErc8g.jpg)


It might have to do with the size not being a power of two??

https://hydrogenaud.io/index.php/topic,116067.0.html

I'll look into it more...
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 13, 2019, 05:14:06 PM
<edit> playing some more and I find the legend doesn't scale well - I think I remember this being mentioned earlier. If I make the spectrogram window ~50% of my screen height than I can get ~18000Hz on the legend. If I make the spectrogram window bigger than that (say 75% of the height) then the legend shrinks down to ~11000Hz. Not sure if I'll be able to find a happy medium between size and the usability of the legend with my layout - maybe just keep this plugin for the eye candy (minus legend) and use Spek for actual analysis

Yeah that's a problem if the legend isn't changing to match the spectrogram sizing;  when I reduce the height here it does "squish" everything down but that includes the legend and the numbering is extant.  I tried a 24-bit 96kHz FLAC and the scale legend showed 37500kHz and continued up to about 44000k.  You said you had the latest version, which did incorporate changes in handling that, so I don't know what could be causing that for you.  zkhcohen will be checking in soon I'm sure.  BTW, tried Spek per your mention and it's pretty cool, added it to my external tools in MB.  I did miss the lack of a "gain" setting like zkhcohen's plugin has, which allows more subtle info to stand out better.



Yeah. Check this out:

https://imgur.com/a/ELevqC9

It compresses it up until a certain point, then starts expanding it again.

I don't think I can do anything about this without actually modifying the formula in the FFMPEG source.

If you really wanted to use this for audio-analysis of FLAC files, I think you'd want to create a separate custom layout tab in MusicBee, dedicated to a MUCH larger spectrogram image.

We'll see what I can do.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 13, 2019, 07:54:38 PM
Thanks zkhcohen for your replies!

1.  Glad to know that adding the ability to distinguish identical name/different format files will be an easy one;

2.  About the "squish effect", I find that mine still holds up well "pretty squished" with the scale still showing up to 45kHz on a 24-bit 96kHz FLAC that does indeed top out around 45kHz., in other words I haven't seen the problem Mr. Trev reported, although your screenshot sequence does show that it can indeed happen.  Personally I "wince" at the idea of trying to hack ffmpeg to deal with that, but it's up to you.

3.  Does my "wishlist" suggestion about a user-supplied path to a static PNG that would be displayed in case of radio streams sound possible?  I mean just one image picked by the user that would be used in every case, not anything unique-per-stream.

In any case, #1 will make me a happy camper!  Thanks again for your efforts.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 13, 2019, 08:02:11 PM
Thanks zkhcohen for your replies!

1.  Glad to know that adding the ability to distinguish identical name/different format files will be an easy one;

2.  About the "squish effect", I find that mine still holds up well "pretty squished" with the scale still showing up to 45kHz on a 24-bit 96kHz FLAC that does indeed top out around 45kHz., in other words I haven't seen the problem Mr. Trev reported, although your screenshot sequence does show that it can indeed happen.  Personally I "wince" at the idea of trying to hack ffmpeg to deal with that, but it's up to you.

3.  Does my "wishlist" suggestion about a user-supplied path to a static PNG that would be displayed in case of radio streams sound possible?  I mean just one image picked by the user that would be used in every case, not anything unique-per-stream.

In any case, #1 will make me a happy camper!  Thanks again for your efforts.


Yeah, your wishlist item is really easy to implement. I'll take care of it.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 13, 2019, 11:28:39 PM


Finally, any of the colour themes from Magma on down won't show an image - not a big deal, but I thought I'd point it out



This is a bug with the FFMPEG build I included. I'm switching to the Zeranoe build for my next release.

EDIT:

I updated the MediaFire links so the latest releases now use Zeranoe.


Additionally, here's what we need to fix the frequency range issue:

(https://i.imgur.com/JDI6pMy.png)

Unfortunately I haven't found a build which supports these non-standard options (to clarify, they're commented out in the GitHub FFMPEG source).

I'll probably have to compile my own build to implement this.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: Mr. Trev on March 14, 2019, 02:06:21 AM
<edit> playing some more and I find the legend doesn't scale well - I think I remember this being mentioned earlier. If I make the spectrogram window ~50% of my screen height than I can get ~18000Hz on the legend. If I make the spectrogram window bigger than that (say 75% of the height) then the legend shrinks down to ~11000Hz. Not sure if I'll be able to find a happy medium between size and the usability of the legend with my layout - maybe just keep this plugin for the eye candy (minus legend) and use Spek for actual analysis

Yeah that's a problem if the legend isn't changing to match the spectrogram sizing;  when I reduce the height here it does "squish" everything down but that includes the legend and the numbering is extant.  I tried a 24-bit 96kHz FLAC and the scale legend showed 37500kHz and continued up to about 44000k.  You said you had the latest version, which did incorporate changes in handling that, so I don't know what could be causing that for you.  zkhcohen will be checking in soon I'm sure.  BTW, tried Spek per your mention and it's pretty cool, added it to my external tools in MB.  I did miss the lack of a "gain" setting like zkhcohen's plugin has, which allows more subtle info to stand out better.



Yeah. Check this out:

https://imgur.com/a/ELevqC9

It compresses it up until a certain point, then starts expanding it again.

I don't think I can do anything about this without actually modifying the formula in the FFMPEG source.

If you really wanted to use this for audio-analysis of FLAC files, I think you'd want to create a separate custom layout tab in MusicBee, dedicated to a MUCH larger spectrogram image.

We'll see what I can do.

Not sure if my problem isn't just due to the fact I'm running a laptop with a 1080p screen. Once I get the spectrogram window sized to the point the legend is in a usable range, it's just eating up too much screen. I like the idea of using a custom tab but have no idea how that's done. I can get the floating window to work, but that's really not much better than sending the file to Spek.
Anyways, my biggest problem was not being able to resize the window in the first place, but that's been fixed (user error on my part)

Cheers
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 14, 2019, 10:24:43 AM
Update 5.9: Fixed identical tracks with different file-types preventing unique image from being generated. Added ability to set Placeholder image for streams (place "placeholder.png" in the Dependencies folder). Switched to Zerandoe FFMPEG build so that the Magma color scheme works.


Please notice that the primary download link now points to the version for 3.3.7001 and newer, while the link below it is now the legacy version.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 14, 2019, 10:29:42 PM
Both the bug fix for same-name-different-format, and the new optional placeholder display are working BEAUTIFULLY, thank you!!

As far as color display, I can display down to and including "Green", but the choices below that (Viridis-Plasma-Cividis-Terrain) do not display.  This is with a Zerranoe 32-bit build of ffmpeg.  But since we already have 11 working color choices, I don't see how anyone, even me, could possibly complain!  I use Rainbow at any rate.

Note to others who want to try the "placeholder" image option:  the image you choose will be expanded horizontally and vertically to fill the whole Spectrogram window area without respect to aspect ratio.  Therefore, be sure you are using an image that either already has the dimensions of your Spectrogram window size, or is some pattern that looks OK to you when so displayed.  Me, I just used Irfanview to reduce a favorite pic to the height of the specbox while keeping its aspect ratio, then added a black canvas the remaining size of the box around it (also with Irfanview) and save to png.  Voila!  Of course, you have to pretty much settle on your spec window size with that method, not that it's that big of a deal to create a new placeholder if your needs change.

Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: zkhcohen on March 15, 2019, 12:11:45 AM
Both the bug fix for same-name-different-format, and the new optional placeholder display are working BEAUTIFULLY, thank you!!

As far as color display, I can display down to and including "Green", but the choices below that (Viridis-Plasma-Cividis-Terrain) do not display.  This is with a Zerranoe 32-bit build of ffmpeg.  But since we already have 11 working color choices, I don't see how anyone, even me, could possibly complain!  I use Rainbow at any rate.


Glad to hear that the bug is fixed!

Just wanted to let you know that the color scheme issue only affects 32 bit (I assume). I just tested every color on the 64 bit build and they all work.
Title: Re: (Version 1.5.X) Spectrogram Panel Plugin
Post by: sveakul on March 15, 2019, 03:31:53 AM
Just wanted to let you know that the color scheme issue only affects 32 bit (I assume). I just tested every color on the 64 bit build and they all work.

Roger that.  Now I've already made a set of "mood" placeholders for my stream listening, which is about 60% of my MusicBee use.  Switch to music files and there is that beautiful spectrogram, what's there not to like, haha..  The latter makes spotting low-pass disasters a lot simpler/less obtrusive than my previous method (an external VST window).  Thanks again for a fine plugin and for being so responsive.  Now, if we could get you on re-working that Winamp Classic Spectrum Analyzer options GUI..  ;)
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 16, 2019, 11:00:58 PM
(BETA) Update 6: Spectrogram now always shows the full frequency spectrum of the track, regardless of the size of the panel. This works by finding the closest resolution (multiple of 2) and then stretching the image to fit the panel. This also means that substantially fewer images will be generated, and accidental/minor resizes won't trigger new image generation (it will use the best-fit).
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: sveakul on March 17, 2019, 12:49:52 AM
1.6 up and running, seems to be working just fine here and haven't found a case yet where top of scale wasn't matching top of song frequency, checked with Spek.  Hopefully Mr. Trev is good too.

Different behavior: 1.5 used to load the placeholder.png immediately on start, before any stream or file playback was started;  now it does not.  Actually now is expected behavior so don't try to "fix", haha!  Just like to indicate any differences I've noticed betwen builds.

Great work man.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: Mr. Trev on March 17, 2019, 02:47:25 AM
I gave it a run, everything seems to be working as intended - mostly…
It did balk when I tossed a 24/192 flac at it (didn't display any image at all). I'm not going to worry much about that, I don't have many files at that sample rate.

But otherwise, the legend is staying at the max rate regardless of window size, the themes that didn't display before do now.
Now I just need to find a layout that'll work for me… (and find somebody to write a plugin that'll do DR range analysis ;) )

Thanks for your work!
Cheers
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 17, 2019, 06:30:01 PM
I gave it a run, everything seems to be working as intended - mostly…
It did balk when I tossed a 24/192 flac at it (didn't display any image at all). I'm not going to worry much about that, I don't have many files at that sample rate.

But otherwise, the legend is staying at the max rate regardless of window size, the themes that didn't display before do now.
Now I just need to find a layout that'll work for me… (and find somebody to write a plugin that'll do DR range analysis ;) )

Thanks for your work!
Cheers

Interesting... can you send me the 24/192 FLAC? I'd like to see if that's my problem or FFMPEG's.

DR analysis would be interesting and I don't see why FFMPEG wouldn't be able to do it - the db scale on the right of the spectrogram legend already adjusts dynamically. I'm going to look into a way of exporting some of those values directly.

It also allows you to compress the DR:

https://ffmpeg.org/ffmpeg-filters.html#compand

Would you be interested in something like this?

http://dr.loudness-war.info/

EDIT:

Just tested it with the following 24/192 flac sample and it works:

http://www.lindberg.no/hires/test/2L-125_stereo-176k-24b_04.flac

Does it have an unusually large file-size or long length? I've had some issues with that on my laptop, but not my desktop.


EDIT 2:

Uploaded a 'hotfix' for some minor image generation issues. Better support for low and high resolutions.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: diljitdosanjh on March 18, 2019, 02:30:43 AM
looks interesting and mean while promising.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: Mr. Trev on March 18, 2019, 02:45:14 AM
I gave it a run, everything seems to be working as intended - mostly…
It did balk when I tossed a 24/192 flac at it (didn't display any image at all). I'm not going to worry much about that, I don't have many files at that sample rate.

But otherwise, the legend is staying at the max rate regardless of window size, the themes that didn't display before do now.
Now I just need to find a layout that'll work for me… (and find somebody to write a plugin that'll do DR range analysis ;) )

Thanks for your work!
Cheers

Interesting... can you send me the 24/192 FLAC? I'd like to see if that's my problem or FFMPEG's.

DR analysis would be interesting and I don't see why FFMPEG wouldn't be able to do it - the db scale on the right of the spectrogram legend already adjusts dynamically. I'm going to look into a way of exporting some of those values directly.

It also allows you to compress the DR:

https://ffmpeg.org/ffmpeg-filters.html#compand

Would you be interested in something like this?

http://dr.loudness-war.info/

EDIT:

Just tested it with the following 24/192 flac sample and it works:

http://www.lindberg.no/hires/test/2L-125_stereo-176k-24b_04.flac

Does it have an unusually large file-size or long length? I've had some issues with that on my laptop, but not my desktop.


EDIT 2:

Uploaded a 'hotfix' for some minor image generation issues. Better support for low and high resolutions.

The file in question is 14 minutes long. Hope you don't mind if I pass on uploading it to you, it's ~900MB.
The size probably is the issue, I tried a couple shorter tracks off the same album and they did display.

As far as DR was concerned, I was referring to the "Loudness Wars". I was hoping somebody would make a plugin that'll do the same thing as the DR analyzer in Foobar2000 - although there is a new MAAT thing that's supposed to be more accurate
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: sveakul on March 18, 2019, 03:35:58 AM
@zkhcohen:  Applied the hotfix and I seem to see an improved resolution on my Spectrogram display  :)

@Mr. Trev:  I know it's not identical to DR but you can get a dynamic LUFS reading from one of the meters on the "Unlimited" VST plugin by Sonic Anomaly, which I use with MusicBee.  Of course, not as nice as having a dedicated window like with Spectrogram.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 18, 2019, 09:02:48 AM
Interesting. I'll look into the DR analyzer plugin.

Also, it's safe to say that 900mb is really pushing it. I think since I've verified that the format/bit-rate aren't the issue, I'm going to put it to rest.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: Mr. Trev on March 18, 2019, 05:34:15 PM
A dynamic range analyzer plugin would be awesome if you could make one. That's about the only reason I keep Foobar around.
Basically what I use it for is when I'm putting music onto my portable devices. I'll run an analysis on the files I'm going to transfer. Any music that has a low DR rating I'll convert to AAC - why bother with lossless on an album that has a DR rating of 5.
Since this is the only thing I'd use it for I really can't justify paying for the MAAT offline program.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: sveakul on March 18, 2019, 05:58:49 PM
Since this is the only thing I'd use it for I really can't justify paying for the MAAT offline program.

Have you tried the freeware TT DR Offline Meter 1.4a?  From the same people as the Foobar plugin I believe:
http://dr.loudness-war.info/downloads/DR-Meter-1_4a.zip (http://dr.loudness-war.info/downloads/DR-Meter-1_4a.zip)
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 18, 2019, 06:01:53 PM
Since this is the only thing I'd use it for I really can't justify paying for the MAAT offline program.

Have you tried the freeware TT DR Offline Meter 1.4a?  From the same people as the Foobar plugin I believe:
http://dr.loudness-war.info/downloads/DR-Meter-1_4a.zip (http://dr.loudness-war.info/downloads/DR-Meter-1_4a.zip)



I tried running that one in conjunction with the VST support plugin for Music Bee, but I haven't had any luck yet.

Still looking into alternatives.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: sveakul on March 18, 2019, 07:18:56 PM
I tried running that one in conjunction with the VST support plugin for Music Bee, but I haven't had any luck yet.

Still looking into alternatives.

The documentation indicates that there is both a stand-alone and VST version in the TT-DR installer--did you try the standalone version?  I was thinking that might be convenient to run via MB Tools on selected libray files.  I'd try it myself but DR analysis has really no interest for me, but Mr. Trev might give it a shot.  I did extract the installer via 7-Zip and it shows a "DR-Offline.exe" file and its own folder structure with own graphics as well as a VST dll in a separate folder.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 18, 2019, 08:51:19 PM
I tried running that one in conjunction with the VST support plugin for Music Bee, but I haven't had any luck yet.

Still looking into alternatives.

The documentation indicates that there is both a stand-alone and VST version in the TT-DR installer--did you try the standalone version?  I was thinking that might be convenient to run via MB Tools on selected libray files.  I'd try it myself but DR analysis has really no interest for me, but Mr. Trev might give it a shot.  I did extract the installer via 7-Zip and it shows a "DR-Offline.exe" file and its own folder structure with own graphics as well as a VST dll in a separate folder.

I was thinking about doing a conversion of the TT-DR CLI someone made for Linux but then I found the ebur128 library in FFMPEG:

Code
FOR %a IN ("*.mp3") DO (ffmpeg -i "%a" -af ebur128 -f null - 2>&1 | FINDSTR /BIC:" " | FINDSTR /C:"LU")


...should analyze every mp3 in a folder and spit out data like this:

Code
C:\Users\zacha\Downloads\Katy Perry - One of the Boys (2008)>(ffmpeg -i "01. One Of The Boys.mp3" -af ebur128 -f null -   2>&1  | FINDSTR /BIC:" "   | FINDSTR /C:"LU" )
    I:          -5.5 LUFS
    Threshold: -15.7 LUFS
    LRA:         5.0 LU
    Threshold: -25.6 LUFS
    LRA low:    -8.9 LUFS
    LRA high:   -3.9 LUFS

C:\Users\zacha\Downloads\Katy Perry - One of the Boys (2008)>(ffmpeg -i "02. I Kissed A Girl.mp3" -af ebur128 -f null -   2>&1  | FINDSTR /BIC:" "   | FINDSTR /C:"LU" )
    I:          -6.5 LUFS
    Threshold: -16.5 LUFS
    LRA:         3.5 LU
    Threshold: -26.5 LUFS
    LRA low:    -8.5 LUFS
    LRA high:   -5.0 LUFS


This is really efficient and the output is easy to work with. I'm no audio engineer, so it'll take a while for me to determine whether this is the best approach.

https://auphonic.com/blog/2012/08/02/loudness-measurement-and-normalization-ebu-r128-calm-act/


EDIT:


The following command will create a text file for each .mp3 which includes the data (including True Peak) at the end:

Code
FOR %a IN ("*.mp3") DO (ffmpeg -i "%a" -af ebur128=peak=true -f null - > %a-output.txt 2>&1)

This would be really easy to implement into a MusicBee Plugin.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: sveakul on March 18, 2019, 09:33:29 PM
Cool, LUFS/R128 is the new standard anyway and it's great the functionality to get the readings is already in ffmpeg.  I assume the "I:" value is the "Intergrated" LUFS value?  Steven changed to R128 for Opus gain tagging not too long ago.  What are your thoughts as far as a GUI display ?  Meters or just numerical values?
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 18, 2019, 09:58:44 PM
Cool, LUFS/R128 is the new standard anyway and it's great the functionality to get the readings is already in ffmpeg.  I assume the "I:" value is the "Intergrated" LUFS value?  Steven changed to R128 for Opus gain tagging not too long ago.  What are your thoughts as far as a GUI display ?  Meters or just numerical values?

Minor edit to my last post.

In terms of a GUI, I'm not sure if panel-integrated meters are possible. If they are, FFMPEG supports streaming that data.

It doesn't seem like that sort of visual analysis is what's most important, though, so numerical values / tags might be better suited.

Fun fact, FFMPEG has its own data interpreter / player, FFPLAY:

(https://i.imgur.com/TIkwvI5.png)
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: Mr. Trev on March 18, 2019, 10:02:56 PM
Since this is the only thing I'd use it for I really can't justify paying for the MAAT offline program.

Have you tried the freeware TT DR Offline Meter 1.4a?  From the same people as the Foobar plugin I believe:
http://dr.loudness-war.info/downloads/DR-Meter-1_4a.zip (http://dr.loudness-war.info/downloads/DR-Meter-1_4a.zip)

I have tried it. IIRC it works OK on an album by album basis, but with the Foobar plugin I can batch process all the files I want and spit the results out as a text file. Then I can go through the results and decide what I want/need to convert at a later date
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: sveakul on March 18, 2019, 10:18:28 PM

It doesn't seem like that sort of visual analysis is what's most important, though, so numerical values / tags might be better suited.


I agree.  Mr. Trev will be a lot more useful at describing what users might be looking for, I admit I don't even use ReplayGain tags.  BTW, you might as well start a new topic for this project!  Just don't forget about Classic Spectrum Analyzer... ;)
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 18, 2019, 10:42:15 PM

It doesn't seem like that sort of visual analysis is what's most important, though, so numerical values / tags might be better suited.


I agree.  Mr. Trev will be a lot more useful at describing what users might be looking for, I admit I don't even use ReplayGain tags.  BTW, you might as well start a new topic for this project!  Just don't forget about Classic Spectrum Analyzer... ;)

Yeah. I'll split this into another topic later today.

I don't know when I'll get to the Classic Spectrum Analyzer project. I'm also revamping the old Spotify integration plugin using the new auth. API.

Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 18, 2019, 11:16:42 PM
https://getmusicbee.com/forum/index.php?topic=28208
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: Bee-liever on March 24, 2019, 11:43:44 AM
Would it be possible to add a right-click menu to the plugin's header/title bar to open the "Configure" menu.
It sure would be a lot easier to access from there, rather than navigating to the Plugins panel everytime.
Title: Re: (Version 1.6) Spectrogram Panel Plugin
Post by: zkhcohen on March 24, 2019, 04:55:31 PM
Would it be possible to add a right-click menu to the plugin's header/title bar to open the "Configure" menu.
It sure would be a lot easier to access from there, rather than navigating to the Plugins panel everytime.


Just implemented this. Will roll-out the update later today with some other bug fixes.
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: zkhcohen on March 24, 2019, 05:34:19 PM

Update 6.1: You can now access the Spectrogram Configuration Panel by right-clicking the panel. Bug fixes. More efficient image generation / resolution matching.

Let me know if there are any issues.
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: sveakul on March 24, 2019, 06:35:01 PM
Working fine here.  The right-click the panel for options feature is great--and exactly what I hope you'll be able to do for Classic Spectrum Analyzer when the time is right  ;)
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: D4RK.50LD13R on March 26, 2019, 12:56:47 PM
Super , very very good job
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: HOX on March 29, 2019, 04:16:30 PM
Quote
3. A message will appear telling you where to place the plugin's "Dependencies" folder;  extract the whole folder there now.


Stuck here, no message

3.3.7003 version and latest release, musicbee see this plugin (disabled in plugins menu)
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: sveakul on March 29, 2019, 05:38:34 PM
HOX:  just go ahead and manually put the Dependencies folder into the MusicBee/Appdata folder.  Restart MusicBee.  Then:

1. In MusicBee navigate to Edit > Edit Preferences > Plugins again. Ensure that "spectrogram-display" appears. Enable it, and hit Save.

2. Navigate to View > Arrange Panels...

3. Drag the "spectrogram-display" element from the "available elements" window to the "main panel" section to your desired position, for instance above the "now playing bar" element. Note: This is not the required location of the plugin, but it is recommended that you position it there.  Hit Save.
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: zkhcohen on March 29, 2019, 09:40:53 PM
Quote
3. A message will appear telling you where to place the plugin's "Dependencies" folder;  extract the whole folder there now.


Stuck here, no message

3.3.7003 version and latest release, musicbee see this plugin (disabled in plugins menu)

Let me know if you continue to have issues after following Sveakul's advice.

I'll try to fix the prompt over the weekend.
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: HOX on March 30, 2019, 07:08:50 PM
@sveakul @zkhcohen thanks, now it work flawlessly
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: oceanbee on March 31, 2019, 03:04:48 AM
I have just installed the plugin yesterday. Took me a while to figure out how to get it work.

My feedback on the installation process:

1. I am on Window 10. MusicBee Ver 3.2.6902 non-portable.

2. Re: Installation Instructions #3. "A message will appear telling you where to place the plugin's "Dependencies" folder; extract the whole folder there now."

After extracting the file mb_Spectrogram-Display.dll in the Plugin folder and place it in the MusicBee/Plugins, I restarted MusicBee. However, there is no message telling me where to place the "Dependencies" folder.

I spent some time reading through the forum postings and managed to find the correct folder.

The folder should be

C:\Users\YOUR_USERNAME\AppData\Roaming\MusicBee\".
For my case, it didn't work if I put it in the sub-folder \Plugin (I don't have such a folder and I created one by following the posting quoted by boroda in Reply #2).

Note: The above folder is a hidden folder and users need to enable viewing hidden folders in the window explorer options.

3. For the configuration, the chart is by default grey scale and without the "Frequency Legend" enabled.  As most of us would like to see color chart with the readings on x and y axis. I would suggest the following defaults:
Saturation be 1 instead of 0
Frequency Legend enabled
Color Scheme: Plasma

Great work. Thanks!
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: Bee-liever on March 31, 2019, 05:36:18 AM
You can now access the Spectrogram Configuration Panel by right-clicking the panel.

Thank you for adding this  :)
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: zkhcohen on March 31, 2019, 04:40:15 PM
I have just installed the plugin yesterday. Took me a while to figure out how to get it work.

My feedback on the installation process:

1. I am on Window 10. MusicBee Ver 3.2.6902 non-portable.

2. Re: Installation Instructions #3. "A message will appear telling you where to place the plugin's "Dependencies" folder; extract the whole folder there now."

After extracting the file mb_Spectrogram-Display.dll in the Plugin folder and place it in the MusicBee/Plugins, I restarted MusicBee. However, there is no message telling me where to place the "Dependencies" folder.

I spent some time reading through the forum postings and managed to find the correct folder.

The folder should be

C:\Users\YOUR_USERNAME\AppData\Roaming\MusicBee\".
For my case, it didn't work if I put it in the sub-folder \Plugin (I don't have such a folder and I created one by following the posting quoted by boroda in Reply #2).

Note: The above folder is a hidden folder and users need to enable viewing hidden folders in the window explorer options.

3. For the configuration, the chart is by default grey scale and without the "Frequency Legend" enabled.  As most of us would like to see color chart with the readings on x and y axis. I would suggest the following defaults:
Saturation be 1 instead of 0
Frequency Legend enabled
Color Scheme: Plasma

Great work. Thanks!

Thanks for the feedback! I'm still out of town, but I'll work on implementing this.
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: sveakul on March 31, 2019, 05:57:05 PM
Thanks for the feedback! I'm still out of town, but I'll work on implementing this.

I don't mean to be a PITA, but instead of re-doing the plugin to show a message, why not just change the installation instructions on the first post and in the zip's readme.  Just eliminate the current step #3 altogether, and re-write step #1 to read:

1.  With MusicBee off, extract the file located in the "Plugins" folder to your MusicBee Plugins directory, and the "Dependencies" folder to your MusicBee/Appdata directory.

More time then to work on the dynamic seek indicator  ;)
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: sveakul on April 06, 2019, 03:43:07 AM
As far as color display, I can display down to and including "Green", but the choices below that (Viridis-Plasma-Cividis-Terrain) do not display.  This is with a Zerranoe 32-bit build of ffmpeg.  But since we already have 11 working color choices, I don't see how anyone, even me, could possibly complain!  I use Rainbow at any rate.

Glad to hear that the bug is fixed!

Just wanted to let you know that the color scheme issue only affects 32 bit (I assume). I just tested every color on the 64 bit build and they all work.

Have found that the "nightly git build" of the Zeranoe 32-bit ffmpeg will indeed display all color options;  it's only the (currently) 4.1.1 release build that will stop with "Green."

Looking forward to the dynamic seek indicator addition.  Will greatly enhance the current seeking, which is already devoid of the click/pop in wasapi-exclusive some of us have experienced in that mode.
Title: Re: (Version 1.6.1) Spectrogram Panel Plugin
Post by: zkhcohen on April 08, 2019, 12:39:58 AM
As far as color display, I can display down to and including "Green", but the choices below that (Viridis-Plasma-Cividis-Terrain) do not display.  This is with a Zerranoe 32-bit build of ffmpeg.  But since we already have 11 working color choices, I don't see how anyone, even me, could possibly complain!  I use Rainbow at any rate.

Glad to hear that the bug is fixed!

Just wanted to let you know that the color scheme issue only affects 32 bit (I assume). I just tested every color on the 64 bit build and they all work.

Have found that the "nightly git build" of the Zeranoe 32-bit ffmpeg will indeed display all color options;  it's only the (currently) 4.1.1 release build that will stop with "Green."

Looking forward to the dynamic seek indicator addition.  Will greatly enhance the current seeking, which is already devoid of the click/pop in wasapi-exclusive some of us have experienced in that mode.

Ah, that's a good find.

I'm going to look back into the dynamic seek indicator. Been busy and didn't find an easy way to implement it from my original research.
Title: Re: (Version 1.7) Spectrogram Panel Plugin
Post by: zkhcohen on April 09, 2019, 02:10:53 AM
Update 7: Added two experimental features to the Configuration Panel - Enable Seekbar and Disable Header.  Added ability to pause/play by right-clicking the Spectrogram.
Title: Re: (Version 1.7) Spectrogram Panel Plugin
Post by: sveakul on April 09, 2019, 03:14:43 AM
Thanks for the new version.  Can you give an explanation or screenshot as to what the "Enable Seekbar" setting is supposed to do/look like?  I have it enabled, and don't see any dynamic "seekbar" or time indication at all, just the normal spectrogram which will seek when the mouse is clicked through the image as before;  the "pointed finger" cursor replaces the normal mouse arrow cursor of 1.6.1.   A zero-byte "seekbar.txt" file is created in Dependencies.  Enabling the debug log produces no entries for "seekbar."

Contents of config.xml:

Code
<?xml version="1.0" encoding="utf-8"?>
<ConfigMgr xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ColorScheme>rainbow</ColorScheme>
  <Saturation>1</Saturation>
  <Gain>1</Gain>
  <WindowFunction>hann</WindowFunction>
  <ChannelMode>combined</ChannelMode>
  <Scale>log</Scale>
  <ClearImages>true</ClearImages>
  <ShowLegend>true</ShowLegend>
  <EnableDebugging>true</EnableDebugging>
</ConfigMgr>
In the GUI, "Enable Seekbar" is checked but not "Disable Header."

The right-click pause/resume works, but I don't find that useful personally as I always use spacebar for that.

In MusicBee (3.3.7035) I have "Progress Bar on Top" set, as I always have-- in case that may have something to do with your seek indicator not showing.  Using Dark Fine-Tuned series Maya Blue skin.

BTW, the file version of the dll still shows as "1.6.1" not 1.7, albeit with a mod date of today.
Title: Re: (Version 1.7) Spectrogram Panel Plugin
Post by: zkhcohen on April 09, 2019, 04:58:19 AM
Hey,

That's my bad...

I haven't implemented different colors for Dark skins.

(https://i.imgur.com/YXg16Cq.gif)

There are definitely some limitations. I tried creating a seekbar that would cover the entire spectrogram (with translucency), but unfortunately I couldn't find a clever way of refreshing the panel without redrawing the bitmap.

I'll work on improving this.
Title: Re: (Version 1.7) Spectrogram Panel Plugin
Post by: sveakul on April 09, 2019, 06:05:48 AM
I guess what I was hoping to see by "dynamic seek" was just an indication of the playing time of the file as the mouse was dragged or hovered through the spectrogram, as opposed to another seek "bar" itself.  In other words, a digital time indicator tied to the file playing time that would temporarily appear when the mouse was hovered through the display, resulting in a "seek" to that time point when "clicked."  IMO, the idea of a transparency drawing through the display would be a BAD idea, obscuring the attractive display of the graphics themselves.  Better just to leave it as-is in that case.

Is it possible to leave links to a couple of previous versions on the first post, instead of just the latest experimental version?

Would be nice to hear what other users' wishlists/opinions are.  I know I'm not shy about mine ;D  Thanks for putting up with us.
Title: Re: (Version 1.7) Spectrogram Panel Plugin
Post by: zkhcohen on April 09, 2019, 11:22:03 PM
I guess what I was hoping to see by "dynamic seek" was just an indication of the playing time of the file as the mouse was dragged or hovered through the spectrogram, as opposed to another seek "bar" itself.  In other words, a digital time indicator tied to the file playing time that would temporarily appear when the mouse was hovered through the display, resulting in a "seek" to that time point when "clicked."  IMO, the idea of a transparency drawing through the display would be a BAD idea, obscuring the attractive display of the graphics themselves.  Better just to leave it as-is in that case.

Is it possible to leave links to a couple of previous versions on the first post, instead of just the latest experimental version?

Would be nice to hear what other users' wishlists/opinions are.  I know I'm not shy about mine ;D  Thanks for putting up with us.

I did want to implement something that would show the time. That's actually a really good idea! Let me give it a shot.
Title: Re: (Version 1.7) Spectrogram Panel Plugin
Post by: zkhcohen on April 11, 2019, 07:51:24 PM
I guess what I was hoping to see by "dynamic seek" was just an indication of the playing time of the file as the mouse was dragged or hovered through the spectrogram, as opposed to another seek "bar" itself.  In other words, a digital time indicator tied to the file playing time that would temporarily appear when the mouse was hovered through the display, resulting in a "seek" to that time point when "clicked."  IMO, the idea of a transparency drawing through the display would be a BAD idea, obscuring the attractive display of the graphics themselves.  Better just to leave it as-is in that case.

Is it possible to leave links to a couple of previous versions on the first post, instead of just the latest experimental version?

Would be nice to hear what other users' wishlists/opinions are.  I know I'm not shy about mine ;D  Thanks for putting up with us.

Update 7.1: Added dynamic indicator (tooltip) of time in song. Fixed version.
Title: Re: (Version 1.7.1) Spectrogram Panel Plugin
Post by: sveakul on April 11, 2019, 10:51:28 PM
The dynamic digital time indicator that follows the mouse cursor inside the spectrogram is great!  Thanks!  Um, but may I mention just two things...:-X

Current behavior is that when clicking into a seek point within the image, the song correctly jumps to that time point and continues playing as expected, but the MusicBee elapsed/total track time indicator in the corner will freeze, jumping to the correct time only when the cursor is moved out of the spectrogram panel.  Is it possible to synch the spectrogram seek point with the MusicBee timer so that the latter updates immediately?  This is easier to see than to describe.  And, to see how far out on a limb I can crawl, would be possible to have the mouse cursor while in the spectrogram retain the normal arrow pointer as it did in 1.6x instead of the "funky finger"?

I keep the plugin's own seek bar disabled as it's not needed with your new update, frees up a tiny bit more real estate, and I prefer to keep the MusicBee one available.  And with a dark (black) skin you can't see it anyway.

Thanks for your work on this, and for being so open to user requests!  Again, thanks for the "placeholder" option that allows the space to be used for a user-supplied image when playing radio streams, works perfect and much appreciated.  If it any point you feel like these requests (from me or anybody) start to kludge up the core operation/intent of the plugin, "just say NO!"
Title: Re: (Version 1.7.1) Spectrogram Panel Plugin
Post by: zkhcohen on April 12, 2019, 12:02:34 AM
The dynamic digital time indicator that follows the mouse cursor inside the spectrogram is great!  Thanks!  Um, but may I mention just two things...:-X

Current behavior is that when clicking into a seek point within the image, the song correctly jumps to that time point and continues playing as expected, but the MusicBee elapsed/total track time indicator in the corner will freeze, jumping to the correct time only when the cursor is moved out of the spectrogram panel.  Is it possible to synch the spectrogram seek point with the MusicBee timer so that the latter updates immediately?  This is easier to see than to describe.  And, to see how far out on a limb I can crawl, would be possible to have the mouse cursor while in the spectrogram retain the normal arrow pointer as it did in 1.6x instead of the "funky finger"?

I keep the plugin's own seek bar disabled as it's not needed with your new update, frees up a tiny bit more real estate, and I prefer to keep the MusicBee one available.  And with a dark (black) skin you can't see it anyway.

Thanks for your work on this, and for being so open to user requests!  Again, thanks for the "placeholder" option that allows the space to be used for a user-supplied image when playing radio streams, works perfect and much appreciated.  If it any point you feel like these requests (from me or anybody) start to kludge up the core operation/intent of the plugin, "just say NO!"

Yeah, the cursor is buggy and I think I'm going to remove that.

In terms of the bug you're experiencing with seeking - I can't replicate it.

Can you attach a screenshot or video of it occurring?
Title: Re: (Version 1.7.1) Spectrogram Panel Plugin
Post by: sveakul on April 12, 2019, 02:48:11 AM
In terms of the bug you're experiencing with seeking - I can't replicate it.

Can you attach a screenshot or video of it occurring?

See the GIF at the link below:

1.  Song starts, time elapsed counter in lower right corner begins;

2.  At the 6 seconds point I drag the cursor into the spectrogram, which immediately stops the MB time counter and MB seekbar but not the music (the plugin-generated time by cursor doesn't show on the gif--some overlay problem in my gif app, sorry!).

3.  I drag the cursor to about 2/3 of the song, click it to seek, and then move it down out of the spectrogram window, which causes the MB seekbar and elapsed time to immediately jump to the right place and resume counting.

https://imgur.com/gLca5DE (https://imgur.com/gLca5DE)
Title: Re: (Version 1.7.1) Spectrogram Panel Plugin
Post by: zkhcohen on April 14, 2019, 02:37:39 AM
In terms of the bug you're experiencing with seeking - I can't replicate it.

Can you attach a screenshot or video of it occurring?

See the GIF at the link below:

1.  Song starts, time elapsed counter in lower right corner begins;

2.  At the 6 seconds point I drag the cursor into the spectrogram, which immediately stops the MB time counter and MB seekbar but not the music (the plugin-generated time by cursor doesn't show on the gif--some overlay problem in my gif app, sorry!).

3.  I drag the cursor to about 2/3 of the song, click it to seek, and then move it down out of the spectrogram window, which causes the MB seekbar and elapsed time to immediately jump to the right place and resume counting.

https://imgur.com/gLca5DE (https://imgur.com/gLca5DE)


Thanks! Currently trying to replicate this issue.

Also working on fixing this app-hang:

Code
System.ArgumentException: Controls created on one thread cannot be parented to a control on a different thread.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on April 14, 2019, 07:33:01 PM
In terms of the bug you're experiencing with seeking - I can't replicate it.

Can you attach a screenshot or video of it occurring?

See the GIF at the link below:

1.  Song starts, time elapsed counter in lower right corner begins;

2.  At the 6 seconds point I drag the cursor into the spectrogram, which immediately stops the MB time counter and MB seekbar but not the music (the plugin-generated time by cursor doesn't show on the gif--some overlay problem in my gif app, sorry!).

3.  I drag the cursor to about 2/3 of the song, click it to seek, and then move it down out of the spectrogram window, which causes the MB seekbar and elapsed time to immediately jump to the right place and resume counting.

https://imgur.com/gLca5DE (https://imgur.com/gLca5DE)

Updated. I might have fixed your issue.

Edit: I forgot to fix the cursor... will update shortly.

Edit 2: Changed cursor.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on April 14, 2019, 08:30:16 PM
Thanks for your reply!

The good news:  the "funky finger" cursor is GONE  :)

The other news:  the other behavior as shown in the GIF remains, namely:

When the song is playing, moving the mouse cursor anywhere into the spectrogram causes the MusicBee time indicator and progress bar in the player controls-bottom pane to freeze, although the music continues to play.  Moving the cursor out of the spectrogram will cause the MB time and progress bar to un-freeze and immediately jump to the currently playing position.

As expected from the above behavior, clicking within the spectrogram for a seek operation is successful, but the MB time/bar will freeze, then unfreeze when the cursor is moved out of the display.

I said "other" news because this isn't exactly some big negative or bug, it just would be nice to have the player control indicators function as you would expect regardless of whether the cursor is in the spectrogram window or not.  To which one might reply, "just keep it out of the window then, stupid!"

With the thousands of views this thread has received it would sure be nice to have some other users commenting on this (hint, hint!).

Anyway, it would be great if you feel like having another bash at this, and much appreciated by me at least.  But if want to consign it to the "things that cannot be fixed" category, I'm good with that too.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on April 14, 2019, 09:14:25 PM
Anyway, it would be great if you feel like having another bash at this, and much appreciated by me at least.  But if want to consign it to the "things that cannot be fixed" category, I'm good with that too.

Any chance you can send me the skin and layout you use so I can test this? I can't manage to replicate it on my system.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on April 14, 2019, 10:04:40 PM
The skin I use is the supplied-with-MusicBee "Maya Blue", in the "Dark-Fine Tuned" group.

The layout I use is in the 7z posted here:  http://s000.tinyupload.com/index.php?file_id=25425319485832111344 (http://s000.tinyupload.com/index.php?file_id=25425319485832111344)

MusicBee 3.3.7042, using wasapi-exclusive on Windows 7 SP1, on-the-motherboard Realtek audio (sad I know).

I have no idea why you aren't seeing what I describe, which is why it would be nice if other users could please post what THEY see with this new build?

Thanks for taking another look!
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: Mr. Trev on April 15, 2019, 12:25:21 AM
I've had the plugin disabled, and haven't been following the progress lately, but just turned it on to see what's what.

I'm running MB version 3.3.7038. Bleached Bone skin. Player controls at the top. Win 10 (insert sad trombone noise here)

I'm not seeing the same problem that sveakul is experiencing. Maybe it's a Win 7 thing? Also isn't sveakul using the 32bit version of ffmpeg (maybe that could be causing complications)?

Otherwise everything seems to be functioning as I'd expect it - seems quite a bit faster than I remember it too
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on April 15, 2019, 01:34:59 AM
Thanks Mr. Trev for contributing your observations!  I tried moving my player controls to the top panel--no difference.  Also tried to get a hold of the Bleached Bone skin at the Skins downloads in case that made any difference, but that ends up with MediaFire being unable to generate a successful "download key" whatever that means.  I have tried the stock MusicBee3 skin, same thing:

Every time I move the mouse pointer into the Spectrogram window, the elapsed time indicator on the controls bar "freezes" while music continues to play normally, jumping to the correct time again as soon as the pointer is  moved out of the window.  Same thing with the MB progress bar.

I don't know if my placement of the spectrogram makes any difference (bottom main panel) in reference to my general layout, but hopefully zkhcohen can make some progress with my uploaded layout settings I posted above.  Here is what they LOOK like at any rate: https://imgur.com/vBDymN7 (https://imgur.com/vBDymN7)

If it ain't that, maybe it really is a Win 7 thing.  Yep I'm using 32-bit ffmpeg (latest dev build) but hard to see how that would affect the actual player control progress bar/timer as opposed to behavior of the spectrogram generation itself.  The latter's options all work normally.

Thanks again for letting us know what you're seeing.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on April 15, 2019, 02:02:03 AM
zkhcohen: also forgot to mention, when rolling back to versions 1.6.1/2, the problem vanishes--having the pointer within the spectrogram makes no difference at all to the player control time counter or progress bar;  clicking within the spectrogram to seek produces an instant reaction by the latter to the seek point.

So the problem I have seems directly related to the addition of the progressive time indicator in version 1.7x
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: Mr. Trev on April 15, 2019, 03:24:47 AM
Thanks Mr. Trev for contributing your observations!  I tried moving my player controls to the top panel--no difference.  Also tried to get a hold of the Bleached Bone skin at the Skins downloads in case that made any difference, but that ends up with MediaFire being unable to generate a successful "download key" whatever that means.  I have tried the stock MusicBee3 skin, same thing:


I don't know if my placement of the spectrogram makes any difference (bottom main panel) in reference to my general layout, but hopefully zkhcohen can make some progress with my uploaded layout settings I posted above.  Here is what they LOOK like at any rate: https://imgur.com/vBDymN7 (https://imgur.com/vBDymN7)



I have the spectrogram in the same place (bottom main panel), probably the only difference is I use the album covers view
Here's a pic of my layout: https://i.imgur.com/XfKryXu.jpg
You can also see why I don't keep the spectrogram active - eats up too much screen space with album cover view
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on April 15, 2019, 03:40:48 AM
Mr. Trev:  Thanks for the screenshot!  BTW cool skin.  Can you confirm that you are using version 1.7.2 of the plugin zkhcohen uploaded today?  Do you have any of the 2 "experimental" options enabled?
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: Bee-liever on April 15, 2019, 07:52:10 AM
@sveakul:
I've tried a few different skins and settings, with experimental on and off, I can't duplicate your behaviour from the gif file.  :(

Also tried to get a hold of the Bleached Bone skin at the Skins downloads in case that made any difference, but that ends up with MediaFire being unable to generate a successful "download key" whatever that means.
On a positive note, here is a direct link to Bleached Bone (while MediaFire sorts out the problem) (http://www.mediafire.com/file/db876i8182qgafy/BBoneReset.zip/file)

@zkhcohen:
I noticed that if you put the panel anywhere else except the bottom of the main panel, you don't get a header bar. That's either with the 'Experimental: Disable Header' off or on.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on April 15, 2019, 09:25:28 AM
Thanks for the feedback, guys. I'll look into it!
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: Mr. Trev on April 15, 2019, 05:35:18 PM
Mr. Trev:  Thanks for the screenshot!  BTW cool skin.  Can you confirm that you are using version 1.7.2 of the plugin zkhcohen uploaded today?  Do you have any of the 2 "experimental" options enabled?

Yes, latest version of the plugin. No, I'm not using any of the experimental options (actually, didn't even notice they were there TBH)
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on April 15, 2019, 07:29:02 PM
@zkhcohen:
I noticed that if you put the panel anywhere else except the bottom of the main panel, you don't get a header bar. That's either with the 'Experimental: Disable Header' off or on.

I'm not able to replicate this on multiple systems. I'm guessing that it's a settings/configuration issue, potentially.


zkhcohen: also forgot to mention, when rolling back to versions 1.6.1/2, the problem vanishes--having the pointer within the spectrogram makes no difference at all to the player control time counter or progress bar;  clicking within the spectrogram to seek produces an instant reaction by the latter to the seek point.

So the problem I have seems directly related to the addition of the progressive time indicator in version 1.7x

I'm still not able to replicate it with your settings, even with the Classic Spectrum Analyzer embedded.

The only think I can think of is that it's some sort of threading issue caused my the Control.MouseMove Event...
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on April 15, 2019, 08:18:44 PM
I'm still not able to replicate it with your settings, even with the Classic Spectrum Analyzer embedded.

The only think I can think of is that it's some sort of threading issue caused my the Control.MouseMove Event...

zkhcohen:  I do appreciate the tries.  I guess I have to put it down to a "Win 7 thing," 32-bits, or some mysterious settings issue.  Man I HATE mysteries, haha..  Anyway, I have rolled back to 1.6.1 (3/24/2019 build), which doesn't have the problem, and still has the right-click for Options which I prefer and without the seekbar that I don't use anyway.  But that pop-up progressive time indicator was indeed cool.  If another build comes out, be sure that I will be testing again  :)  Thanks again for all your work.

Bee-liever:  thanks for taking the time to test it yourself and share your results, and for the new link to your Bleached Bone skin!  Maybe the issue you see with the header could be related to mine in some way (my settings as opposed to layout?) seeing as zkhcohen couldn't replicate it either.

Mr. Trev:  thanks for your own testing too and getting back to me, much appreciated!
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: Bee-liever on April 16, 2019, 02:16:30 AM
@zkhcohen:
I noticed that if you put the panel anywhere else except the bottom of the main panel, you don't get a header bar. That's either with the 'Experimental: Disable Header' off or on.

I'm not able to replicate this on multiple systems. I'm guessing that it's a settings/configuration issue, potentially.

That's unfortunate  :(


Anyway, I have rolled back to 1.6.1 (3/24/2019 build), which doesn't have the problem, and still has the right-click for Options which I prefer and without the seekbar that I don't use anyway.  But that pop-up progressive time indicator was indeed cool.  If another build comes out, be sure that I will be testing again  :)  Thanks again for all your work.

I too have reverted to the 1.6.1 build for the right-click Options access when the panel is not in the bottom of the main panel (for my settings  :)  ).  Only get right-click for pause/play in 1.7.2 build.

Like sveakul, I thank your for all your work on this and wait patiently to see what happens in the future.
Title: Re: (Version 1.7.2.1) Spectrogram Panel Plugin
Post by: zkhcohen on April 23, 2019, 09:48:13 PM
To anyone looking at this thread regarding an integer-conversion crash, that's been resolved and the fixed version has been uploaded.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: stardepp on June 06, 2019, 08:16:45 AM
Recently the Spectrogram Panel Plugin no longer shows a top border. How can I restore the top margin?

(https://i.imgur.com/ttYDJf6.jpg)


That's what it looked like with Border:


(https://i.imgur.com/IriQdU5.jpg)
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on June 06, 2019, 03:23:24 PM
Recently the Spectrogram Panel Plugin no longer shows a top border. How can I restore the top margin?


I noticed that with a recent update.

Does disabling, restarting MusicBee and re-enabling it not fix the issue?

I might need your settings to troubleshoot.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: stardepp on June 06, 2019, 03:35:59 PM
Disabling and restarting did not help. I hereby send the settings protocol.

https://drive.google.com/file/d/1T5BGdXQ3LhDi8Qus-n2rKZmTSL3-JrI7/view?usp=sharing
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on June 06, 2019, 03:42:18 PM
Disabling and restarting did not help. I hereby send the settings protocol.

https://drive.google.com/file/d/1T5BGdXQ3LhDi8Qus-n2rKZmTSL3-JrI7/view?usp=sharing

Thanks! I'll check this ASAP.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: stardepp on June 06, 2019, 03:45:26 PM
Thank you in advance, but you do not have to rush it
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on June 06, 2019, 08:39:24 PM
The header displays fine here, using latest mb_Spectrogram-Display.dll mod date 4/29/2019 and MusicBee 3.3.7904.  Using Maya Blue skin from latest Dark Fine-Tuned package.

stardepp, sorry if this is obvious, but did you check that "disable header" isn't accidently selected in the spectrogram settings?
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: stardepp on June 06, 2019, 08:50:14 PM
but did you check that "disable header" isn't accidently selected in the spectrogram settings?

Yes, thank you for your effort, yes in my settings, this was the check mark in disable header. I have removed and now the top bar is visible again.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on June 06, 2019, 08:52:54 PM
but did you check that "disable header" isn't accidently selected in the spectrogram settings?

Yes, thank you for your effort, yes in my settings, this was the check mark in disable header. I have removed and now the top bar is visible again.


Oh. Huh. I forgot I added that setting to the configuration panel. Too many things on my plate.

Glad it's fixed, lol.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: stardepp on June 06, 2019, 08:55:51 PM
All good. Your SPECTROGRAM PANEL PLUGIN makes MusicBee even more beautiful and useful  :D  :D  :D  :D  :D  :D
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on June 06, 2019, 09:52:26 PM
+1
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: Fonetik2003 on June 10, 2019, 10:33:17 PM
Okay I followed your read me and even ended up having to create the folder just for the dependencies folder to go into, but the plugin just does not want to work. What am I doing wrong? Is there perhaps some alternative process I need to follow or am I just hosed here?
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on June 10, 2019, 11:10:55 PM
You don't need to create a folder, just extract the whole "Dependencies" folder into the already existing MusicBee "Appdata" sub-folder, the one that holds your MusicBee3Settings.ini file.  What version of MusicBee do you have--Installer, Portable, or (gulp!) Windows Store?  In the Installer version the folder is located at [c]:\Users\[yourusername]\AppData(NOT the same!)\Roaming\MusicBee\AppData.  In the Portable version it's in whatever folder you installed MusicBee into.  The Windows Store version is a horse of a different color.

Of course the plugin file itself mb_Spectrogram-Display.dll goes into the MusicBee "Plugins" sub-folder.

If you are running a 32-bit OS, you will need to replace the supplied ffmpeg.exe in the Dependencies folder with a 32-bit version or the plugin will not display the spectrogram image(see first post).
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: lodiped on July 17, 2019, 05:39:39 AM
I have the Windows Store version installed and I do not see any image. It's clickable but no image. Tried using the 32-bit version of ffmpeg even though I'm on a 64-bit system but it didn't solve it. I'm thinking I'm not in the proper directory. There are almost no files inside the /AppData/Roaming thingy and I'm starting to think it's some leftovers from an older MB installation.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: sveakul on July 17, 2019, 06:51:22 AM
Man first thing is see if you can lose the "Windows Store" version, which isn't friendly with third-party plugins that require creating new directories, etc. and you can't even apply manual application updates.  That is due to Windows 10 permission restrictions, not the app itself.  I heartily recommend the Portable version which can be updated, backed-up, and examined/modified at your call.  I'm not dissing the fact that Steven supplied a Windows Store version, it serves basic users nicely and provides an avenue to MusicBee that many would not/could not have taken otherwise.  It's just not ideal for users who want to fully wring out its possibilities.

The Spectrogram rocks.  Don't give up on it.  But do try what I suggested.
Title: Re: (Version 1.7.2) Spectrogram Panel Plugin
Post by: zkhcohen on August 08, 2019, 08:10:30 AM
If/when I get the chance, I'm planning on refactoring this.

I've learned a lot since I last updated any of my add-ins.

Don't use the Windows Store version, guys.
Title: Re: (Version 1.7.3) Spectrogram Panel Plugin
Post by: zkhcohen on February 05, 2020, 08:44:40 PM
1.7.3 released with a fix for a system.overflow exception.
Title: Re: (Version 1.7.3) Spectrogram Panel Plugin
Post by: zkhcohen on March 20, 2020, 07:25:53 PM
1.7.3 broke the seekbar.

The new release, 1.7.4, implements a fix.
Title: Re: (Version 1.7.4) Spectrogram Panel Plugin
Post by: sveakul on May 20, 2020, 01:09:07 AM
zkhcohen:  just as a follow-up to an issue I was bugging you with way back when (https://getmusicbee.com/forum/index.php?topic=25944.msg157663#msg157663 (https://getmusicbee.com/forum/index.php?topic=25944.msg157663#msg157663)) , my recent upgrade to a new PC and Windows 10 has seen this time-seek bar sync problem vanish and 1.7.4 is working exactly as advertised.  Probably was indeed the classic "Windows 7 thing."
Title: Re: (Version 1.7.4) Spectrogram Panel Plugin
Post by: Frunk on May 24, 2020, 02:49:38 PM
Thanks for this. It's perfect for my purposes.
Title: Re: (Version 1.7.4) Spectrogram Panel Plugin
Post by: diedie2 on August 16, 2020, 04:58:30 PM
Useful, but it will still not replace spek that I'm using to check if song is fake mp3 or anything like that because it doesn't show numbers on any of the sides of the spectrum, so i can't guess where it goes above 16 kHz and 20khz.



I think it would be more readable/usefull if it showed a scale 2kHZ/4kHZ/.../20kHZ/22kHZ like Spek does. If you show values like 17226.56 and 20671.88, its normal you think its ugly.
Also using mm:ss as time-format, like Spek, would be nice (perhaps make it optional?)


Seekbar not working atm, but no big deal atm.
Title: Re: (Version 1.7.4) Spectrogram Panel Plugin
Post by: rene.cloosterman on September 20, 2020, 03:45:37 PM
Hi, Will this also work for the portable version of musicbee? (it doesnt with mine ;-) )

Regards,
Rene
Title: Re: (Version 1.7.4) Spectrogram Panel Plugin
Post by: sveakul on September 20, 2020, 05:40:04 PM
Yes, it works just fine on my own portable version.  Can you be more specific about what exactly doesn't work/show up on yours?
Title: Re: (Version 1.7.4) Spectrogram Panel Plugin
Post by: sveakul on October 25, 2020, 06:23:53 AM
I have noticed a major bug with 1.7.4; if two files of the same type (e.g. MP3) and the same Title/Artist--but different bitrates/encoding parameters--are played, the same spectrogram produced for the first one played will not change for the second one, even though the actual graph should be obviously different (and displays so in Spek).

MusicBee 3.4.7601, Windows 10 v2004 64-bit, ffmpeg 4.3.1 64-bit.

FWIW in Properties/Details of mb_Spectrogram-Display.dll, the version still says "1.7.2" instead of 1.7.4, mod date is 3/20/2020.