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

Ejh 20170704 extended chord mapping #252

Merged
merged 4 commits into from
Jul 24, 2017

Conversation

ejhumphrey
Copy link
Collaborator

Resolves issue #251.

Diagnosis: The method scale_degree_to_bitmap in mir_eval.chord was only ever dropping extended scale degrees on the floor, regardless of whether or not reduce_extended_chords was set. This resulted in unexpected behavior when reduce_extended_chords=True, because one expects that the extended scale degrees would be folded into the bit-vector representation.

Fix: Two arguments were added to scale_degree_to_bitmap: modulo and length, defaulting to False and 12 respectively, which preserves the same behavior of mir_eval overall. Then, in the encode method, reduce_extended_chords is passed on to modulo. This also preserves the consistent behavior of mir_eval, while fixing the expected behavior of these methods.

This will be of interest to @fdlm and @bmcfee, having weighed in on the issue.

@ejhumphrey ejhumphrey requested review from craffel and bmcfee July 5, 2017 11:06
Copy link
Collaborator

@craffel craffel left a comment

Choose a reason for hiding this comment

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

@fdlm can you confirm this fixes #251? Can someone else also spot-check the tests etc? I know nothing about chords so don't feel comfortable approving them.

@ejhumphrey
Copy link
Collaborator Author

for convenience, I believe this line is that check.

@fdlm
Copy link
Contributor

fdlm commented Jul 6, 2017

Yes, works for me!

Copy link
Collaborator

@bmcfee bmcfee left a comment

Choose a reason for hiding this comment

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

Looks generally good, modulo a couple of documentation / safety issues.

If a scale degree exceeds the length of the bit-vector, modulo the
scale degree back into the bit-vector; otherwise it is discarded.
length : int, default=12
Length of the bit-vector to produce
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be positive int

Copy link
Collaborator

Choose a reason for hiding this comment

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

also, does it make sense to support anything other than multiples of 12?

@craffel craffel merged commit 4645b67 into master Jul 24, 2017
@craffel
Copy link
Collaborator

craffel commented Jul 24, 2017

Thanks @ejhumphrey !

craffel pushed a commit that referenced this pull request Jun 22, 2018
* Updated test_chord to check for extended scale degrees.

* Isolated extended chord reduction bug in scale_degree_to_bitmap, tests failing.

* Fixes issue 251

* Removed crufty print statement
@bmcfee bmcfee deleted the ejh_20170704_extended_chord_mapping branch February 7, 2025 20:46
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.

4 participants