Separate Chord.inversion(int) to Chord.setInversion() - #2050
Merged
Merged
Conversation
setInversion(newInversion, *, transpose=True, inPlace=False) takes over the setting half of inversion(). Unlike inversion(n), it returns a copy by default. inversion(n) still works in place for v11; deprecate in v12, remove in v13. inversion() overloads now reject keywords that the get or set form ignores. setInversion(None) clears a stored inversion. harmony's self.inversion(None, transposeOnSet=False) was meant to do this (since 2012) but None always fell through to the getter; it now calls setInversion(None, inPlace=True). Also: inversion() docs said max 5 / 0 for unusual / None for empty; the code has returned 6 / -1 / -1 since 2015 / 2022. AI-assisted (Claude)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setInversion(newInversion, *, transpose=True, inPlace=False)takes over the setting half of inversion().This behaves like most m21 methods (and unlike before) in that inPlace=False is default.
transposeOnSetbecomes justtranspose, since it's entirely about setting.setInversion(None, inPlace=True)removes overridden inversions (a missing feature that was thought to exist since 2012.Old
Chord.inversion(2)for setting is still there in v11. In v12 it will be deprecated and give a warning. In v13 it will be removedFix some docs and errors.
AI-assisted (Claude)