Skip to content

Commit

Permalink
Merge pull request #64 from napulen/duration14-fixes
Browse files Browse the repository at this point in the history
Duration14 fixes
  • Loading branch information
napulen authored Jun 12, 2022
2 parents 1915e40 + e1f19e2 commit bf96e66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions AugmentedNet/input_representations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bf96e66

Please sign in to comment.