Capo2Keys : A Tool for Converting Guitar Chord Charts for Piano
Source: Dev.to
Introduction
Well hello! It’s been a hot minute since I last posted on this blog. A lot has happened since my Docker post almost two years ago. I haven’t had as much free time, but I’ve been busy writing new articles and working on coding ideas.
Thanks to the almost‑daily advances in AI, I can now tackle projects much more efficiently and productively. I started learning piano toward the end of 2024, although I’ve been playing guitar for far longer. I loved being able to pick up the guitar with a capo and play songs from chord sheets on the internet, but my music‑theory knowledge wasn’t strong enough to transpose those charts to piano—especially when the sheets also contain lyrics.
I got ChatGPT to transpose many of those charts by copying and pasting the content, then manually converting the output to PDF. The workflow was tedious but workable—until it stopped working in late November 2025. Some songs failed with cryptic errors, while others succeeded. The failures turned out to be a mix of copyright‑related restrictions on the lyrics and occasional “I’m not designed to do this” messages from ChatGPT.
Capo2Keys – A Quick‑Hack Solution
While procrastinating on another task, I decided to see how well AI could act as a coding partner. The result is Capo2Keys, a GUI tool built with Flask and packaged as a Docker container. It converts guitar‑capo chord charts into piano‑ready keys and exports the results as PDF and TXT files while preserving lyrics and chord structure.
/
└─ Capo2Keys
What Capo2Keys Does
- Convert guitar capo chord charts into piano‑ready keys.
- Preserve lyrics and chord formatting.
- Export results as
.txtand.pdf. - Handle naming conflicts (suffix or overwrite).
- Archive generated songs, grouped by set.
- Deploy via Docker (GHCR image) with an optional desktop build from the same codebase.
Features
| Feature | Description |
|---|---|
| Transpose by capo value | 0‑11 semitones (0 = no capo) |
| Lyrics & chord formatting | Kept intact during conversion |
| Multiple output formats | .txt and .pdf |
| Conflict‑safe naming | Choose suffix or overwrite |
| Archive view | Browse generated songs by set |
| Docker‑first deployment | Docker Compose + GHCR publishing |
| CLI mode | For scripting |
| Desktop app | Optional build from same source |
Screenshots
Generator View
- Pick your capo (0‑11; 0 = no capo)
- Enter song title & artist (e.g.,
Title by Song Artist) - Paste your capo chords
Click Generate Transposition to produce piano chords with all lyrics.
Download the PDF or TXT, or click Browse Archive to view all generated files.
Archive View
- Browse the archive of previously generated songs.
- Link to the GitHub repository.
(Insert screenshots here if desired)
Background
I couldn’t find any existing tool that did exactly this, so I created Capo2Keys (originally named Chordbox, later CapoToKeys).
- Development: Used Codex from ChatGPT inside VS Code on Windows for “vibe‑coding”.
- Packaging: Docker container for easy spin‑up, plus a Python desktop version as a proof‑of‑concept.
- CI/CD: First time using GitHub Actions with secrets (GitHub PAT) to build and push a Docker image to GHCR.
I hope you find it as useful as I do. Feel free to suggest improvements!
Quick‑Start (Docker)
Note: The Docker version is recommended. The Python desktop version works but may trigger a security alert on Windows (non‑malicious but annoying).
Prerequisites
| Platform | Requirement |
|---|---|
| Windows (Docker Desktop or WSL) | Docker installed |
| Linux | Docker installed |
| macOS | Docker installed |
| All | Python (only for the desktop version) |
| All | A set of guitar chords (with or without capo) you want to play on piano |
One‑Command Setup
# Pull the latest image from GHCR
docker pull ghcr.io/reprodev/capo2keys:latest
# Run the container (detached)
docker run -d \
--name capo2keys \
-p 4506:4506 \
-v "$(pwd)/data:/data" \
ghcr.io/reprodev/capo2keys:latest
docker pull– Retrieves the latest image built by GitHub Actions.docker run -d– Starts the container in detached mode (runs in the background).--name capo2keys– Assigns a friendly name to the container.-p 4506:4506– Maps host port 4506 to container port 4506 (the WebUI).-v "$(pwd)/data:/data"– Binds adatafolder on the host to/datainside the container for persistent storage.
Now open your browser and navigate to:
http://localhost:4506
You’ll see the Generator UI where you can paste chords, set the capo number, and generate piano transpositions.
Alternative Deployments
- Docker Compose – A
docker-compose.ymlfile is provided in the repo for those who prefer Compose. - Python Desktop Version – Run the
app.pyscript directly (requires a local Python environment).
Final Thoughts
Capo2Keys started as a quick experiment to see how AI could help me build a useful tool. It turned into a fully‑fledged Docker‑first application that I hope will save other musicians time when converting capo‑based guitar charts to piano‑friendly keys.
Enjoy, and let me know what you think! 🎹🎸
How to Use the Capo2Keys Application
1. Generate a Composition
- Click Generate Composition.
- The app will create a TXT and a PDF version of your chord sheet.
- Download the files directly from this page using the provided buttons.
2. Clear the Form
- Use the Clear button to empty all text boxes.
- You can then paste a new chord sheet and start over.
3. Browse the Archive
- Click Browse Archive to view previously generated files.
- Files are grouped in pairs (TXT + PDF).
- From the list you can:
- View a file in the browser.
- Download either the TXT or PDF.
- Delete a pair by clicking the trash‑can icon next to it.
4. Return to the Generator
- Click Back to Generator (top‑right) to go back to the main menu and paste more chords.
Additional Notes
- Capo Setting: Keep the capo at 0 if you want the chords and lyrics unchanged while archiving rare music to PDF.
- Project Background: This is the first of several new tools I’m developing on GitHub. Feel free to explore my other projects, report bugs, or suggest improvements in the repository.
What I Learned
- Using AI to design, code, test, and deploy an application from idea to prototype in about an hour.
- Managing development across multiple machines with Git and the importance of version control.
Stay Connected
- Guides & Tutorials: https://reprodev.com
- GitHub (code examples & ongoing projects): https://github.com/reprodev
Happy chord‑to‑key converting!