summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.geminiignore2
-rw-r--r--ASSET_SYSTEM.md2
-rw-r--r--CMakeLists.txt2
-rw-r--r--PROJECT_CONTEXT.md2
-rw-r--r--SESSION_NOTES.md2
-rwxr-xr-xscripts/crunch_demo.sh6
-rw-r--r--src/gpu/gpu.cc32
-rw-r--r--tools/editor/index.html2
8 files changed, 25 insertions, 25 deletions
diff --git a/.geminiignore b/.geminiignore
index 57c68ff..3d5a9ad 100644
--- a/.geminiignore
+++ b/.geminiignore
@@ -12,7 +12,7 @@ third_party/**/target/
# --- Generated Assets & Data ---
# Assets themselves (like .spec files) are part of the system, so they are NOT ignored here.
-# However, if any temporary generated files were created outside the standard asset pipeline,
+# However, if any temporary generated files were created outside the standard asset pipeline,
# they could be listed here. For now, we assume standard assets are handled by the pipeline.
# --- Distribution / Archives ---
diff --git a/ASSET_SYSTEM.md b/ASSET_SYSTEM.md
index 843d8f2..250be07 100644
--- a/ASSET_SYSTEM.md
+++ b/ASSET_SYSTEM.md
@@ -32,7 +32,7 @@ This instructs the final assembled file assets.h to have a code line:
(or an enum instead of #define's)
-so that we can call
+so that we can call
```
#include "asset.h"
const uint8_t* mysample = GetAsset(ASSET_SAMPLE_142);
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f42c47..410ebc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ set(DEMO_LIBS glfw ${WGPU_LIBRARY})
# Platform-specific dependencies
if (APPLE)
set_source_files_properties(
- src/platform.cc
+ src/platform.cc
third_party/glfw3webgpu/glfw3webgpu.c
PROPERTIES COMPILE_FLAGS "-x objective-c++"
)
diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md
index 9258e1e..650189a 100644
--- a/PROJECT_CONTEXT.md
+++ b/PROJECT_CONTEXT.md
@@ -48,7 +48,7 @@ Incoming tasks in no particular order:
### Build System:
- **Production Pipeline**: Automated the entire assembly process via a `final` CMake target (`make final`).
- **Automation**: This target builds the tools, runs the `gen_assets.sh` script to re-analyze audio and regenerate sources, and then performs final binary stripping and crunching (using `strip` and `gzexe` on macOS).
-- **Scripts**:
+- **Scripts**:
- `scripts/gen_assets.sh`: Re-analyzes source audio files into `.spec` format and triggers the `asset_packer`.
- `scripts/crunch_demo.sh`: Performs the final size optimization and compression.
diff --git a/SESSION_NOTES.md b/SESSION_NOTES.md
index 76aa782..5ba42f7 100644
--- a/SESSION_NOTES.md
+++ b/SESSION_NOTES.md
@@ -5484,7 +5484,7 @@ This instructs the final assembled file assets.h to have a code line:
(or an enum instead of #define's)
-so that we can call
+so that we can call
```
#include "asset.h"
const uint8_t* mysample = GetAsset(ASSET_SAMPLE_142);
diff --git a/scripts/crunch_demo.sh b/scripts/crunch_demo.sh
index d9c77a4..8584209 100755
--- a/scripts/crunch_demo.sh
+++ b/scripts/crunch_demo.sh
@@ -13,13 +13,13 @@ OS_NAME=$(uname -s)
if [ "$OS_NAME" = "Darwin" ]; then
echo "macOS detected. Using 'strip' and 'gzexe' (UPX is unreliable on macOS)."
-
+
# Copy original to output to work on it
cp "$SRC_BIN" "$OUT_BIN"
-
+
echo "Stripping symbols..."
strip -u -r "$OUT_BIN"
-
+
if command -v gzexe >/dev/null 2>&1; then
echo "Compressing with gzexe..."
gzexe "$OUT_BIN"
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index ec9922a..27c0772 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -286,7 +286,7 @@ struct Uniforms {
fn vs_main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4<f32> {
let PI = 3.14159265;
let num_sides = 7.0;
-
+
// Pulse scale based on audio peak
let base_scale = 0.5;
let pulse_scale = 0.3 * uniforms.audio_peak;
@@ -298,14 +298,14 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4<
if (sub_idx == 0u) {
return vec4<f32>(0.0, 0.0, 0.0, 1.0);
}
-
+
// Apply rotation based on time
let rotation = uniforms.time * 0.5;
let i = tri_idx + f32(sub_idx - 1u);
let angle = i * 2.0 * PI / num_sides + rotation;
let x = scale * cos(angle) / uniforms.aspect_ratio;
let y = scale * sin(angle);
-
+
return vec4<f32>(x, y, 0.0, 1.0);
}
@@ -316,7 +316,7 @@ fn fs_main() -> @location(0) vec4<f32> {
let r = sin(h + 0.0) * 0.5 + 0.5;
let g = sin(h + 2.0) * 0.9 + 0.3;
let b = sin(h + 4.0) * 0.5 + 0.5;
-
+
let boost = uniforms.audio_peak * 0.5;
return vec4<f32>(r + boost, g + boost, b + boost, 0.5); // Alpha 0.5 for blending
}
@@ -347,26 +347,26 @@ fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
}
var p = particles[index];
-
+
// Update Position
p.pos.x = p.pos.x + p.vel.x * 0.016;
p.pos.y = p.pos.y + p.vel.y * 0.016;
p.pos.z = p.pos.z + p.vel.z * 0.016;
-
+
// Gravity / Audio attraction
p.vel.y = p.vel.y - 0.01 * (1.0 + uniforms.audio_peak * 5.0);
-
+
// Rotate
p.rot.x = p.rot.x + p.rot.y * 0.016;
-
+
// Reset if out of bounds
if (p.pos.y < -1.5) {
p.pos.y = 1.5;
- p.pos.x = (f32(index % 100u) / 50.0) - 1.0 + (uniforms.audio_peak * 0.5);
+ p.pos.x = (f32(index % 100u) / 50.0) - 1.0 + (uniforms.audio_peak * 0.5);
p.vel.y = 0.0;
p.vel.x = (f32(index % 10u) - 5.0) * 0.1;
}
-
+
particles[index] = p;
}
)";
@@ -396,10 +396,10 @@ struct VertexOutput {
@vertex
fn vs_main(@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) instance_index : u32) -> VertexOutput {
let p = particles[instance_index];
-
+
// Simple quad expansion
let size = 0.02 + p.pos.z * 0.01 + uniforms.audio_peak * 0.02;
-
+
// Vertex ID 0..5 for 2 triangles (Quad)
// 0 1 2, 2 1 3 (Strip-like order manually mapped)
var offsets = array<vec2<f32>, 6>(
@@ -410,18 +410,18 @@ fn vs_main(@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) i
vec2<f32>( 1.0, -1.0),
vec2<f32>( 1.0, 1.0)
);
-
+
let offset = offsets[vertex_index];
-
+
// Rotate
let c = cos(p.rot.x);
let s = sin(p.rot.x);
let rot_x = offset.x * c - offset.y * s;
let rot_y = offset.x * s + offset.y * c;
-
+
let x = p.pos.x + rot_x * size / uniforms.aspect_ratio;
let y = p.pos.y + rot_y * size;
-
+
var output : VertexOutput;
output.Position = vec4<f32>(x, y, 0.0, 1.0);
output.Color = p.color * (0.5 + 0.5 * uniforms.audio_peak);
diff --git a/tools/editor/index.html b/tools/editor/index.html
index 7c977e3..82a11ce 100644
--- a/tools/editor/index.html
+++ b/tools/editor/index.html
@@ -8,7 +8,7 @@
</head>
<body>
<h1>Spectrogram Editor</h1>
-
+
<input type="file" id="specFileInput" accept=".spec">
<label for="specFileInput">Load SPEC File</label>