Skip to content

Fix Raised 6, 7 issues with obscure RNs (Issue 1349) - #2001

Merged
mscuthbert merged 16 commits into
masterfrom
fix-1349-raised-67
Aug 20, 2026
Merged

Fix Raised 6, 7 issues with obscure RNs (Issue 1349)#2001
mscuthbert merged 16 commits into
masterfrom
fix-1349-raised-67

Conversation

@mscuthbert

Copy link
Copy Markdown
Member

Fixes the main bug in #1349 : romanNumeralFromChord now keeps the sharp on
major-quality chords built on raised ^6/^7 in minor (#VI, not VI#63),

So more figures round-trip accurately. Improve and document .romanNumeral and how
it distinguishes them from bVI/bVII.

Removes the tsvConverter workaround for this bug since now it just works.

Documents the long-implicit inner workings of .romanNumeral (natural-minor spelling)
and the various figure tuples: FigureTuple/PitchFigureTuple with
.fromPitchAndReference() class methods

Deprecate figureTupleSolo.

Add .editorconfig for guide lines for ruff. (someone complain if you hate them, but i do most of the dev here...) Add some AI memories about how to write docs.

AI-Assisted (Claude) - thoroughly human reviewed and prose rewritten

Fixes #1349

mscuthbert added 15 commits July 6, 2026 06:55
Major-quality chords on the raised sixth and seventh scale degrees of a
minor key now keep their sharp prefix (e.g. #VI in c minor instead of
VI#63), so the generated figure round-trips through RomanNumeral() and
.romanNumeral distinguishes them from the chords on the lowered (natural
minor) degrees.  Adds the keyword-only isMajorThird argument to
correctRNAlterationForMinor, documents the semantic contract of the
.romanNumeral property, and removes the now-unneeded workaround in
romanText/tsvConverter.localKeyAsRn.

Addresses the main bug in #1349 (the sixthMinor/seventhMinor parameters
for romanNumeralFromChord and the QUALITY default flip remain open).

AI-assisted (Claude)
Documents the previously implicit semantics: aboveBass is reckoned from
whatever reference pitch was passed (the tonic, not the sounding bass, in
romanNumeralFromChord); alter is measured against the natural-minor scale;
and prefix deliberately diverges from alter after
correctRNAlterationForMinor applies cautionary conventions.  Also adds a
maintenance note listing the three places that implement the minor ^6/^7
accidental convention.

No behavior change.

AI-assisted (Claude)
aboveBass becomes degFromRefPitch: the reference pitch is not always the
bass (romanNumeralFromChord passes the tonic, measuring the chord's root),
and the value is a 1-based simple-interval degree, not a zero-based
distance above.  ChordFigureTuple becomes PitchFigureTuple: one tuple
describes a single pitch; a list of them describes a chord.  Renames the
matching local variable in figureTupleSolo and updates all docs and
doctests.

AI-assisted (Claude)
Public docstrings are for library users; maintenance notes and references
to private methods belong in comments for maintainers.

AI-assisted (Claude)
…eral

The function corrects Roman-numeral alterations, so its parameter should
speak in numeral terms, not chord anatomy: what it consumes is whether the
numeral will be written in uppercase (lowercase numerals already imply the
raised ^6/^7 in minor).  Major third and uppercase numeral are the same
bit; romanNumeralFromChord translates at the call site.

AI-assisted (Claude)
Checks session-learned working knowledge into the repo-shared memory so it
survives across machines: public docs vs maintainer comments, no
untaken-paths prose in docstrings, and the status/open questions on the
romanNumeral raised-6/7 work.

AI-assisted (Claude)
…e doc

The variable names a fact about the chord, not about any single interval
or figure entry.  Also cut the not-a-subclass parenthetical from the
PitchFigureTuple docstring.

AI-assisted (Claude)
Name the parameter for the chord-level fact it carries, not for its
consequence: no numeral exists yet when the function runs, so
uppercaseNumeral described something outside its inputs.  One concept now
has one name in caller and callee alike; the docstring explains the case
convention that makes the fact matter.

AI-assisted (Claude)
The variable is a plain bool (semitonesFromChordStep returns None for
third-less chords, which the == 4 comparison maps to False), so the
five-line assignment collapses to one and the 'if X: pass / elif not X'
becomes a single negated if.

AI-assisted (Claude)
Follows the module's result-From-source naming (romanNumeralFromChord);
the old name read as the verb 'figure'.  The new function's
reference-pitch parameter is refPitch (was bass), matching
FigureTuple.degFromRefPitch and the fact that romanNumeralFromChord
passes the tonic, not a bass.  figureTupleSolo remains at its old spot as
a deprecated (v11 -> v12) alias with the old signature.

AI-assisted (Claude)
…ethod

The measurement that produces a FigureTuple now lives on the type it
produces, with the reference-pitch parameter named refPitch to match
degFromRefPitch.  figureTupleSolo stays at its old spot as a deprecated
(v11 -> v12) alias with its old signature.

AI-assisted (Claude)
add editorconfig
@coveralls

coveralls commented Aug 20, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.33%. remained the same — fix-1349-raised-67 into master

@mscuthbert
mscuthbert merged commit 54bd4fe into master Aug 20, 2026
6 checks passed
@mscuthbert
mscuthbert deleted the fix-1349-raised-67 branch August 20, 2026 01:31
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.

Unexpected value of romanNumeral after romanNumeralFromChord

2 participants