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

PrettyMIDI.adjust_times should force times to be monotonic #126

Closed
craffel opened this issue Apr 7, 2017 · 1 comment
Closed

PrettyMIDI.adjust_times should force times to be monotonic #126

craffel opened this issue Apr 7, 2017 · 1 comment

Comments

@craffel
Copy link
Owner

craffel commented Apr 7, 2017

Right now, there is no check/enforcement that original_times and new_times be monotonically increasing. This results in very strange behavior, like negative tempi, which causes later issues. They should be tested for monotonicity; if they are not monotonic, a warning should be given and they should be made monotonic with np.maximum.accumulate.

@areeves87
Copy link
Contributor

areeves87 commented Jun 28, 2018

I've taken a crack at this issue with the above pull request. #145

I inserted a private method within PrettyMIDI.adjust_times called _strictly_increasing() that enforces monotonicity and throws a warning if it detects a violation.

@craffel craffel closed this as completed in bd97acd Jul 9, 2018
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

No branches or pull requests

2 participants