dev-audio-lesson
Add an audio lesson — sound playback, mixing, spatial audio, DSP effects, with SDL GPU scenes and forge UI
от Nebulavenus★ 51 звезда на GitHub
Установить dev-audio-lesson в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Every audio lesson produces two things: library code and a demo
program. The library — common/audio/forge_audio.h — is the primary
deliverable. The lessons teach concepts; the library is what remains when the
learning is done. It must be correct, efficient, tested, and safe. The demo
program visualizes and controls the audio in action, rendered with SDL GPU
and controlled through forge UI panels.
When to use this skill:
- You need to teach audio playback, mixing, spatial sound, or DSP effects
- A learner wants to understand PCM audio, streaming, attenuation, or filters
- The concept benefits from a visual 3D scene showing audio source positions
- New functionality needs to be added to
common/audio/forge_audio.h
Smart behavior:
- Before creating a lesson, check if an existing audio lesson already covers it
- Library first, demo second. Design, implement, document, and test the library code before writing a single line of the demo program. The demo exercises the library — it does not replace it.
- Audio lessons are interactive — every concept must be audible in the running program and controllable via forge UI
- Focus on why the technique works, not just the code — connect DSP math to what the listener hears
- Use simple geometric shapes for sound source visualization — the audio is the focus
- All scene geometry comes from
common/shapes/forge_shapes.h— never write inline geometry generation functions - Cross-reference math lessons (vectors, dot products) and GPU lessons where relevant
Arguments
The user (or you) can provide:
- Number: two-digit lesson number (e.g. 01, 02)
- Topic name: kebab-case (e.g. audio-basics, sound-effects)
- Description: what this teaches (e.g. "PCM fundamentals, WAV loading, SDL audio streams")
If any are missing, infer from context or ask.
Steps
1. Analyze what's needed
- Check existing audio lessons: Is there already a lesson for this topic?
- Check
common/audio/: Does relevant library code already exist? - Check
common/ui/: Does the UI library provide the widgets needed for audio controls? If a required widget is missing, note it. - Identify the scope: What specific audio concepts does this lesson cover?
- Find cross-references: Which math/GPU/UI lessons relate?
- Check PLAN.md: Where does this lesson fit in the audio track?
2. Create the lesson directory
lessons/audio/NN-topic-name/
With subdirectories:
lessons/audio/NN-topic-name/
main.c
CMakeLists.txt
README.md
audio.conf (gitignored — local path to audio files)
assets/
screenshot.png (lesson screenshot — checked in)
Baseline rendering shaders (shadow, scene, grid, sky, UI) are provided by
forge_scene.h — no per-lesson copies needed. If the lesson introduces a
topic-specific shader (e.g. a waveform visualization pass), add a shaders/
subdirectory for those files only.
3. Design and implement the audio library code
Every audio lesson adds to common/audio/forge_audio.h. This is not
optional — it is the primary deliverable. The demo program exists to exercise
and visualize the library; the library is what ships.
For the first audio lesson, create the file. For subsequent lessons, extend it. Design the API before writing the demo. The demo calls the library — never the reverse.
Library standards
Correctness:
- Every function must implement a named, well-understood technique. Cite the source in the doc comment — a textbook, paper, or DSP reference.
- Audio processing must not introduce clicks, pops, or DC offset. Transitions (volume changes, crossfades) must be smooth.
- Sample rate conversion and channel mapping must be handled correctly via SDL audio stream properties.
- Buffer sizes and sample counts must be computed correctly — off-by-one errors in audio produce audible artifacts.
Thread safety:
- SDL audio streams deliver data on a separate audio thread. Any shared state between the main thread and audio processing must use SDL atomics or SDL mutexes.
- Volume, panning, and effect parameters should be set atomically so partial updates don't produce glitches.
- Resource lifetimes must be clear — never free audio data while a stream might still reference it.
Performance:
- Audio processing runs in real time — dropped samples cause audible glitches. Keep per-sample operations simple (multiply, add, table lookup).
- Precompute coefficients (filter taps, attenuation curves, panning tables) at init time or when parameters change, not per-sample.
- Use
floatfor all audio processing. Convert to/from integer formats only at the SDL boundary.
Numerical safety:
- Clamp output samples to
[-1.0f, 1.0f]before delivery to prevent clipping distortion beyond what the user intends. - Guard against division by zero in attenuation calculations (zero distance).
- Filter coefficients must be validated to prevent instabil
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл dev-audio-lesson?
Add an audio lesson — sound playback, mixing, spatial audio, DSP effects, with SDL GPU scenes and forge UI
Как установить скилл dev-audio-lesson?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dev-audio-lesson запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…