|
| 1 | +# Configuration System |
| 2 | + |
| 3 | +Audiomancer uses a three-tier configuration system with inheritance: |
| 4 | + |
| 5 | +``` |
| 6 | +1. Builtin defaults (hardcoded in config.py) |
| 7 | + ↓ |
| 8 | +2. Global config (~/.config/audiomancer/config.yaml) |
| 9 | + ↓ (overrides) |
| 10 | +3. Project config (.audiomancer.yaml in project directory) |
| 11 | + ↓ (overrides) |
| 12 | +Final merged configuration |
| 13 | +``` |
| 14 | + |
| 15 | +## Configuration Files |
| 16 | + |
| 17 | +### Global Config |
| 18 | + |
| 19 | +**Location**: `~/.config/audiomancer/config.yaml` |
| 20 | + |
| 21 | +- Shared settings across all projects |
| 22 | +- Personal defaults (sample sources, analysis settings) |
| 23 | +- Optional - if missing, uses builtin defaults |
| 24 | + |
| 25 | +### Project Config |
| 26 | + |
| 27 | +**Location**: `.audiomancer.yaml` in project root |
| 28 | + |
| 29 | +- Project-specific overrides |
| 30 | +- Auto-generated by `audiomancer init` |
| 31 | +- Auto-detected when starting MCP server in a project directory |
| 32 | +- Optional - if missing, uses global config or builtin defaults |
| 33 | + |
| 34 | +## Example Global Config |
| 35 | + |
| 36 | +`~/.config/audiomancer/config.yaml`: |
| 37 | + |
| 38 | +```yaml |
| 39 | +# Sample library paths |
| 40 | +library: |
| 41 | + source_dir: ~/Library/CloudStorage/GoogleDrive/Samples # Where packs live |
| 42 | + auto_analyze: true |
| 43 | + max_file_size_mb: 10 |
| 44 | + copy_workers: 16 |
| 45 | + |
| 46 | +# Analysis settings |
| 47 | +analysis: |
| 48 | + max_file_size_mb: 50 |
| 49 | + embedding_dim: 128 |
| 50 | + |
| 51 | +# Sample sources (for scanning) |
| 52 | +sources: |
| 53 | + samples: |
| 54 | + paths: |
| 55 | + - ~/Music/Samples |
| 56 | + synths: |
| 57 | + paths: |
| 58 | + - ~/synths |
| 59 | + |
| 60 | +# Storage paths |
| 61 | +storage: |
| 62 | + db_path: ~/.local/share/audiomancer/audiomancer.db |
| 63 | + embeddings_path: ~/.local/share/audiomancer/embeddings |
| 64 | + models_path: ~/.local/share/audiomancer/models |
| 65 | +``` |
| 66 | +
|
| 67 | +## Example Project Config |
| 68 | +
|
| 69 | +`.audiomancer.yaml` (auto-generated by `audiomancer init`): |
| 70 | + |
| 71 | +```yaml |
| 72 | +# Project-specific settings |
| 73 | +library: |
| 74 | + project_root: ~/Development/my-music # This project's root |
| 75 | + source_dir: ~/path/to/samples # Override global sample source |
| 76 | +
|
| 77 | +# Project can override any global setting |
| 78 | +analysis: |
| 79 | + max_file_size_mb: 20 # Different limit for this project |
| 80 | +``` |
| 81 | + |
| 82 | +## Config Auto-Detection |
| 83 | + |
| 84 | +When running `audiomancer serve` or using MCP tools, the server automatically: |
| 85 | + |
| 86 | +1. Searches upward from current directory for `.audiomancer.yaml` |
| 87 | +2. If found, uses that project as the context |
| 88 | +3. Merges project config with global config and builtin defaults |
| 89 | +4. All file paths in tools are relative to detected project root |
| 90 | + |
| 91 | +This means Claude Code can automatically detect which project you're working in when you start the MCP server. |
| 92 | + |
| 93 | +## Project Structure |
| 94 | + |
| 95 | +``` |
| 96 | +{project_root}/ |
| 97 | +├── .audiomancer.yaml # Project-specific config |
| 98 | +├── .mcp.json # MCP server detection |
| 99 | +├── samples/ # Local cache (copied from source) |
| 100 | +├── library/ # Active samples (symlinks to samples/) |
| 101 | +├── session.tidal # TidalCycles session |
| 102 | +├── start_superdirt.scd # SuperDirt startup |
| 103 | +└── CLAUDE.md # Claude Code project instructions |
| 104 | +``` |
| 105 | +
|
| 106 | +## Next Steps |
| 107 | +
|
| 108 | +- [Configuration Examples](examples.md) - More examples |
| 109 | +- [API Reference](../api/index.md) - Python configuration API |
0 commit comments