22 Commits

Author SHA1 Message Date
0483e0334d Fix includes and some comments 2025-12-10 21:55:34 +01:00
c5ecad05db Format cleanup 2024-02-06 07:58:32 -06:00
0ea5bba3d7 WaveformAligner test fixes 2024-02-06 07:58:32 -06:00
305f78f177 Split WaveformAligner up into multiple testable methods 2024-02-06 07:58:32 -06:00
bd592bdb2e Rename WaveformAligner variables to be clearer, add comments 2024-02-06 07:58:32 -06:00
7c425f7469 WaveformAligner type refactor 2024-02-06 07:58:32 -06:00
a1d300f48c Include cleanup, plus a few small code improvements.
Also removed empty FrameAudioData implementation file.
2024-02-02 15:08:05 +01:00
7e45cbe1f9 Clean up minor warnings and code style
* Remove warnings for code in vendor folders
* Add pedantic and extra warnings in GCC only to projectM sources
* Rename ResetOpenGL to SetWindowSize
2024-02-01 11:27:10 -06:00
fbb74ccd0b Fix a buffer overrun in PCM::GetFrameAudioData().
This did not have any real impact, as the excess bytes were written into the next buffer, which was then immediately "fixed up" during the following copy call with the correct data, but could cause a crash and other nasty things if someone would reorder the class members or insert something in between.
2024-01-30 10:54:16 +01:00
39605b645a Fixed a few compiler warnings. 2023-12-30 14:56:35 +01:00
9c68339d1d Fixed some Doxygen comments in the audio headers. 2023-11-24 23:51:10 +01:00
cf7d08c2ff Consolidate how update methods are called.
Directly passing references to the affected members is easier to read in the main UpdateFrameAudioData() method.
2023-11-24 21:00:40 +01:00
f7f7f96638 Fix upper bound of frequency band calculation.
The "+1" somehow disappeared at some point...
2023-11-24 21:00:40 +01:00
36fb09ce30 Implemented waveform alignment algorithm.
Also consolidated the waveform sample count constant to keep it aligned over all classes.
2023-11-24 21:00:40 +01:00
69d2134fa2 Rewrite of audio data processing/beat detection.
Consolidated audio processing code into the PCM class, removing the BeatDetect class in the process. Beat detection now uses the same algorithm as Milkdrop, passing the proper relative bass/mid/treb values to presets. Makes many presets look less jumpy/flickering, as the values are now (smoothly) alternating around 1.0.

Updating frame audio is now done in a function that must specifically be called. Any subsequent calls to GetFrameAudioData() will then return the exact same copy of the audio data. As of now with the exception that new waveform data may be passed in via a separate thread, which will then be returned and might not match the spectrum data. Will fix that in a later commit.
2023-11-24 21:00:39 +01:00
045b05fa95 Replaced FFT implementation.
Removed the previous FFT algorithm, now using a modernized version of the original Milkdrop FFT transform which also has both an equalizer and frequency envelope, making it slightly more sophisticated.

Modernization mainly included replacing raw pointer arrays with std::vector and using STL types/functions for the calculation, specifically std::complex as the FFT heavily uses these numbers. This makes the code more compact and readable.

Manually tested both original and modernized versions of the class to test if the algorithm still returns the exact same results, which is the case.
2023-11-24 21:00:35 +01:00
e9438ee0f6 Deleted lots of unused files and code. 2023-09-11 10:19:48 +02:00
feb7a3330a A few Windows build fixes 2023-09-11 10:19:48 +02:00
df7cd08bdc Fill both spectrum channels with data. 2023-09-11 10:19:47 +02:00
e603793402 Finished per-pixel mesh, started rework of warp/comp shaders and textures.
Moved per-pixel mesh texture coordinate calculations into the vertex shader. This is probably more performant than the SSE2 code in the old PresetFrameIO class, as the GPU is better at running this stuff in parallel.

All the texture management also needs some refactoring, so now that I've already broken everything, I can just do it as well.
2023-09-11 10:19:47 +02:00
e73b0f3092 Working on getting stuff being rendered again, focus on default waveform.
Fixed many typos, errors and crashes on the way.
2023-09-11 10:19:47 +02:00
b9ef6a3974 Remove old expression parser and add the new projectm-eval lib.
Requires a general rewrite of the Milkdrop preset code. Previous implementation was tightly integrated into the code parser, so reusing this code wasn't possible. Additional refactoring was done, finished converting custom wave/shape implementations to use the new expression parser code.
2023-09-11 10:19:45 +02:00