asigalov61
commited on
Commit
•
3ec16d6
1
Parent(s):
66affd3
Update app.py
Browse files
app.py
CHANGED
@@ -101,18 +101,21 @@ def MixMelody(input_midi):
|
|
101 |
|
102 |
|
103 |
new_song = random.choice(matched_songs)
|
|
|
|
|
|
|
|
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
print('Melody notes count:', new_song[2])
|
109 |
|
110 |
-
|
111 |
|
112 |
-
|
113 |
-
|
114 |
|
115 |
-
|
116 |
|
117 |
print('=' * 70)
|
118 |
print('Done loading source and target MIDIs...!')
|
@@ -175,7 +178,7 @@ def MixMelody(input_midi):
|
|
175 |
#========================================================
|
176 |
|
177 |
output_midi_title = str(fn1)
|
178 |
-
output_midi_summary = str(
|
179 |
output_midi = str(new_fn)
|
180 |
output_audio = (16000, audio)
|
181 |
|
|
|
101 |
|
102 |
|
103 |
new_song = random.choice(matched_songs)
|
104 |
+
|
105 |
+
print('Selected Monster Mono Melodies MIDI:', new_song[0])
|
106 |
+
print('Selected melody instrument:', TMIDIX.Number2patch[new_song[1]], '(', new_song[1], ')')
|
107 |
+
print('Melody notes count:', new_song[2])
|
108 |
|
109 |
+
MIDI_Summary = 'Selected Monster Mono Melodies MIDI: ' + str(new_song[0]) + '\n'
|
110 |
+
MIDI_Summary += 'Selected melody instrument: ' + str(TMIDIX.Number2patch[new_song[1]]) + ' (' + str(new_song[1]) + ')' + '\n'
|
111 |
+
MIDI_Summary += 'Melody notes count: ' + str(new_song[2])
|
|
|
112 |
|
113 |
+
trg_patch = new_song[1]
|
114 |
|
115 |
+
trg_song = copy.deepcopy(new_song[3])
|
116 |
+
TMIDIX.adjust_score_velocities(trg_song, 95)
|
117 |
|
118 |
+
cscore = TMIDIX.chordify_score([1000, trg_song])
|
119 |
|
120 |
print('=' * 70)
|
121 |
print('Done loading source and target MIDIs...!')
|
|
|
178 |
#========================================================
|
179 |
|
180 |
output_midi_title = str(fn1)
|
181 |
+
output_midi_summary = str(MIDI_Summary)
|
182 |
output_midi = str(new_fn)
|
183 |
output_audio = (16000, audio)
|
184 |
|