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