Skip to content

Commit

Permalink
fixed index err
Browse files Browse the repository at this point in the history
  • Loading branch information
theace0296 committed May 31, 2020
1 parent 9f45084 commit b557756
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions BeatMapSynthesizer/build/scripts/beatmapsynth.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ def removeBadNotes(self, notes_list):
oppositeLayers = {0: [1,2],
1: [0,2],
2: [0,1]}

if notes_list[i]['_cutDirection'] == 8 and notes_list[i]['_type'] != 3 and notes_list[i-1]['_time'] - notes_list[i]['_time'] < 0.5 and notes_list[i]['_cutDirection'] not in oppositeCutDirs[notes_list[i-1]['_cutDirection']]:
notes_list[i]['_cutDirection'] = int(np.random.choice(oppositeCutDirs[notes_list[i-1]['_cutDirection']]))
if notes_list[i]['_cutDirection'] == 8 and notes_list[i]['_type'] != 3 and notes_list[i-1]['_time'] - notes_list[i]['_time'] < 0.5 and notes_list[i]['_lineIndex'] not in oppositeIndices[notes_list[i-1]['_lineIndex']] and notes_list[i]['_lineLayer'] not in oppositeLayers[notes_list[i-1]['_lineLayer']]:
if int(np.random.choice([0,1])):
notes_list[i]['_lineIndex'] = int(np.random.choice(oppositeIndices[notes_list[i-1]['_lineIndex']]))
else:
notes_list[i]['_lineLayer'] = int(np.random.choice(oppositeLayers[notes_list[i-1]['_lineLayer']]))
if i > 1:
if notes_list[i]['_cutDirection'] == 8 and notes_list[i]['_type'] != 3 and notes_list[i-1]['_time'] - notes_list[i]['_time'] < 0.5 and notes_list[i]['_cutDirection'] not in oppositeCutDirs[notes_list[i-1]['_cutDirection']]:
notes_list[i]['_cutDirection'] = int(np.random.choice(oppositeCutDirs[notes_list[i-1]['_cutDirection']]))
if notes_list[i]['_cutDirection'] == 8 and notes_list[i]['_type'] != 3 and notes_list[i-1]['_time'] - notes_list[i]['_time'] < 0.5 and notes_list[i]['_lineIndex'] not in oppositeIndices[notes_list[i-1]['_lineIndex']] and notes_list[i]['_lineLayer'] not in oppositeLayers[notes_list[i-1]['_lineLayer']]:
if int(np.random.choice([0,1])):
notes_list[i]['_lineIndex'] = int(np.random.choice(oppositeIndices[notes_list[i-1]['_lineIndex']]))
else:
notes_list[i]['_lineLayer'] = int(np.random.choice(oppositeLayers[notes_list[i-1]['_lineLayer']]))
return notes_list

def writeNotesHMM(self, notes_list, df_preds):
Expand Down

0 comments on commit b557756

Please sign in to comment.