Repository navigation
TimeSignature.barDuration uses a shared FrozenDuration - #2210
Merged
Merged
Conversation
Unfreezing on every read made barDuration 30x slower than v10 (0.04 to 1.2 microseconds), and changes to the copy it returned were silently lost. It now returns the meter's FrozenDuration, about 0.08 microseconds, and changing it raises. An assigned Duration is still returned as given. romanText deep-copied barDuration and later changed the note's length, so set quarterLength instead. Add the meter section to migratingToV11. AI-assisted (Claude)
Note(duration=ts.barDuration) raised TypeError while setting the duration's client, though assigning n.duration = ts.barDuration worked. In v10 that call shared the TimeSignature's own Duration, so n.duration.dots = 2 turned the 2/4 bar into 3.5 quarter lengths. Now the note holds the frozen duration and changing it raises. 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.
TimeSignature.barDuration now is a FrozenDuration (same as one of the underlying MeterSequences). It's necessary since unfreezing that duration on every read made barDuration 30x slower than v10 (0.04 to 1.2 microseconds)
Note that all this prevents this bug that was possible in v10 (since v1 even):
So to do that now do:
BarDuration is back to 0.08 microseconds, and changing it raises.
Fix romanText which would've broken without this.
Add the meter section to migratingToV11.
AI-assisted (Claude)