Skip to content

Commit

Permalink
Merge pull request magenta#1997 from PhysSong:patch-1
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 458102591
  • Loading branch information
Magenta Team committed Jun 30, 2022
2 parents 77ed668 + f2d5318 commit 83a472b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions magenta/models/score2perf/datagen_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def process(self, kv):
# Seed random number generator based on key so that hop times are
# deterministic.
key, ns_str = kv
m = hashlib.md5(key)
m = hashlib.md5(key.encode('utf-8'))
random.seed(int(m.hexdigest(), 16))

# Deserialize NoteSequence proto.
Expand Down Expand Up @@ -573,7 +573,7 @@ def process(self, kv):
all_pitches = [x.pitch for x in decoded_ns.notes]
min_val = min(all_pitches)
max_val = max(all_pitches)
transpose_range = range(-(min_val - 21), 108 - max_val + 1)
transpose_range = list(range(-(min_val - 21), 108 - max_val + 1))
try:
transpose_range.remove(0) # make sure you transpose
except ValueError:
Expand Down

0 comments on commit 83a472b

Please sign in to comment.