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

monotonize_times doesn't do its job #251

Closed
anusfoil opened this issue May 29, 2023 · 2 comments · Fixed by #249
Closed

monotonize_times doesn't do its job #251

anusfoil opened this issue May 29, 2023 · 2 comments · Fixed by #249
Assignees
Labels
bug Something isn't working

Comments

@anusfoil
Copy link
Contributor

We have talked about using the monotonize_times to fix the performed note order reversal problem. But it turns out it's already being used in the tempo computations, but not actually returning a monotonic sequence.

To replicate using the data from score ../Datasets/pianodata-master/xml/chopin_op63_No1.xml and alignment ../Datasets/pianodata-master/match/chopin_op63_No1.match

# from the tempo_by_average function
eq_onsets = get_unique_seq(
    onsets=performed_onsets,
    offsets=performed_onsets + performed_durations,
    unique_onset_idxs=unique_onset_idxs,
)["u_onset"]

# Monotonize times
eq_onset_mt, unique_s_onsets_mt = monotonize_times(
    eq_onsets, deltas=unique_s_onsets
)

# check if the sequence eq_onset_mt is monotonic ascending
eq_onset_mt_ = np.append(eq_onset_mt[1:], eq_onset_mt[-1])
((eq_onset_mt_ - eq_onset_mt) >= 0).all()
# False
@anusfoil
Copy link
Contributor Author

Also the docstring is not complete and the strict parameter is not implemented in the code.

@anusfoil
Copy link
Contributor Author

proposed change in PR #249

@manoskary manoskary linked a pull request Jun 5, 2023 that will close this issue
@manoskary manoskary mentioned this issue Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants