asigalov61
commited on
Commit
•
21779fc
1
Parent(s):
57efb9b
Update app.py
Browse files
app.py
CHANGED
@@ -20,21 +20,6 @@ from midi_to_colab_audio import midi_to_colab_audio
|
|
20 |
|
21 |
# =================================================================================================
|
22 |
|
23 |
-
def find_best_match(matches):
|
24 |
-
|
25 |
-
mlens = []
|
26 |
-
|
27 |
-
for sidx in matches:
|
28 |
-
mlen = len(TMIDIX.flatten(long_chords_chunks_mult[sidx[0]][sidx[1]:sidx[1]+(csize // 2)]))
|
29 |
-
mlens.append(mlen)
|
30 |
-
|
31 |
-
max_len = max(mlens)
|
32 |
-
max_len_idx = mlens.index(max_len)
|
33 |
-
|
34 |
-
return matches[max_len_idx]
|
35 |
-
|
36 |
-
# =================================================================================================
|
37 |
-
|
38 |
def Harmonize_Melody(input_src_midi,
|
39 |
source_melody_transpose_value,
|
40 |
harmonizer_melody_chunk_size,
|
@@ -121,6 +106,21 @@ def Harmonize_Melody(input_src_midi,
|
|
121 |
dchunk = []
|
122 |
|
123 |
#===============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
while i < len(mel_pitches):
|
126 |
|
|
|
20 |
|
21 |
# =================================================================================================
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
def Harmonize_Melody(input_src_midi,
|
24 |
source_melody_transpose_value,
|
25 |
harmonizer_melody_chunk_size,
|
|
|
106 |
dchunk = []
|
107 |
|
108 |
#===============================================================================
|
109 |
+
|
110 |
+
def find_best_match(matches):
|
111 |
+
|
112 |
+
mlens = []
|
113 |
+
|
114 |
+
for sidx in matches:
|
115 |
+
mlen = len(TMIDIX.flatten(long_chords_chunks_mult[sidx[0]][sidx[1]:sidx[1]+(csize // 2)]))
|
116 |
+
mlens.append(mlen)
|
117 |
+
|
118 |
+
max_len = max(mlens)
|
119 |
+
max_len_idx = mlens.index(max_len)
|
120 |
+
|
121 |
+
return matches[max_len_idx]
|
122 |
+
|
123 |
+
#===============================================================================
|
124 |
|
125 |
while i < len(mel_pitches):
|
126 |
|