diff --git a/libresvip/__init__.py b/libresvip/__init__.py index 3119f9e26..3f4dfc81e 100644 --- a/libresvip/__init__.py +++ b/libresvip/__init__.py @@ -1,4 +1,4 @@ import os -__version__ = "1.3.0" +__version__ = "1.3.1" os.environ.setdefault("LOGURU_AUTOINIT", "false") diff --git a/libresvip/plugins/vpr/vpr_parser.py b/libresvip/plugins/vpr/vpr_parser.py index fb0625c30..0db664f10 100644 --- a/libresvip/plugins/vpr/vpr_parser.py +++ b/libresvip/plugins/vpr/vpr_parser.py @@ -164,17 +164,20 @@ def parse_notes(self, notes: list[VocaloidNotes], pos: int, default_lyric: str) if len(notes): next_pos = None for note in notes[::-1]: - note_list.insert( - 0, - Note( - start_pos=note.pos + pos, - length=note.duration - if next_pos is None - else min(note.duration or 0, next_pos - note.pos), - key_number=note.number, - lyric=note.lyric or default_lyric, - pronunciation=None, - ), - ) + if ( + normalized_duration := note.duration + if next_pos is None + else min(note.duration or 0, next_pos - note.pos) + ) > 0: + note_list.insert( + 0, + Note( + start_pos=note.pos + pos, + length=normalized_duration, + key_number=note.number, + lyric=note.lyric or default_lyric, + pronunciation=None, + ), + ) next_pos = note.pos return note_list