Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid gaps that don't fit quantization scheme #1062

Merged
merged 7 commits into from
Aug 8, 2021

Conversation

jacobtylerwalls
Copy link
Member

Fixes #811

Avoid gaps that don't fit quantization scheme (1/6 QL rests, etc.) by looking ahead to see the divisor that will be used to quantize the subsequent offset.


Example file: https://github.com/cuthbertLab/music21/blob/master/music21/midi/testPrimitive/test01.mid

Finale (reference)
Screen Shot 2021-07-14 at 12 49 42 PM

m21 roundtrip Before
Screen Shot 2021-07-14 at 12 48 01 PM

m21 roundtrip After

Screen Shot 2021-07-14 at 12 47 52 PM

@coveralls
Copy link

coveralls commented Jul 14, 2021

Coverage Status

Coverage increased (+0.01%) to 92.356% when pulling 023dae9 on jacobtylerwalls:quantize-gaps into 5d566a8 on cuthbertLab:master.

Copy link
Member

@mscuthbert mscuthbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great. Just some comments about existing bugs and namedtuple for style.

music21/stream/base.py Show resolved Hide resolved
music21/stream/base.py Outdated Show resolved Hide resolved
music21/stream/base.py Outdated Show resolved Hide resolved
@mscuthbert mscuthbert merged commit d0a7dc6 into cuthbertLab:master Aug 8, 2021
@mscuthbert
Copy link
Member

Thanks! Looks great!

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.

Prevent so many gaps from quantizing durations
3 participants