Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: A new spectrogram style idea: Channels colored differently and overlaid (Read 2945 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

A new spectrogram style idea: Channels colored differently and overlaid

I have an idea of improving foobar's integrated spectrum abilities by giving each channel a different color and overlaying them.
 
Instead of shown next to each other as separate tracks, this option could directly compare left and right channel by superimposing them. For example, if left channel was colored red, and right channel cyan, when layered (in fashion of screen blending mode in Photoshop) the resulting colors will be: white where they overlap, red where the left channel differs, and cyan where the right channel differs. This way, all the differences between the channels will be clearly visible and recognizable by their colors. Here's an example of the resulting image:



In case of multichannel tracks, additional complementary color combinations could be used, as well, and there should be an option to superimpose all of the channels together, in pairs or separately, front only, back only. For example, Center and Subwoofer are colored green and magenta, rear channels are blue and yellow. I Photoshopped some examples:







Complementary pairs are used so they can result in white where they completely overlap.

The main advantage of this spectrogram style is an ability to have a clear visual on the channels differences.
Furthermore, the red and cyan pair can be watched through anaglyph 3D glasses, which can potentially provide an exciting viewing experience. Basically it will display stereo sound spectrograms - stereoscopically. This will be just an extra value.

I tried searching for a functionality like this in other software solutions but couldn't find anything similar.

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #1
showspectrum[pic] from FFmpeg


Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #3
It's a filter that generates a video stream from audio.

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #4
showspectrum[pic] from FFmpeg

How does that even work?
Documentation: https://ffmpeg.org/ffmpeg-filters.html#showspectrumpic

An example using the "cividis" color scheme as taken via zkhcohen's "Spectrogram-Display" plugin for the MusicBee player:


Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #5
I already have a script for displaying images generated by sox (which had audio piped into it via ffmpeg). If I can do the same thing without sox, that would be very handy.



edit: had a quick play and if you use mode=separate:color=channel you end up with this.


Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #6
If I can do the same thing without sox, that would be very handy.
Indeed!  marc2k3, many would appreciate you giving that a go for Foobar as a standalone plugin.


Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #8
There won't be any standalone plugin. Just like the old SoX version, you can right click and use the various menu options/input box...


How can I do this in my foobar? Do I need to install anything extra? Also, can it do what I described: color the channels in red and cyan and blend them together?

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #9
You need foo_jscript_panel (or SMP) https://github.com/marc2k3/foo_jscript_panel/releases. Add a jscript panel to your layout , then look at the samples and find - Spectrogram Seekbar.
But I don't know if it can do what you described.

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #10
There won't be any standalone plugin. Just like the old SoX version, you can right click and use the various menu options/input box...


That would be cool to not need Sox, and be able to specify the color.  Are you thinking of making that available as a new "sample"?  If so, will be looking forward to it!

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #11
It will be a straight replacement. I've already made the code changes/updated the changelog describing the changes for existing users.

https://github.com/marc2k3/foo_jscript_panel/blob/develop/CHANGELOG.md

I'm not planning a new release just yet.

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #12
You need foo_jscript_panel (or SMP) https://github.com/marc2k3/foo_jscript_panel/releases. Add a jscript panel to your layout , then look at the samples and find - Spectrogram Seekbar.
But I don't know if it can do what you described.

OK, this is something. Thanks a lot! I'll try that.
I do still wonder if there will be my described option any time, ever. I really think it will be very useful and interesting to a lot of people to be able to see a stereo sound in form of two differently colored and blended spectrograms. 

Here are two video examples of what exactly I have in mind:
1. Cars on a highway (very clear differentiation of cars coming from the left and then going to the right, recorded with Zoom H1 X/Y stereo recorder: https://www.youtube.com/watch?v=AJJhRAox2Ec
2. Aphex Twin's Equation (which is mostly mono, but you can clearly see where the stereo parts are, they pop out: https://www.youtube.com/watch?v=hNDi_uDvnPM

As a bonus example this is nightingale's song in the middle of the night in some suburbs. You can clearly see that the bird is somewhere far, while the background noise comes from somewhere near you - the stereo image is more pronounced. I also find this picture to be beautiful. A literal soundscape.


Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #13
I made another example of the spectrogram with different channels colored differently superimposed into same graph the OP suggested, but this time, it visualizes both L/R and M/S channels at the same time (blue = left, sepia/orange = right, white = mid = (left+right)/2, magenta = side = (left-right)/2):
X
BTW, this example above is made with my audio spectrum analyzer project that I've made.

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #14



Two modes from showcwt filter (those two modes are not available in current FFmpeg) for stereo file.

 

Re: A new spectrogram style idea: Channels colored differently and overlaid

Reply #15


This is yet another special mode  for stereo audio that picks colors by cross-correlating left and right channel.