-
Notifications
You must be signed in to change notification settings - Fork 18
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
Changing the 'note_off' property doesn't affect the 'duration_sec' property #293
Comments
I also noticed another related thing. When I set the raise ValueError("Note durations should be >= 0!") But as I set the note_on and note_off values by myself, I know that they should result in positive durations for the notes. Here is how I did set the values: note_on_val = 0.0
note_off_val = 1.0
for note in performedPart.notes:
note['note_on'] = note_on_val
note['note_off'] = note_off_val
note_on_val += 1.0
note_off_val += 1.0 So it looks like changing properties of performedPart.notes doesn't effect the note_array() that is generated to compute the piano roll (at least I guess that the piano roll uses the note_array() and not the .notes property) |
Hi! sorry for the late answer! This behavior is bit confusing. Here's a script that explains the main cases:
The main points are the comments underneath the tests:
The next release will address the negative duration issue, the rest remains as is for now. I hope you can find a workaround! |
Alright, thank you! This is very helpful :) |
I noticed something. Not sure if it is a bug. I have a PerformedPart. When I change the
note_off
property of a note, then theduration_sec
property of the corresponding note_array() stays the same.Here is an example of how I encountered this phenomenon:
I print the values of the first note before and after changing the
note_off
value. I can see that this value has changed accordingly. The note_array() shows two types of duration, but not a note_off value. It shows theduration_sec
and theduration_tick
. Now in my output I see that the value ofduration_sec
has not changed, but the value ofduration_tick
has changed as expected.Am I missing something or is this a bug or is this intentional?
I noticed this because of using the Piano Roll. After changing the
note_off
value, the new created piano roll shows the same as before. So it seems the piano roll uses thisduration_sec
value, that hasn't changed.For now I found a workaround. For changing the length of a note I now use the note_array()'s property
duration_sec
instead ofnote_off
. And after the change I overwrite my notes of the PerformedPart with the changed note_array().Like so:
But I'm still curious if it should be possible to get a correct result in the piano roll just with changing
note_off
Thanks a lot,
Tim
The text was updated successfully, but these errors were encountered: