KaykCaputo / KaykCaputo/OpenCifra

Add chord transposition functionality

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
enhancement feature
Dominant language
Python
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Description
Allow users to transpose chords up or down to match their vocal range or capo position. This is a common feature in songbook applications.

## User Story
As a musician, I want to transpose song chords to different keys so that I can play songs in a comfortable range for my voice or instrument.

## Proposed UI
Add buttons to the lyrics screen:
- ➕ Transpose up (semitone)
- ➖ Transpose down (semitone)
- 🔄 Reset to original key

## Implementation Approach
1. Parse chords from the displayed content
2. Map chords to semitone values
3. Apply transposition algorithm
4. Update displayed chords

## Chord Mapping Example
```python
CHORD_MAP = {
'C': 0, 'C#': 1, 'Db': 1, 'D': 2, 'D#': 3, 'Eb': 3,
'E': 4, 'F': 5, 'F#': 6, 'Gb': 6, 'G': 7, 'G#': 8,
'Ab': 8, 'A': 9, 'A#': 10, 'Bb': 10, 'B': 11
}

def transpose_chord(chord, semitones):
# Extract root note, handle modifiers (m, 7, sus, etc.)
# Apply transposition
# Return transposed chord
pass
```

## Considerations
- Support for different chord notations (English vs Latin)
- Handle complex chords (7th, sus, add, etc.)
- Preserve chord formatting
- Consider using the existing `guitar.json` database

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the lyrics screen and the existing displayed-content handling, then inspect the existing guitar.json database. Trace how chords are represented before deciding how parsing, notation variants, complex modifiers, and key reset should work. Done means the lyrics screen can transpose supported chords up and down by semitone, reset them, and preserve formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.