Kaban AI transcribes Somali Music to Sheet Music that anyone, from beginners to professionals, can play along.
# Kaban
Microtonal pitch detection CLI for monophonic Arabic and Somali audio.
Kaban uses the CREPE neural pitch detection model to accurately detect pitch — including microtones smaller than a semitone — and outputs note sequences with cent-level precision (e.g., `A4+30c`) rather than snapping to the Western 12-tone equal temperament grid.
## Features
- **CREPE pitch detection** via torchcrepe (PyTorch)
- **Cent-level precision** — preserves microtonal detail in maqam and Somali scales
- **Drone separation** — HPSS preprocessing isolates the melody from background drones
- **Onset detection** — separates repeated strikes of the same pitch
- **Overlapping chunked processing** — handles long audio files without memory issues
- **Fine-tuning pipeline** — adapt the CREPE model to your instrument
## Installation
```bash
git clone
github.com
cd kaban
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
For M4A/AAC support, install ffmpeg:
```bash
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
```
## Usage
### Basic pitch detection
```bash
python src/kaban.py audio.wav
```
### Output formats
```bash
# Table (default)
python src/kaban.py audio.wav
# JSON
python src/kaban.py audio.wav --format json
# MusicXML sheet export
python src/kaban.py audio.wav --sheet-format musicxml
# MIDI export
python src/kaban.py audio.wav --sheet-format midi
# Piano grand-staff MusicXML export
python src/kaban.py audio.wav --sheet-format musicxml --instrument piano
# Export both MusicXML and MIDI
python src/kaban.py audio.wav --sheet-format both
# Simplified Arabic Oud lead sheet
python src/kaban.py audio.wav --sheet-format musicxml --instrument guitar --simplify-sheet
# Faithful Arabic Oud sheet with less export-time reduction
python src/kaban.py audio.wav --sheet-format musicxml --instrument guitar --no-simplify-sheet
```
### Options
| Flag | Default | Description |
|------|---------|- …