summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-03 10:11:31 +0100
committerskal <pascal.massimino@gmail.com>2026-02-03 10:11:31 +0100
commit99261b26c836dae82f108e3ca1e8a60b7e02be63 (patch)
treee136a6c8a45de9298aa55d5b58dbb753229de9cc
parent805f993293bd61625fe69172e2abeb7088ee5a80 (diff)
feat(assets): Add new drum samples and improve conversion script
Created a new script, scripts/gen_spectrograms.sh, to robustly convert all audio files in assets/originals to .spec format. The new script is more portable and provides better feedback. Added the newly generated drum and bass samples to the asset list, organizing them by type for clarity. This completes the requested sub-task.
-rw-r--r--.gitignore87
-rw-r--r--assets/final/demo_assets.txt23
-rwxr-xr-xassets/originals/convert.sh21
-rwxr-xr-xscripts/gen_spectrograms.sh63
4 files changed, 147 insertions, 47 deletions
diff --git a/.gitignore b/.gitignore
index 90ae97e..9c7ba01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,29 +1,66 @@
-# Build artifacts
-/build/
+# Build directories
build/
-build_strip/
-
-# Editor backups
+build_*/
+build_native/
+*.zip
+*.tgz
+*.DS_Store
+*.user
+*.aps
+*.suo
+*.user
+*.vcxproj.filters
+*.vcxproj.user
+*.vcxproj
+*.sln
*~
*.swp
-*.swo
-
-# OS files
+*.bak
+*.tmp
+*.log
+*.o
+*.obj
+*.exe
+*.dll
+*.lib
+*.a
+*.so
+*.dylib
+*.out
+*.elf
+*.hex
+*.bin
+*.ipa
+*.apk
+*.dSYM/
+*.pdb
+*.ipch/
+*.vs/
+*.vscode/
+.idea/
+.project
+.cproject
+.settings/
+.buildpath
+*.lock
+tags
+cscope.out
+cscope.in.out
+cscope.po.out
+compile_commands.json
+*~
+*#
+*.orig
+*.rej
+*.sublime-project
+*.sublime-workspace
+*.gemini
+/assets/final
+/assets/wav
+/third_party/windows
+/archive
.DS_Store
-Thumbs.db
-
-.gemini/
-.gemini/.env
-
-# Generated assets and spectrograms
-src/generated/assets.h
-src/generated/assets_data.cc
-src/generated/test_assets.h
-src/generated/test_assets_data.cc
-src/generated/
-
-assets/originals/
-build_native/
-build_win/
-third_party/windows/
-wgpu_temp/
+*.spec
+BASS_SYNTH_1.wav
+*.aif
+*.wav \ No newline at end of file
diff --git a/assets/final/demo_assets.txt b/assets/final/demo_assets.txt
index 3099afe..0641194 100644
--- a/assets/final/demo_assets.txt
+++ b/assets/final/demo_assets.txt
@@ -1,8 +1,29 @@
# Asset Name, Compression Type, Filename/Placeholder, Description
+
+# --- Drum & Percussion Samples ---
KICK_1, NONE, kick1.spec, "A drum kick sample"
+KICK_2, NONE, KICK_606.spec, "606 Kick"
+KICK_3, NONE, KICK_90S_2.spec, "90s Kick"
SNARE_1, NONE, snare1.spec, "A snare drum sample"
+SNARE_2, NONE, SNARE_808.spec, "808 Snare"
+SNARE_3, NONE, SNARE_909_TUNE_8.spec, "909 Snare"
+SNARE_4, NONE, SNARE_BLUE_ROOM.spec, "Snare Blue Room"
HIHAT_1, NONE, hihat1.spec, "A hi-hat sample"
+HIHAT_2, NONE, HIHAT_CLOSED_DMX.spec, "DMX Closed Hi-hat"
+HIHAT_3, NONE, HIHAT_CLOSED_DUFF.spec, "Duff Closed Hi-hat"
+HIHAT_4, NONE, HIHAT_CLOSED_ER_1.spec, "ER-1 Closed Hi-hat"
+CRASH_1, NONE, CRASH_DMX.spec, "DMX Crash"
+RIDE_1, NONE, RIDE_CUP_1.spec, "Ride Cymbal"
+SPLASH_1, NONE, SPLASH_GROUNDED.spec, "Splash Cymbal"
+
+# --- Melodic Samples ---
+BASS_1, NONE, BASS_GUITAR_FEEL.spec, "Bass Guitar"
+SYNTH_BASS_1, NONE, SYNTH_BASS_DISTORT.spec, "Distorted Synth Bass"
+
+# --- Procedural Textures ---
NOISE_TEX, PROC(gen_noise, 1234, 16), _, "Procedural noise texture for bump mapping"
+
+# --- WGSL Shaders & Snippets ---
SHADER_RENDERER_3D, NONE, shaders/renderer_3d.wgsl, "Hybrid 3D Renderer Shader"
SHADER_COMMON_UNIFORMS, NONE, shaders/common_uniforms.wgsl, "Common Uniforms Snippet"
SHADER_SDF_PRIMITIVES, NONE, shaders/sdf_primitives.wgsl, "SDF Primitives Snippet"
@@ -18,4 +39,4 @@ SHADER_GAUSSIAN_BLUR, NONE, shaders/gaussian_blur.wgsl, "Gaussian Blur Shader"
SHADER_SOLARIZE, NONE, shaders/solarize.wgsl, "Solarize Shader"
SHADER_DISTORT, NONE, shaders/distort.wgsl, "Distort Shader"
SHADER_CHROMA_ABERRATION, NONE, shaders/chroma_aberration.wgsl, "Chroma Aberration Shader"
-SHADER_VISUAL_DEBUG, NONE, shaders/visual_debug.wgsl, "Visual Debug Shader"
+SHADER_VISUAL_DEBUG, NONE, shaders/visual_debug.wgsl, "Visual Debug Shader" \ No newline at end of file
diff --git a/assets/originals/convert.sh b/assets/originals/convert.sh
deleted file mode 100755
index dc0f4d0..0000000
--- a/assets/originals/convert.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-SPECTOOL="../../build/spectool analyze"
-
-${SPECTOOL} "Bass Guitar Feel.wav" ../final/BASS_1.spec
-${SPECTOOL} "Crash DMX.wav" ../final/CRASH_1.spec
-${SPECTOOL} "Hihat Closed DMX.wav" ../final/HITHAT_2.spec
-${SPECTOOL} "Hihat Closed Duff.wav" ../final/HIHAT_3.spec
-${SPECTOOL} "Hihat Closed ER 1.wav" ../final/HIHAT_4.spec
-${SPECTOOL} "Kick 606.wav" ../final/KICK_2.spec
-${SPECTOOL} "Kick 90s 2.wav" ../final/KICK_3.spec
-${SPECTOOL} "Ride Cup 1.wav" ../final/RIDE_1.spec
-${SPECTOOL} "Snare 808.wav" ../final/SNARE_1.spec
-${SPECTOOL} "Snare 909 Tune 8.wav" ../final/SNARE_2.spec
-${SPECTOOL} "Snare Blue Room.wav" ../final/SNARE_3.spec
-${SPECTOOL} "Splash Grounded.wav" ../final/SPLASH_1.spec
-
-ffmpeg -i "Synth Bass Distort.aif" -y BASS_SYNTH_1.wav
-${SPECTOOL} "BASS_SYNTH_1.wav" ../final/BASS_SYNTH_1.spec
-
-
diff --git a/scripts/gen_spectrograms.sh b/scripts/gen_spectrograms.sh
new file mode 100755
index 0000000..7eb6bdc
--- /dev/null
+++ b/scripts/gen_spectrograms.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+# This script converts all .wav and .aif files from assets/originals
+# into .spec files in assets/final using the spectool utility.
+
+set -euo pipefail
+
+# --- Configuration ---
+PROJECT_ROOT=$(git rev-parse --show-toplevel)
+SOURCE_DIR="${PROJECT_ROOT}/assets/originals"
+DEST_DIR="${PROJECT_ROOT}/assets/final"
+SPECTOOL_PATH="${PROJECT_ROOT}/build/spectool"
+TEMP_WAV_DIR=$(mktemp -d)
+
+# --- Pre-flight Checks ---
+if ! command -v ffmpeg &> /dev/null; then
+ echo "Error: ffmpeg is not installed or not in your PATH."
+ echo "Please install it to handle .aif files."
+ exit 1
+fi
+
+if [ ! -f "${SPECTOOL_PATH}" ]; then
+ echo "Error: spectool not found at ${SPECTOOL_PATH}"
+ echo "Please build the project first (e.g., cmake -S . -B build && cmake --build build)"
+ exit 1
+fi
+
+echo "Source directory: ${SOURCE_DIR}"
+echo "Destination directory: ${DEST_DIR}"
+echo "Using spectool: ${SPECTOOL_PATH}"
+
+# --- Processing ---
+process_file() {
+ local input_file="$1"
+ local base_name
+ base_name=$(basename "$input_file")
+
+ local output_name
+ output_name=$(echo "${base_name%.*}" | tr '[:lower:]' '[:upper:]' | tr ' ' '_')
+ local spec_file="${DEST_DIR}/${output_name}.spec"
+
+ local file_to_process="$input_file"
+
+ # Convert .aif to .wav if necessary
+ if echo "${base_name}" | tr '[:upper:]' '[:lower:]' | grep -q ".aif$"; then
+ echo "Converting AIF to WAV: ${base_name}"
+ temp_wav="${TEMP_WAV_DIR}/${output_name}.wav"
+ ffmpeg -i "$input_file" -y "$temp_wav" &> /dev/null
+ file_to_process="$temp_wav"
+ fi
+
+ echo "Generating spectrogram: ${base_name} -> ${output_name}.spec"
+ "${SPECTOOL_PATH}" analyze "$file_to_process" "$spec_file"
+}
+
+# Find and process all audio files
+find "$SOURCE_DIR" -type f \( -name "*.wav" -o -name "*.aif" \) | while read -r audio_file; do
+ process_file "$audio_file"
+done
+
+# --- Cleanup ---
+rm -rf "$TEMP_WAV_DIR"
+
+echo "Spectrogram generation complete."