Spaces:
Running
Running
asigalov61
commited on
Commit
•
debe9ae
1
Parent(s):
2f9b3e2
Update app.py
Browse files
app.py
CHANGED
@@ -247,10 +247,34 @@ def Mix_Melody(input_midi,
|
|
247 |
|
248 |
#===============================================================================
|
249 |
|
250 |
-
if
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
#===============================================================================
|
256 |
print('Rendering results...')
|
|
|
247 |
|
248 |
#===============================================================================
|
249 |
|
250 |
+
if input_output_as_solo_piano:
|
251 |
+
csong = TMIDIX.chordify_score([1000, mixed_song])
|
252 |
+
|
253 |
+
mixed_song = []
|
254 |
+
|
255 |
+
for c in csong:
|
256 |
+
pitches = []
|
257 |
+
for cc in c:
|
258 |
+
ccc = copy.deepcopy(cc)
|
259 |
+
if cc[3] != 9:
|
260 |
+
if cc[6] == trg_patch:
|
261 |
+
ccc[3] = 3
|
262 |
+
ccc[6] = 0
|
263 |
+
mixed_song.append(ccc)
|
264 |
+
pitches.append(cc[4])
|
265 |
+
else:
|
266 |
+
if cc[4] not in pitches:
|
267 |
+
ccc[3] = 0
|
268 |
+
ccc[6] = 0
|
269 |
+
mixed_song.append(ccc)
|
270 |
+
pitches.append(cc[4])
|
271 |
+
|
272 |
|
273 |
+
else:
|
274 |
+
mixed_song.append(ccc)
|
275 |
+
|
276 |
+
if input_remove_drums:
|
277 |
+
mixed_song = [e for e in mixed_song if e[3] != 9]
|
278 |
|
279 |
#===============================================================================
|
280 |
print('Rendering results...')
|