-
Notifications
You must be signed in to change notification settings - Fork 118
Chord display #425
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
base: main
Are you sure you want to change the base?
Chord display #425
Conversation
One nitpick that I'm noticing just now: I'm not 100% satisfied with the hatching on sus4 chords. The final segment in our generated image comparison test: I'm entertaining suggestions on how else we could render sus4. |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Bumping minimal matplotlib to 3.6 so as to handle colormap registration. |
Had to nudge the minimal matplotlib here, which has set off a chain of environment updates and other painful nonsense. Meanwhile, I've also thrown in a workflow step to do an upload artifact for failing image comparison tests. We recently added this over in librosa and it's a huge time saver. |
Honestly the thick hatch version is not so bad. Not sure whether it's worth doing something conditional on matplotlib version. I think there are other hatches available that could be used for sus4, like stars etc., but I guess they might look terrible. |
Clownpants ftw |
Implements #424
This PR adds
mir_eval.display.chords()
and related functionality for visualizing chord annotations.It is largely based on the
segments
function, and there is plenty of redundancy in the code here. However, there are also enough differences that it's easier to duplicate than refactor.The text annotation functionality is also fully in place, but I did not add test coverage for this yet as it currently depends on some slightly broken behavior in matplotlib that is likely to change at some point. (See discussion in #424 ) As such, I don't mind a temporary coverage reduction.
Finally, this PR also registers six colormaps in the matplotlib registry when the module is imported:
pitch
pitch_light
pitch_dark
fifths
fifths_light
fifths_dark
The default is
fifths
for chord display, and otherwise the pitch modes are not used. However, I think we can probably find some use for them later on, perhaps in some kind of rainbow piano roll viz or something. (I've experimented with this a little offline, but nothing too compelling has emerged yet.)