Skip to content

Feature/effects#61

Open
IfkumRfnl wants to merge 2 commits into
orhun:mainfrom
IfkumRfnl:feature/effects-echo
Open

Feature/effects#61
IfkumRfnl wants to merge 2 commits into
orhun:mainfrom
IfkumRfnl:feature/effects-echo

Conversation

@IfkumRfnl
Copy link
Copy Markdown

Description

This PR adds an audio effects pipeline and an initial echo effect exposed through the cli.

Main changes:

  • Add audio.Info for stream metadata and normalized sample validation.
  • Add fx.Effect, fx.Chain, fx.Content interfaces, and fx.Echo.
  • Add cli_effects.Effects to translate parsed CLI flags into fx.Chain.
  • Add Generator.generateSamples() to produce normalized f32 PCM samples.
  • Add wav.encodePcmF32() to encode normalized PCM into the selected WAV format.
  • Add CLI echo options:
    • --echo
    • --echo-delay <MS>
    • --echo-feedback <MIX>
    • --echo-mix <MIX>
  • Update README and man page documentation for the new echo options.

Internally this changes generation pipeline to operate on normalized f32 PCM samples before encoding into wav. This is done so that effect layer can be independent of the final output format, so effects can work the same way whether the user chooses U8, S16_LE, S24_LE, or S32_LE.

Motivation and Context

Partially addresses #13. This introduces a reusable path for applying audio effects after music generation and before WAV encoding.

Echo is included as first example effect using this pipeline. More effects can be added with the same approach: implement an fx.Effect, add CLI construction if needed, then run it through fx.Chain before encoding.

I would like to hear maintainer feedback on whether this API direction is acceptable and the interfaces are good enough for future effects.

How Has This Been Tested?

Tested with:

zig build test

All tests passed.

Screenshots / Logs (if applicable)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@IfkumRfnl IfkumRfnl requested a review from orhun as a code owner May 24, 2026 22:47
@orhun orhun requested a review from tranzystorekk May 25, 2026 08:19
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.

1 participant