We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f83ef46 commit 1d07840Copy full SHA for 1d07840
fortepyan/midi/structures.py
@@ -72,6 +72,15 @@ def __post_init__(self):
72
def size(self) -> int:
73
return self.df.shape[0]
74
75
+ def copy(self) -> "MidiPiece":
76
+ notes_df = self.df.copy()
77
+ source = self.source.copy()
78
+ piece = MidiPiece(
79
+ df=notes_df,
80
+ source=source,
81
+ )
82
+ return piece
83
+
84
def time_shift(self, shift_s: float) -> "MidiPiece":
85
"""
86
Shift the start and end times of all notes in the MidiPiece by a specified amount.
0 commit comments