perf: improve visualizer smoothness with render cache and timing telemetry#1
Open
perf: improve visualizer smoothness with render cache and timing telemetry#1
Conversation
- Expandido el ancho al 98% de la pantalla. - Elevada drásticamente la potencia (x1.5) y sensibilidad (.65) de la gráfica. - Cambiado el suavizado de ataque a casi instantáneo y caída 3x más lenta para sensación líquida.
- Removed hardcoded internal smoothing loops from SoundWave2, SpectrumBars, CircularSpectrum, and AudioLines. - Removed excessive exponentiation math in SoundWave2 that forced clipping, hiding Gain changes. - Visualizers now properly trust and display the ft_data output that contains UI-controlled Gain and CavaFilter Smoothing.
- Enhanced the base scalar coefficient (x3.5) during FFT generation so that values pushed to Visualizers carry satisfying height out-of-the-box. - This effectively solves the issue where 200% Gain in the UI showed underwhelming graphics due to raw FFT values being exceptionally small prior to clipping.
- Shifted the gain representation so that the internal variable matches the user-facing UI value (100.0 instead of 60.0). - Users will now safely see 'Gain set to: 157.0' instead of arbitrary internal mathematical multipliers like '94.2' in the logs.
- Replaced get_color() with get_gradient_color() when passing a float value (0.2). - Prevented the 'TypeError: list indices must be integers or slices, not float' crash.
- Replaced basic jagged line-drawing with high-performance cubicTo Bezier curves for a liquid-smooth appearance. - Implemented soft-clipping ( p.tanh) to tame explosive volume drops instead of hard math cutoffs. - Added multi-layered glowing strokes (wide nebulous, middle intense, core laser) to generate a premium cinematic look.
- Changed an old, erroneous multiplier of 15000.0 to a sensible 2.0 on the raw �udio_buffer generation. - The massive 15000x multiplier was forcing all audio input straight to its limits (-1.0 or 1.0), artificially turning all audio samples into hard, unnatural square waves which ruined 'Waveform' and 'Oscilloscope' visualizations.
- Relaxed Math: Downscaled excessive p.power() bounds and hardcoded height multipliers inside SpectrumBars, CircularSpectrum, SoundWave2 and AudioLines. - Issue Fixed: Prevent visualizers from immediately clipping to the absolute screen border on low-gain setups, thus maintaining elegant breathing room for acoustic responses.
…ectre theme, and circular visualizer smoothing optimizations
…d new keyboard/mouse controls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
callback_time_mstelemetry to the audio pipeline by extendingaudio_data_readyto emit(waveform, fft_data, activity_level, callback_time_ms)and storinglast_callback_msinAudioProcessorwhile measuring callback duration withtime.perf_counter().except:clauses withexcept Exception:and aliasedtimetotime_moduleto avoid name collisions and make sleeps explicit (time_module.sleep).VisualizerWidgetsoQPixmap.scaled(...)runs only on image or size change, added_invalidate_background_cache()and updatedresizeEvent/set_background_imageto invalidate the cache.VisualizerWidget(last_frame_time_ms,last_audio_callback_ms) and passed them to the debug overlay, which now rendersFrame: X msandAudio CB: Y msand increases overlay background height for readability.Testing
python -m compileall srcto ensure the modified source compiles, and compilation completed successfully.compileallsucceeded with no syntax errors.Codex Task