asigalov61 commited on
Commit
62c7626
1 Parent(s): 4801166

Upload TMIDIX.py

Browse files
Files changed (1) hide show
  1. TMIDIX.py +5 -3
TMIDIX.py CHANGED
@@ -8572,14 +8572,16 @@ def escore_notes_lrno_pattern(escore_notes, mode='chords'):
8572
  chords_toks.append(token)
8573
  chords_idxs.append(i)
8574
 
8575
- lrno_pattern = list(find_lrno_patterns(chords_toks)[0][2])
8576
 
8577
- if lrno_pattern:
 
 
8578
 
8579
  start_idx = chords_idxs[find_pattern_start_indexes(chords_toks, lrno_pattern)[0]]
8580
  end_idx = chords_idxs[start_idx + len(lrno_pattern)]
8581
 
8582
- return recalculate_score_timings(flatten(checked_cscore[0][start_idx:end_idx]))
8583
 
8584
  else:
8585
  return None
 
8572
  chords_toks.append(token)
8573
  chords_idxs.append(i)
8574
 
8575
+ lrno_pats = find_lrno_patterns(chords_toks)
8576
 
8577
+ if lrno_pats:
8578
+
8579
+ lrno_pattern = list(lrno_pats[0][2])
8580
 
8581
  start_idx = chords_idxs[find_pattern_start_indexes(chords_toks, lrno_pattern)[0]]
8582
  end_idx = chords_idxs[start_idx + len(lrno_pattern)]
8583
 
8584
+ return recalculate_score_timings(flatten(cscore[start_idx:end_idx]))
8585
 
8586
  else:
8587
  return None