summaryrefslogtreecommitdiff
path: root/internal/generator/theme_sounds.go
AgeCommit message (Collapse)Author
2026-04-27refactor(generator): move theme sound data from Go code to embedded JSON filesPaul Buetow
- Generate sounds.json for each theme inside templates/themes/<name>/ - Load sound data at runtime from embedded FS via templates.ThemeSounds() - Replace ~1100 lines of hardcoded builder functions and presets with a 145-line loader (soundCache, initSoundCache, loadThemeSounds) - Update embed.go to include themes/*/sounds.json in the embedded FS - Update tests to use loadThemeSounds() instead of themeSoundPresets - Eliminates duplication between themeSoundPresets and JSON output Improves cohesion and DRY by keeping theme assets (CSS, JS, meta, sounds) in a single location per theme directory.
2026-04-27Add context.Context to I/O-bound public APIs (generator.Run, processor.Run, ↵Paul Buetow
atom.Generate, syncOutput) - generator.Run(ctx, cfg) – ctx passed through to atom.Generate - processor.Run(ctx, cfg) – signature updated for cancellation propagation - atom.Generate(ctx, posts, cfg) – accepts ctx for future cancellation - syncOutput(ctx, cfg) – rsync subprocesses now use exec.CommandContext - Updated all call sites in tests, cmd/snonux/main.go, and integration tests - All call sites pass context.Background() / context.TODO() All tests pass: go test ./...
2026-04-27Add blank mode toggle (b key) and theme-hot-swap + Nukem sounds reworkPaul Buetow
- New blank mode hides all UI except the WebGL canvas; toggled via the ‘blank’ nav button or the b key. - Theme switching is now in-place (no page reload), avoiding the Web Audio context reset that used to kill ambient music. - Nukem ambient/riff rebuilt around the classic Grabbag riff (E5 E5 G5 A5 …).
2026-04-27Add nukem theme: action-hero hard rock with explosive WebGL effectsPaul Buetow
- New theme directory: templates/themes/nukem/ (meta.json, theme.css, theme.js) - Red/gold/black color palette with monospace typography - WebGL: rising sparks, falling debris, rubble blocks, explosion glow - Sound preset: 140 BPM E-minor power riffs with fanfare stabs (wild: 180 BPM thrash) - All nav/open/close/scroll/wild/page effects implemented Amp-Thread-ID: https://ampcode.com/threads/T-019dcd42-8558-748b-8c28-3f848400026d Co-authored-by: Amp <amp@ampcode.com>
2026-04-26audio: make ambient music hard, fast, and aggressivePaul Buetow
Complete rewrite of all 19 theme ambient presets to eliminate the slow waltz/lo-fi feel. Every preset now targets a driving rock/ industrial/hardstyle vibe with: - **Much faster BPM**: normal 120–180, wild 180–260 (was 60–70 / 120–140) - **Power chords** replace major/minor triads — aggressive distortion-ready - **Straight eighth-note drive** replaces swung waltz melodies — punchy, rhythmic, no floaty legato - **More active drum patterns**: double-kick, snare backbeats, sixteenth-note hats, clap stabs on the 16th - **Shorter attack / release** on normal (0.3→0.02, 0.5→0.15) so everything hits harder - **Higher filter cutoffs** for a brighter, more aggressive timbre - **Three drone voices** (was 4) with lower fundamental octave, fewer frequencies, more focused. Sub-bass added via buildRockSong octave divider. - **buildRockSong** replaces buildSong: adds sub-bass (/2 voice) and bass hits per measure, making each bar feel like a down-beat impact - **buildDriveMelody** replaces buildSwingMelody: straight eighth notes, no swing - **buildStabMelody** for wild mode: short 16th-note bursts with gaps Also bumped test BPM cap from 250→400 to accommodate the new range.
2026-04-26audio: make ambient music polyphonic with real songs, fix engine silencePaul Buetow
Rewrite all 19 theme ambient presets with chord progressions, bass drones, overlapping chord pads (dur > step on melodyNote), and swing melodies. Add per-theme 16-step drum patterns (kick, snare, hat, clap) synthesized in the Web Audio engine. Go (theme_sounds.go): - Add Step field to melodyNote for sequencer timing independent of duration - Add Drums []string field to ambientPreset for 16-step patterns - Add buildMeasure, buildSong, buildSwingMelody, and pat helpers - Rewrite every sounds*() func with I–IV–V–I progressions, bass, and melody JS (shared.js): - Fix startEngine() to await ctx.resume() before scheduling - Make masterGain a binary gate (fade to 1.0 in ~50 ms), not preset.gain - Fix startDrones() to scale by preset.gain instead of 1.0/numDrones - Add twin-oscillator detuned timbre in playMelodyNote() - Add synthesized drum engine: playDrum(), scheduleDrums(), stopDrums() - Keep splash sounds bypassing masterGain so they never get gated out
2026-04-26ambient: polyphonic songs, fix cascaded gain and resume bugsPaul Buetow
Rewrite all 19 theme melodies into proper ~10-16 second looping songs with bass drones, chord pads, and scalar melody lines using the new 'step' field for polyphonic overlap on a monophonic step sequencer. Fix four bugs that caused total silence: 1. masterGain was faded to preset.gain while each note was ALSO scaled by preset.gain*0.6, squaring volume to ~-68 dB. 2. fadeMasterTo ramped the gate for 0.5-1.5s, swallowing first notes. 3. startDrones set per-osc gain to 1.0/numDrones, clipping and burying the melody. 4. AudioContext resume was not awaited; notes fired into a suspended context and were lost. Shared.js: - startEngine() waits for ctx.resume() before scheduling anything. - masterGain acts as a binary gate (fades to 1.0 over 50ms). - playMelodyNote uses twin detuned oscillators for richer timbre. - startDrones scales by preset.gain so drones match melody level. Theme_sounds.go: - Add 'step' field to melodyNote struct. - Add chord-building helpers (major/minor triads). - Add buildSong() / buildMeasure() for structured 4-bar loops. - All 19 themes: audible bass (130-220Hz), chord pads (260-520Hz), melodies (330-1046Hz), real chord progressions, proper BPM.
2026-04-26Add unique ambient melodies for all 19 themesPaul Buetow
Each theme now has a distinctive looping melodic phrase (normal + wild variants) played by the Web Audio ambient engine. This replaces the generic random-pulse behavior that made all themes sound the same. Go changes: - Add melodyNote struct with freq/dur/gain fields to ambientPreset - Add n() helper for concise melody construction - Rewrite all 19 theme presets with unique melodic phrases: neon=glassy arpeggio, terminal=sparse CRT beeps, synthwave=warm minor, plasma=tritone shimmer, brutalist=concrete rumble, volcano=phrygian, aurora=high shimmer, matrix=digital ostinato, ocean=wave flow, dos=8-bit arpeggio, retro=VHS warmth, cosmos=vast fifths, retrofuture=lounge minor-7, spaceage=pure ascending, tropicale=pentatonic, noir=smoky minor-7, cathedral=organ thirds, surveillance=fourth alert, biomech=diminished unease JS changes: - Add melodyTimer/melodyIndex state to ambient engine - Add playMelodyNote() with per-note gain and filter support - Add scheduleMelodyNote() with phrase-rest gaps - schedulePulse() now routes to melody player when melody is present - Add sawtooth support to snonuxWaveType() - Reset melody index on startEngine() and stopAll() Test changes: - TestThemeSoundPresetsAmbientPopulated now accepts melody as valid content - TestThemeSoundPresetsAmbientValuesBounded validates melody note freq/dur
2026-04-25Refine normal and wild ambient presets for all 19 themesPaul Buetow
Replace generic ambient() helper calls with detailed ambientPreset literals for every registered theme. Normal presets are now subtle (gain 0.02-0.03), loopable, and low-fatigue. Wild presets are recognizably the same theme but faster, denser, and more dramatic (gain 0.05-0.065). Theme-specific changes: - neon: glass drone with filter sweep; wild adds brighter arps - terminal: CRT hum + sparse ticks; wild becomes rapid process storm - synthwave: warm minor pad; wild doubles pulse with octave jumps - plasma: tritone shimmer; wild adds aggressive sweep and noise - brutalist: concrete rumble; wild adds blunt sub impacts with rhythm - volcano: magma drone; wild adds tremor pulses and heat noise - aurora: airy fifths; wild adds solar-storm detune shimmer - matrix: digital rain ostinato; wild speeds code-rain pulses - ocean: tidal swell + surf noise; wild adds storm surge - dos: PC speaker hum; wild becomes IRQ panic at 200 BPM - retro: amber chip tones; wild adds tape-eat jitter and noise - cosmos: wide fifth/octave drone; wild adds supernova pulse - retrofuture: atomic lounge pad; wild adds Geiger-like rhythm - spaceage: theremin sines; wild adds re-entry alarm pings - tropicale: dusk pentatonic surf; wild adds category-5 percussion - noir: smoky minor drone; wild adds siren-like intervals - cathedral: organ stacked sines; wild adds bell/requiem intensity - surveillance: monitor hum/scanner; wild adds alert cascade - biomech: organic asymmetric drone; wild adds nervous wet pulses All generator tests pass.
2026-04-25Add ambient preset schema to theme soundsPaul Buetow
Extend themeSounds with Ambient field containing Normal and Wild variants. Each ambientPreset carries numeric/string fields for generative background audio: bpm, pulseInterval, gain, wave, droneFreqs, pulseFreqs, cutoffMin/cutoffMax, noiseGain, attack, release, detuneCents, and rhythm. Populate all 19 existing themes with normal and wild ambient presets using a concise ambient() helper. Existing splash/nav/open/close/bounce fields remain unchanged for backwards compatibility. Add TestThemeSoundsJSON_ambientSchema to verify every theme emits valid JSON containing both ambient variants alongside the legacy sound fields.
2026-04-22v0.6.0: bounce effect on page boundary + wild bouncev0.6.0Paul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019db698-f351-7161-a397-1cce1fdab440 Co-authored-by: Amp <amp@ampcode.com>
2026-04-20new themePaul Buetow
2026-04-18fix(generator): match markdown typography between list and zoomed-in modal viewsPaul Buetow
The zoomed-in post modal (opened with Enter/click) used #modal-content to display post HTML, but the CSS typography rules (.post-text p/ul/ol/li margin and padding) only targeted the .post-text class used in the list view. This caused visually different formatting — missing paragraph spacing and unindented lists — in the expanded modal compared to the feed. Fix: extend all .post-text typography selectors in nav.tmpl to also cover #modal-content, so both views apply identical spacing rules. Also adds a missing spaceage theme sound preset to satisfy the TestThemeSoundPresetsMatchRegistry test that was already failing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18Add retrofuture themev0.4.0Paul Buetow
2026-04-16v0.3.0: add DOS theme with VT323 webfontv0.3.0Paul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019d94cc-99a9-74af-8f3d-9521cd73324f Co-authored-by: Amp <amp@ampcode.com>
2026-04-10Release v0.1.1v0.1.1Paul Buetow
Per-theme Web Audio presets; pagination footer bar with reduced height; brutalist splash label tweak; doc updates. Made-with: Cursor