asigalov61
commited on
Commit
•
b4ffaa9
1
Parent(s):
6b75c99
Update app.py
Browse files
app.py
CHANGED
@@ -143,7 +143,7 @@ def Generate_Chords_Progression(total_song_length_in_chords_chunks,
|
|
143 |
time = 0
|
144 |
|
145 |
patches = [0] * 16
|
146 |
-
patches[0] =
|
147 |
|
148 |
if base_MIDI_patch_number > -1:
|
149 |
patches[2] = base_MIDI_patch_number
|
@@ -167,7 +167,7 @@ def Generate_Chords_Progression(total_song_length_in_chords_chunks,
|
|
167 |
chords_labels.append(['text_event', time, chord_str])
|
168 |
|
169 |
for p in s:
|
170 |
-
output_score.append(['note', time, dur, 0, p, max(40, p),
|
171 |
|
172 |
if base_MIDI_patch_number > -1:
|
173 |
output_score.append(['note', time, dur, 2, (s[-1] % 12)+24, 120-(s[-1] % 12), base_MIDI_patch_number])
|
@@ -196,9 +196,6 @@ def Generate_Chords_Progression(total_song_length_in_chords_chunks,
|
|
196 |
output_for_gradio=True
|
197 |
)
|
198 |
|
199 |
-
print('Done!')
|
200 |
-
print('=' * 70)
|
201 |
-
|
202 |
#========================================================
|
203 |
|
204 |
output_midi_title = str(fn1)
|
@@ -206,9 +203,15 @@ def Generate_Chords_Progression(total_song_length_in_chords_chunks,
|
|
206 |
output_audio = (16000, audio)
|
207 |
|
208 |
output_plot = TMIDIX.plot_ms_SONG(output_score, plot_title=output_midi, return_plt=True)
|
209 |
-
|
|
|
|
|
|
|
210 |
#========================================================
|
211 |
|
|
|
|
|
|
|
212 |
chords_progression_summary_string = '=' * 70
|
213 |
chords_progression_summary_string += '\n'
|
214 |
|
@@ -220,6 +223,9 @@ def Generate_Chords_Progression(total_song_length_in_chords_chunks,
|
|
220 |
|
221 |
print('=' * 70)
|
222 |
print('Total number of chords:', len(all_song_chords))
|
|
|
|
|
|
|
223 |
print('=' * 70)
|
224 |
print('Most common pitches chord:', list(Counter(tuple([a[0] for a in all_song_chords])).most_common(1)[0][0]), '===', Counter(tuple([a[0] for a in all_song_chords])).most_common(1)[0][1], 'count')
|
225 |
print('=' * 70)
|
|
|
143 |
time = 0
|
144 |
|
145 |
patches = [0] * 16
|
146 |
+
patches[0] = chords_progression_MIDI_patch_number
|
147 |
|
148 |
if base_MIDI_patch_number > -1:
|
149 |
patches[2] = base_MIDI_patch_number
|
|
|
167 |
chords_labels.append(['text_event', time, chord_str])
|
168 |
|
169 |
for p in s:
|
170 |
+
output_score.append(['note', time, dur, 0, p, max(40, p), chords_progression_MIDI_patch_number])
|
171 |
|
172 |
if base_MIDI_patch_number > -1:
|
173 |
output_score.append(['note', time, dur, 2, (s[-1] % 12)+24, 120-(s[-1] % 12), base_MIDI_patch_number])
|
|
|
196 |
output_for_gradio=True
|
197 |
)
|
198 |
|
|
|
|
|
|
|
199 |
#========================================================
|
200 |
|
201 |
output_midi_title = str(fn1)
|
|
|
203 |
output_audio = (16000, audio)
|
204 |
|
205 |
output_plot = TMIDIX.plot_ms_SONG(output_score, plot_title=output_midi, return_plt=True)
|
206 |
+
|
207 |
+
print('Done!')
|
208 |
+
print('=' * 70)
|
209 |
+
|
210 |
#========================================================
|
211 |
|
212 |
+
print('Generated chords progression info and stats:')
|
213 |
+
print('=' * 70)
|
214 |
+
|
215 |
chords_progression_summary_string = '=' * 70
|
216 |
chords_progression_summary_string += '\n'
|
217 |
|
|
|
223 |
|
224 |
print('=' * 70)
|
225 |
print('Total number of chords:', len(all_song_chords))
|
226 |
+
chords_progression_summary_string += 'Total number of chords: ' + str(len(all_song_chords)) + '\n'
|
227 |
+
chords_progression_summary_string += '=' * 70
|
228 |
+
chords_progression_summary_string += '\n'
|
229 |
print('=' * 70)
|
230 |
print('Most common pitches chord:', list(Counter(tuple([a[0] for a in all_song_chords])).most_common(1)[0][0]), '===', Counter(tuple([a[0] for a in all_song_chords])).most_common(1)[0][1], 'count')
|
231 |
print('=' * 70)
|