Open page200 opened 2 years ago
I think this is a matter of convention, i.e. if a note falls entirely within a sampling interval should it be included or not? I would welcome a PR to make this behavior configurable (I think int(floor(...)):int(ceil(...)) would make most sense).
FYI, I tried to fix this in PR #195
get_piano_roll
doesn't show some of the notes. You can easily find such cases by choosing a lowfs
value.Here instead of
int(note.start*fs):int(note.end*fs)
, a different rounding mechanism might solve the problem, preventing the duration from being0
for example as follows:int(note.start*fs):max(int(note.end*fs),int(note.start*fs)+1)
Thank you and happy holidays!