asigalov61 commited on
Commit
0d3141e
·
verified ·
1 Parent(s): 2172aec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -222,13 +222,23 @@ def InpaintPitches(input_midi, input_num_of_notes, input_patch_number):
222
  print('=' * 70)
223
  print('Giant Music Transformer Inpainting Model Generator')
224
  print('=' * 70)
 
 
225
 
 
 
 
 
 
 
 
 
226
  out2 = []
227
 
228
  for m in melody_chords[:number_of_prime_tokens]:
229
  out2.append(m)
230
 
231
- for i in range(number_of_prime_tokens, len(melody_chords[:input_num_of_notes])):
232
 
233
  cpatch = (melody_chords[i]-2304) // 129
234
 
 
222
  print('=' * 70)
223
  print('Giant Music Transformer Inpainting Model Generator')
224
  print('=' * 70)
225
+
226
+ nidx = 0
227
 
228
+ for m in enumerate(melody_chords):
229
+ if 2304 <= melody_chords[i] < 18945 and (cpatch) == inpaint_MIDI_patch:
230
+ nidx += 1
231
+
232
+ if nidx == input_num_of_notes:
233
+ nidx = i
234
+ break
235
+
236
  out2 = []
237
 
238
  for m in melody_chords[:number_of_prime_tokens]:
239
  out2.append(m)
240
 
241
+ for i in range(number_of_prime_tokens, len(melody_chords[:nidx])):
242
 
243
  cpatch = (melody_chords[i]-2304) // 129
244