peaks: pure per-channel min/max envelope from interleaved PCM

New STATIC lib + peaks_tests (CTest), mirroring bank_model. Float samples,
per-channel (no fold); exact integer bin spans handle remainder, short
buffers, and degenerate inputs with no OOB. Bin-span math guarded against
size_t overflow for pathological binCount.
This commit is contained in:
2026-07-22 09:23:03 -04:00
parent 57a137199e
commit 4cb40f6e34
4 changed files with 438 additions and 2 deletions
+13 -2
View File
@@ -22,15 +22,26 @@ add_library(bank_model STATIC src/bank_model.cpp)
target_include_directories(bank_model PUBLIC src)
# ---------------------------------------------------------------------------
# 2) Standalone tests for the model (run without launching REAPER).
# 2) Pure peaks library — NO REAPER, NO SWELL. Waveform min/max thumbnails from
# raw PCM (Milestone 2). A sibling pure lib, kept distinct from bank_model.
# ---------------------------------------------------------------------------
add_library(peaks STATIC src/peaks.cpp)
target_include_directories(peaks PUBLIC src)
# ---------------------------------------------------------------------------
# 3) Standalone tests for the pure modules (run without launching REAPER).
# ---------------------------------------------------------------------------
enable_testing()
add_executable(bank_model_tests tests/test_bank_model.cpp)
target_link_libraries(bank_model_tests PRIVATE bank_model)
add_test(NAME bank_model_tests COMMAND bank_model_tests)
add_executable(peaks_tests tests/test_peaks.cpp)
target_link_libraries(peaks_tests PRIVATE peaks)
add_test(NAME peaks_tests COMMAND peaks_tests)
# ---------------------------------------------------------------------------
# 3) The REAPER extension — a loadable module (dlopen'd by REAPER, not linked).
# 4) The REAPER extension — a loadable module (dlopen'd by REAPER, not linked).
# ---------------------------------------------------------------------------
add_library(reaper_reasampler MODULE
src/main.cpp