Installation Guide¶
Detailed installation instructions for MIDI Markdown.
System Requirements¶
- Python: 3.12 or higher
- Operating System: macOS, Linux, or Windows
- Disk Space: ~50 MB for project and dependencies
- Optional: Git for cloning the repository
Installation Methods¶
Method 1: UV Package Manager (Recommended)¶
UV is a fast, modern Python package manager that handles virtual environments automatically.
1. Install UV
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or with Homebrew (macOS)
brew install uv
# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
2. Clone Repository
3. Install Dependencies
4. Verify Installation
Method 2: pip and venv (Traditional)¶
If you prefer traditional Python tools:
1. Clone Repository
2. Create Virtual Environment
# Create venv
python3.12 -m venv .venv
# Activate (macOS/Linux)
source .venv/bin/activate
# Activate (Windows)
.venv\Scripts\activate
3. Install Dependencies
4. Verify Installation
Post-Installation Setup¶
Create Output Directory¶
Test with Examples¶
# Compile a simple example
uv run mmdc compile examples/00_basics/01_hello_world.mmd -o output/test.mid
# Should output:
# ✅ Compilation successful
Optional: Shell Completion¶
Enable tab completion for your shell:
# Bash
uv run mmdc --install-completion bash
# Zsh
uv run mmdc --install-completion zsh
# Fish
uv run mmdc --install-completion fish
Development Setup¶
If you plan to contribute or modify the code:
1. Install Development Dependencies¶
2. Install Development Tools¶
# Ruff (linter and formatter) - included in uv
# mypy (type checker) - included in uv
# pytest (test framework) - included in uv
3. Verify Development Environment¶
4. Pre-commit Setup (Optional)¶
IDE Setup¶
Visual Studio Code¶
1. Install Python Extension
Install the official Python extension from Microsoft.
2. Configure Interpreter
- Press
Cmd/Ctrl + Shift + P - Type "Python: Select Interpreter"
- Choose
.venv/bin/python
3. Recommended Extensions
- Python (Microsoft) - Python language support
- Pylance - Fast Python language server
- YAML - YAML language support (for frontmatter)
4. Settings (.vscode/settings.json)
{
"python.defaultInterpreterPath": ".venv/bin/python",
"python.linting.enabled": true,
"python.formatting.provider": "none",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
}
}
PyCharm¶
1. Open Project
Open the midi-markdown directory.
2. Configure Interpreter
- Go to Settings/Preferences → Project → Python Interpreter
- Click gear icon → Add
- Select "Existing environment"
- Choose
.venv/bin/python
3. Enable Ruff
- Install Ruff plugin from JetBrains Marketplace
- Enable in Settings → Tools → Ruff
Troubleshooting¶
Python Version Issues¶
Q: "Python 3.12 not found"
# Check your Python version
python3 --version
# Install Python 3.12 via pyenv (recommended)
brew install pyenv
pyenv install 3.12.9
pyenv local 3.12.9
UV Installation Issues¶
Q: "uv: command not found"
# Add UV to PATH (macOS/Linux)
export PATH="$HOME/.cargo/bin:$PATH"
# Add to your shell profile (~/.zshrc or ~/.bashrc)
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
Dependency Issues¶
Q: "Failed to install dependencies"
Permission Issues¶
Q: "Permission denied"
# Don't use sudo with UV - it manages its own environment
# If you see permission errors, check file ownership:
ls -la
# Fix ownership if needed
sudo chown -R $USER:$USER .
Virtual Environment Issues¶
Q: "Wrong Python version in venv"
Platform-Specific Notes¶
macOS¶
- UV installs to
~/.cargo/bin/ - Virtual environment created in
.venv/ - MIDI playback: Use QuickTime Player or GarageBand
Required:
Linux¶
- UV installs to
~/.cargo/bin/ - May need to install additional MIDI tools:
# Ubuntu/Debian
sudo apt-get install timidity fluidsynth
# Fedora
sudo dnf install timidity++ fluid-soundfont-gm
# Arch
sudo pacman -S timidity++ soundfont-fluid
Windows¶
- UV installs to
%USERPROFILE%\.cargo\bin\ - Use PowerShell or Windows Terminal (recommended)
- MIDI playback: Built into Windows Media Player
Path Setup: Add UV to PATH via System Environment Variables if not done automatically.
Verification Checklist¶
After installation, verify everything works:
# ✓ UV installed and in PATH
uv --version
# ✓ Python 3.12+ available
python3 --version
# ✓ Project dependencies installed
uv run mmdc version
# ✓ Can compile examples
uv run mmdc compile examples/00_basics/01_hello_world.mmd -o output/test.mid
# ✓ Tests pass
uv run pytest -m unit
# ✓ Code formatting works
uv run ruff format . --check
If all commands succeed, your installation is complete!
Updating¶
To update to the latest version:
# Pull latest changes
git pull origin main
# Update dependencies
uv sync
# Verify update
uv run mmdc version
Uninstalling¶
To completely remove the project:
Next Steps¶
- Getting Started Guide - Create your first MIDI file
- CLI Command Reference - Learn all commands
- Examples - Work through progressive examples
Getting Help¶
- Check Troubleshooting section above
- Review GitHub Issues
- Read the FAQ (if available)
- Ask for help by creating a new issue