diff --git a/AugmentedNet/input_representations.py b/AugmentedNet/input_representations.py index a42a19cf..e8ef9d4f 100644 --- a/AugmentedNet/input_representations.py +++ b/AugmentedNet/input_representations.py @@ -109,7 +109,7 @@ class Duration14(FeatureRepresentationTI): [0, 1, 1, 1, 1, 1, 1], ] - def run(self): + def run(self, transposition=None): array = np.zeros(self.shape, dtype=self.dtype) prev_measure = -1 idx = 0 @@ -119,14 +119,14 @@ def run(self): prev_measure = measure pattern = self.pattern[idx] array[frame, 0:7] = pattern - idx += 1 + idx = min(idx + 1, len(self.pattern) - 1) idx = 0 for frame, onset in enumerate(self.df.s_isOnset): if sum(onset) > 0: idx = 0 pattern = self.pattern[idx] array[frame, 7:] = pattern - idx += 1 + idx = min(idx + 1, len(self.pattern) - 1) return array @classmethod