From c229f3c6b5756d5cbbdad6049b4250ebea7aae7a Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 3 Mar 2026 08:38:23 +0100 Subject: fix(build): add spectool to DEMO_BUILD_TOOLS cmake target spectool was missing from DemoTools.cmake; scripts/gen_spectrograms.sh could not find build/spectool. Document the regeneration workflow in HOWTO.md. handoff(Claude): spectool now builds with -DDEMO_BUILD_TOOLS=ON --- cmake/DemoTools.cmake | 7 +++++++ doc/HOWTO.md | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/cmake/DemoTools.cmake b/cmake/DemoTools.cmake index ae39ec9..e83a384 100644 --- a/cmake/DemoTools.cmake +++ b/cmake/DemoTools.cmake @@ -28,6 +28,13 @@ else() set(TRACKER_COMPILER_DEPENDS tracker_compiler) endif() +# Spectool - audio spectrogram analyzer +if(DEMO_BUILD_TOOLS) + add_executable(spectool tools/spectool.cc ${PLATFORM_SOURCES}) + target_link_libraries(spectool PRIVATE audio util procedural ${DEMO_LIBS}) + target_include_directories(spectool PRIVATE third_party) +endif() + # Always build a host-native tracker_compiler for code generation purposes add_executable(tracker_compiler_host tools/tracker_compiler.cc) set_target_properties(tracker_compiler_host PROPERTIES diff --git a/doc/HOWTO.md b/doc/HOWTO.md index 097f2fa..768e51d 100644 --- a/doc/HOWTO.md +++ b/doc/HOWTO.md @@ -242,6 +242,21 @@ audio_shutdown(); See `doc/TRACKER.md` for music system. +### Regenerating .spec Files + +Converts `.wav`/`.aif` files from `tools/originals/` into `.spec` files in `workspaces/main/music/`. + +```bash +# Build spectool first (requires DEMO_BUILD_TOOLS=ON) +cmake -S . -B build -DDEMO_BUILD_TOOLS=ON +cmake --build build -j4 --target spectool + +# Generate all spectrograms +./scripts/gen_spectrograms.sh +``` + +Requires `ffmpeg` for `.aif` input files. Output uses v2 format (OLA, Hann, hop=256). + --- ## Assets -- cgit v1.2.3