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

Improve ticks of noteplotter #3

Open
Datseris opened this issue Nov 6, 2019 · 6 comments
Open

Improve ticks of noteplotter #3

Datseris opened this issue Nov 6, 2019 · 6 comments
Labels
good first issue Good for newcomers

Comments

@Datseris
Copy link
Member

Datseris commented Nov 6, 2019

Add tick lines in between the heuristic notes, but add no labels to these ticks.

@Datseris Datseris self-assigned this Nov 6, 2019
@aminya

This comment has been minimized.

@Datseris Datseris transferred this issue from JuliaMusic/MusicManipulations.jl Nov 9, 2019
@Datseris Datseris removed their assignment Feb 16, 2020
@Datseris Datseris added the good first issue Good for newcomers label Feb 16, 2020
@Datseris
Copy link
Member Author

The (default) ticks at the moment use this heuristic function to attempt to only show 7 major ticks: https://github.com/JuliaMusic/MusicVisualizations.jl/blob/master/src/noteplotter.jl#L99-L105 . This could be modified to make the experience better, or it could be made customizable via kwarg propagation.

@ashwani-rathee
Copy link

Hey @Datseris ,I want to work on it,I have been contributing to python Bokeh's documentation tasks,jupyter tutorial improvements and themes inclusion for past 3 months...I understand little of julia (i took coursera coursera on julia scientific computingthough)but I am improving but I am still new to OSS contributions ...been using magenta,librosa,sms-toolsetc for sometime now..I want to contribute to JuliaMusic in general and this place seems a good place to start as I am little used to graphs after using bokeh and librosa...pls guide..

@Datseris
Copy link
Member Author

Datseris commented Jun 11, 2020

Hi, welcome, sure please feel free to contribute. Once you have a topic to work on I can help. It is typically simplest for you to familiarize yourself with making Pull Request to Julia projects (there are YouTube tutorials for that).

Regarding the current issue, what I was describing was simply improving the tick layout of the plotting. At the moment this is what happens

    # limits and labels
    if names == nothing
        yticks, ylabels = heuristic_note_names(plottedpitches)
    else
        yticks = plottedpitches
        ylabels = [names[p] for p in plottedpitches]
    end
    ax.set_xlim(st, fi)
    ax.set_yticks(yticks)
    ax.set_ylim(minimum(plottedpitches)-1, maximum(plottedpitches)+1)
    ax.set_yticklabels(ylabels)
    ax.set_xlabel("time (ticks)")
    return plottedpitches
end

function heuristic_note_names(plottedpitches)
    mi, ma = extrema(plottedpitches)
    notestep = max((ma-mi)÷7, 1)
    pitches = mi:notestep:ma
    ylabels = [pitch_to_name(p) for p in pitches]
    return pitches, ylabels
end

So either the user provides some exact names, (and we do nothing), or we try to have around 7 major ticks irrespectively of how many pitches are plotted.

A (very) simple imporivement is to add minor ticks appropriately in between that fill all missing notes.

But, I think plotting is probably not the best place to start, as it assumes knowledge of the basics as well. You are probably in a more comfortable situation by starting a contribution to MIDI.jl or MusicManipulations.jl, which both have some open issues that are very simple to tackle. For example:

JuliaMusic/MIDI.jl#119
JuliaMusic/MIDI.jl#110
JuliaMusic/MusicManipulations.jl#30

and you could of course open new Feature Request issues for stuff that are missing.

@Datseris
Copy link
Member Author

@ashwani-rathee , since you have been using Librosa, for years now I wanted to bring its features to Julia. We have this fork: https://github.com/JuliaMusic/MusicProcessing.jl which has some librosa functionality but hasn't been updated in 4 years. Perhaps you are interested in taking over and maintaining this? I could as the author to transfer the repo to us if you are interested.

@ashwani-rathee
Copy link

@Datseris I'll familiarize with the package and look to solve the issues you mentioned first..It will be great if I can get to work on bringing the functionalities from librosa....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants