Skip to content

Fix usage of # and b in flatted and sharped chords#95

Merged
yuma-m merged 6 commits intomainfrom
fix/component
Jan 18, 2026
Merged

Fix usage of # and b in flatted and sharped chords#95
yuma-m merged 6 commits intomainfrom
fix/component

Conversation

@yuma-m
Copy link
Copy Markdown
Owner

@yuma-m yuma-m commented Jan 18, 2026

Currently, PyChord doesn't properly handle sharped or flattened qualities in chords.

For example,

>>> c = Chord("Dm7b5")
>>> print(c.components())
['D', 'F', 'G#', 'C']

The third note should be Ab instead of G#, as it is a flattened note of the fifth (A).

This PR addresses this issue by adding logic to the val_to_note method, which utilizes the quality name, and adds and fixes test cases.

@yuma-m yuma-m self-assigned this Jan 18, 2026
@yuma-m yuma-m marked this pull request as ready for review January 18, 2026 08:12
@yuma-m yuma-m merged commit 35e2d60 into main Jan 18, 2026
9 checks passed
@yuma-m yuma-m deleted the fix/component branch January 18, 2026 11:20
yuma-m added a commit that referenced this pull request Jan 25, 2026
This PR updates the docstring for the `val_to_note` method, which has
been updated in #95 and #108.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant