Spaces:
Running
Running
asigalov61
commited on
Commit
•
b8f21b1
1
Parent(s):
3ec16d6
Update app.py
Browse files
app.py
CHANGED
@@ -126,20 +126,22 @@ def MixMelody(input_midi):
|
|
126 |
|
127 |
midx = 0
|
128 |
|
129 |
-
for c in cscore
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
|
|
|
|
|
143 |
|
144 |
print('=' * 70)
|
145 |
print('Done!')
|
|
|
126 |
|
127 |
midx = 0
|
128 |
|
129 |
+
for c in cscore:
|
130 |
+
cho = copy.deepcopy(c)
|
131 |
+
|
132 |
+
patches = sorted(set([e[6] for e in c]))
|
133 |
+
|
134 |
+
if trg_patch in patches:
|
135 |
+
|
136 |
+
mixed_song.extend(mix_chord(c, src_harm_tones_chords[midx], trg_patch, src_melody_pitches[midx]))
|
137 |
+
|
138 |
+
midx += 1
|
139 |
+
|
140 |
+
else:
|
141 |
+
mixed_song.extend(mix_chord(cho, src_harm_tones_chords[midx], trg_patch, src_melody_pitches[midx]))
|
142 |
|
143 |
+
if midx == len(src_melody):
|
144 |
+
break
|
145 |
|
146 |
print('=' * 70)
|
147 |
print('Done!')
|