-
Notifications
You must be signed in to change notification settings - Fork 117
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for convenience, I believe this line is that check. |
Yes, works for me! |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be positive int
There was a problem hiding this comment.
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?
Thanks @ejhumphrey ! |
* 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
Resolves issue #251.
Diagnosis: The method
scale_degree_to_bitmap
inmir_eval.chord
was only ever dropping extended scale degrees on the floor, regardless of whether or notreduce_extended_chords
was set. This resulted in unexpected behavior whenreduce_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
andlength
, defaulting toFalse
and12
respectively, which preserves the same behavior ofmir_eval
overall. Then, in theencode
method,reduce_extended_chords
is passed on tomodulo
. This also preserves the consistent behavior ofmir_eval
, while fixing the expected behavior of these methods.This will be of interest to @fdlm and @bmcfee, having weighed in on the issue.