Skip to content

Add configurable core audio effects and audition workflow - #11

Open
5o1 wants to merge 1 commit into
mainfrom
feat/1-core-effects
Open

Add configurable core audio effects and audition workflow#11
5o1 wants to merge 1 commit into
mainfrom
feat/1-core-effects

Conversation

@5o1

@5o1 5o1 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #1.

  • Add a backend-neutral core effect library with six presets: fade-in, fade-out, telephone degradation, monster pitch/bass, censor beep, and repeat/hold/dropout glitch with normal recovery.
  • Configure named presets and deterministic ordered chains through configs/effects.toml, with explicit validation and errors rather than silently dropping unsupported effects.
  • Apply effects after speech assembly and before delivery encoding in the main pipeline and character auditions. Keep effects on dialogue/render tasks, not character identity.
  • Support effect-only beep rendering without a TTS job, retain dry audition takes, and record resolved parameters, hashes, timings, implementations and limitations. Preserve consolidated effect provenance when disposable intermediates are removed.
  • Add the effects CLI, reusable audition fixture, documentation and README roadmap status. Delivery remains Opus inside RPA with existing virtual paths.

Validation

  • All 197 tests pass, including real FFmpeg/ffprobe tests, monster pitch and duration checks, deterministic glitch recovery, censor replacement, audition integration, retained provenance and Opus/RPA packing.
  • Command: PATH=/path/to/ffmpeg/bin:$PATH PYTHONPATH=src python -m unittest discover -s tests -t . -q in the project Conda environment.
  • Generated a dry comparison, six individual effects and an abstract-world effect chain locally under build/auditions/core-effects-v1/.
  • Reusable fixture: auditions/effects/project.toml. Reproduce using PYTHONPATH=src python -m lessons_in_cast_core.effects --config configs/effects.toml audition --input PATH_TO_DRY_WAV --run NEW_RUN_NAME.
  • No generated audio, reference assets, game data, model weights or private configuration are included in this PR.

Review notes

Listening acceptance is still pending. Glitch uses granular freezing rather than automatic phoneme alignment; choose a voiced fragment for a sustained-vowel impression. Monster tempo compensation is approximate, and telephone processing is stylized rather than an exact telecom codec. Censor intervals are time-based; raw build audio remains available, so this is not a secure-redaction feature.

The workspace allowlist now uses implemented effects instead of the former unimplemented chorus/distortion/echo/reverb placeholders. This change does not include the separate IndexTTS punctuation fix in PR #10.

Do not merge automatically. The repository's delete-branch-on-merge setting should remove this branch after the PR is reviewed and merged.

Copilot AI lite review requested due to automatic review settings September 8, 2026 09:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The audition renderer can hit a later KeyError if the planner returns an unexpected render-task count, and it should fail fast with a clear validation error at task collection time.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a backend-neutral “core effects” layer for post-synthesis audio processing (fade/telephone/monster/censor/glitch), makes effect chains configurable via TOML, integrates effect rendering into the main pipeline and audition workflow, and records effect provenance/audits alongside existing build artifacts.

Changes:

  • Add lessons_in_cast_core.effects (library + processor + CLI) with validated presets/chains and deterministic ordered rendering.
  • Integrate effect application/audit emission into WaveRenderer and Pipeline.synthesize, plus consolidated audio_effects.jsonl retention.
  • Update audition rendering to support “effect-only” cases and to preserve raw (dry) takes separately from effected outputs; update configs/docs/tests accordingly.
File summaries
File Description
tests/test_pipeline.py Extends end-to-end pipeline test to request an effect and verify audio_effects.jsonl retention across intermediate cleanup.
tests/test_emotion_preparation.py Ensures pipeline config loading works in tests by providing an effects configuration alongside custom emotions.
tests/test_effects.py Adds unit/integration coverage for core effects, config validation, determinism, and Opus/RPA delivery integration.
tests/test_audition.py Adds audition tests for post-profile effect application, raw take preservation, and effect-only (no TTS) behavior.
src/lessons_in_cast_core/workflow/artifacts.py Adds audio_effects artifact path and includes it in generated artifact reset.
src/lessons_in_cast_core/synthesis/audio.py Applies effects in WaveRenderer, maps EffectError to AudioRenderError, and writes/cleans .effects.json audits per output.
src/lessons_in_cast_core/pipeline.py Wires configured effect processor into the renderer, records effects config in the run manifest, and consolidates per-dialogue effect audits into audio_effects.jsonl.
src/lessons_in_cast_core/effects/processor.py Implements ordered, backend-independent effect execution and provenance reporting (core PCM + FFmpeg where needed).
src/lessons_in_cast_core/effects/pcm.py Introduces dependency-free PCM helpers (read/write, fades, edge-windowing).
src/lessons_in_cast_core/effects/cli.py Adds lessons-in-cast-effects CLI for listing, rendering, and audition comparisons.
src/lessons_in_cast_core/effects/catalog.py Adds validated effect specs, defaults, configurable presets, and deterministic chain expansion.
src/lessons_in_cast_core/effects/main.py Enables python -m lessons_in_cast_core.effects entrypoint.
src/lessons_in_cast_core/effects/init.py Exposes the public effects API surface.
src/lessons_in_cast_core/config.py Loads [effects] configuration into PipelineConfig with explicit validation/errors.
src/lessons_in_cast_core/audition/rendering.py Updates auditions to support effects, preserve raw takes, and include effects config in audition fingerprinting.
README.md Updates roadmap/status to reflect initial effects implementation and pending listening acceptance.
pyproject.toml Registers the new lessons-in-cast-effects console script entry point.
docs/effects.md Documents effect contract, configuration, limitations, CLI usage, and artifact/audit behavior.
configs/pipeline.toml Replaces placeholder effect allowlist with implemented effects and points to configs/effects.toml.
configs/effects.toml Adds default preset overrides and a sample chain (fractured_entity).
auditions/effects/project.toml Adds a reusable audition fixture for comparing preset/chain outputs against dry input.
Review details
  • Files reviewed: 21/21 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +114 to +115
if planned.render_tasks:
tasks[target_id] = planned.render_tasks[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a configurable effects-processing module

2 participants