Update app.py
Browse files
app.py
CHANGED
|
@@ -189,9 +189,10 @@ def Generate_Chords_Textures(input_midi,
|
|
| 189 |
|
| 190 |
#==================================================================
|
| 191 |
|
| 192 |
-
chords_len =
|
| 193 |
|
| 194 |
-
if
|
|
|
|
| 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)
|