Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement of lv_analyzer #255

Open
kaixiong opened this issue Feb 5, 2023 · 6 comments
Open

Enhancement of lv_analyzer #255

kaixiong opened this issue Feb 5, 2023 · 6 comments

Comments

@kaixiong
Copy link
Member

kaixiong commented Feb 5, 2023

lv-analyzer plots the frequency spectrum in a bar graph and a bit hard to love at the moment (#207). For me, it's been relegated to a sort of visual debugger for audio inputs in Libvisual.

It's boring because the frequency spectrum doesn't see that much movement unless you're listening to sound like this where there's energy shifts up and down the spectrum.

We could superimpose a plot of the audio signal over it, add ghosting/fading, render the bars in a more stylized (less blocky) fashion, and so on. Here are some reference styles:

Another idea that's been brought up in the past is to scale the axes logarithmically so it doesn't look as lopsided. Vertical scaling is straightforward. Horizontal scaling will require the use of a longer signal so that the DFT can produce higher resolution i.e. more samples. These samples can then be put into log-sized buckets (wider band towards higher frequencies), summed and scaled accordingly.

@kaixiong kaixiong added this to the 0.5.0_alpha1 milestone Feb 5, 2023
@hartwork
Copy link
Member

hartwork commented Feb 5, 2023

I would like to add some inspiration from projects on GitHub with pictures that do spectrum analysis with C/C++ code:

bradleybauer/music_visualizer

example5.png
example0.PNG

aiXander/Realtime_PyAudio_FFT

20bfbb00-9506-11ea-9e50-e197d8710500

kojigardiner/audiobox

tvotr_sym1.GIF

JanKleprlik/AudioVisualiser

radio.PNG

GhostNaN/recidia-audio-visualizer

preview.apng

hannesha/GLMViz

minimal.gif

seven-phases/spectrum-analyzer

seven-phases

UtoECat/jack_utils

spectrum.png
(while the line rendering could be improved)

jarcode-foss/glava

glava demo
(though neither the colors nor the symmetry seem to be a good idea)

@hartwork
Copy link
Member

hartwork commented Feb 5, 2023

One more, this is from https://github.com/pckbls/pulseviz , shots are self-made. The licensing would need to be clarified though.

Screenshot_20230205_210543_bars
Screenshot_20230205_210520_spectrum
Screenshot_20230205_210444_time
Screenshot_20230205_210350_spectrogram

@kaixiong
Copy link
Member Author

@hartwork, thanks for the ideas. I'm working on the code to rasterise lines and circles. I have done both before. Currently doing research on how to add anti-aliasing to them. Let's see what I can come up with once I have these two graphics primitives to work with.

@hartwork
Copy link
Member

@kaixiong sounds good, looking forward to see your own spectrum analyzer in action!

I think long-term I'd want us to also port some of the existing ones seen above to (and into) Libvisual as well if licensing can be clarified, I'm thinking of (parts of) both https://github.com/JanKleprlik/AudioVisualiser and https://github.com/pckbls/pulseviz in particular. I hope we can have multiple spectra in libvisual-plugins, a spectrum family 😄

If your work on anti-aliasing has any likely cross-over to GL vidoptions (get_video_attribute_options), please let me know, so we don't duplicate work about it in the future by accident.

@kaixiong
Copy link
Member Author

@kaixiong sounds good, looking forward to see your own spectrum analyzer in action!

I think long-term I'd want us to also port some of the existing ones seen above to (and into) Libvisual as well if licensing can be clarified, I'm thinking of (parts of) both https://github.com/JanKleprlik/AudioVisualiser and https://github.com/pckbls/pulseviz in particular. I hope we can have multiple spectra in libvisual-plugins, a spectrum family smile

@hartwork Sounds good to me!

If your work on anti-aliasing has any likely cross-over to GL vidoptions (get_video_attribute_options), please let me know, so we don't duplicate work about it in the future by accident.

The rasterisation and anti-aliasing is done entirely in software so there's no overlap with OpenGL. I miss doing software rasterisation and it's a bit of a fun distraction for me.

@hartwork
Copy link
Member

@kaixiong 😃 Thanks for the clarification! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants