Skip to content

Commit ef23ffd

Browse files
committed
fix: patch Note class to work with pynbs data classes
`pynbs` 1.0.0 replaced named tuples with data classes, so the `__new__` method is no longer usable to instantiate its classes.
1 parent f527f86 commit ef23ffd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nbswave/nbs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ class Note(pynbs.Note):
1515
"""Extends `pynbs.Note` with extra functionality to calculate
1616
the compensated pitch, volume and panning values."""
1717

18-
def __new__(cls, note: Union[pynbs.Note, Note]):
19-
return super().__new__(
20-
cls,
18+
def __init__(cls, note: Union[pynbs.Note, Note]):
19+
return super().__init__(
2120
note.tick,
2221
note.layer,
2322
note.instrument,

0 commit comments

Comments
 (0)