Author Topic: (Version 1.8) Spectrogram Panel Plugin  (Read 101998 times)

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
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?

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
@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.

Mr. Trev

  • Sr. Member
  • ****
  • Posts: 454
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

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
<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.
Last Edit: March 11, 2019, 06:07:22 AM by sveakul

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
@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...

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
@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.

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
Well... it's definitely not a limitation of FFMPEG. I just generated this:




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

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
<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.

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
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.

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
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.

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346


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:



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.
Last Edit: March 13, 2019, 11:37:42 PM by zkhcohen

Mr. Trev

  • Sr. Member
  • ****
  • Posts: 454
<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

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
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.

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
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.


zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
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.