Contributing¶
Thank you for your interest in contributing to AI Music Studio! This document covers everything you need to get started.
Code of Conduct¶
Be respectful, constructive, and inclusive. We follow the Contributor Covenant.
Ways to Contribute¶
- ๐ Bug reports โ open a GitHub issue using the bug template
- ๐ก Feature requests โ open a GitHub issue using the feature template
- ๐ Documentation โ fix typos, add examples, improve clarity
- ๐ต New genre presets โ add patterns to
core/patterns.py - ๐ค New agents โ add a musician or engineer agent
- ๐๏ธ DAW backends โ integrate a new DAW or audio tool
- ๐งช Tests โ improve coverage, add regression tests
Development Setup¶
# 1. Fork and clone
git clone https://github.com/<your-username>/audio_engineer.git
cd audio_engineer
# 2. Create a feature branch
git checkout -b feat/my-feature
# 3. Install all dev dependencies
pip install -e ".[dev]"
# 4. Verify tests pass
pytest -v
# 5. Verify lint passes
ruff check src tests scripts
Development Guidelines¶
Orchestration Order¶
Keep the generation order drums โ bass โ guitar โ keys stable unless the task explicitly changes it. This order models real session-band dependencies.
Determinism¶
- Prefer deterministic defaults for all musical parameters.
- Isolate randomness behind explicit
seedorrandom_stateparameters. - Tests should be reproducible across runs.
Pure Functions¶
Music theory helpers in core/music_theory.py and pattern functions in core/patterns.py should be pure functions with no side effects.
Testing¶
- Add or update tests for every non-trivial behavior change.
- Tests live in
tests/mirroring thesrc/structure. - Use
pytestfixtures fromtests/conftest.py.
pytest -v # run all tests
pytest tests/agents/ -v # run agent tests only
pytest -k test_drummer -v # run a specific test
Linting¶
Pull Request Guidelines¶
- Fill out the PR template completely.
- Include a short rationale: why this change, not just what.
- Mention behavior changes and migration notes.
- Keep PRs focused โ avoid unrelated refactors in the same PR.
- Ensure CI passes (lint + tests) before requesting review.
Adding a Genre Preset¶
- Open
src/audio_engineer/core/patterns.py. - Add a new entry to the
GENRE_PATTERNSdict:
"my_genre": GenrePattern(
kick_pattern=[0, 480, 960, 1440],
snare_pattern=[480, 1440],
hihat_pattern=[0, 240, 480, 720, 960, 1200, 1440, 1680],
velocity_map={0: 100, 480: 90, 960: 100, 1440: 90},
default_tempo=120,
),
- Add the genre name to the CLI
--genrechoices inscripts/generate_demo.py. - Add a test in
tests/core/test_patterns.py.
Docs Site¶
The documentation is built with MkDocs + Material.
# Install docs extras
pip install -e ".[docs]"
# Serve locally with live reload
mkdocs serve
# Build static site
mkdocs build
The site is auto-deployed to GitHub Pages on every push to main via .github/workflows/docs.yml.
Commit Message Format¶
Use Conventional Commits: