projectlosangeles commited on
Commit
0ede74d
·
verified ·
1 Parent(s): 1cf40d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -189,9 +189,10 @@ def Generate_Chords_Textures(input_midi,
189
 
190
  #==================================================================
191
 
192
- chords_len = len(chords)
193
 
194
- if chords_len < 128:
 
195
  chords = chords * ((128 // chords_len)+1)
196
 
197
  chords = chords[:128]
@@ -215,6 +216,19 @@ def Generate_Chords_Textures(input_midi,
215
 
216
  final_song = out.tolist()
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  #==================================================================
219
 
220
  print('=' * 70)
 
189
 
190
  #==================================================================
191
 
192
+ chords_len = 128
193
 
194
+ if len(chords) < 128:
195
+ chords_len = len(chords)
196
  chords = chords * ((128 // chords_len)+1)
197
 
198
  chords = chords[:128]
 
216
 
217
  final_song = out.tolist()
218
 
219
+ #==================================================================
220
+
221
+ ccount = 0
222
+
223
+ for i, f in enumerate(final_song):
224
+ if f > 384:
225
+ ccount += 1
226
+
227
+ if ccount == chords_len:
228
+ break
229
+
230
+ final_song = final_song[:i]
231
+
232
  #==================================================================
233
 
234
  print('=' * 70)