asigalov61
commited on
Commit
•
b6793f7
1
Parent(s):
22def4c
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,7 @@ from midi_to_colab_audio import midi_to_colab_audio
|
|
32 |
def Harmonize_Melody(input_src_midi,
|
33 |
source_melody_transpose_value,
|
34 |
model_top_k_sampling_value,
|
|
|
35 |
melody_MIDI_patch_number,
|
36 |
harmonized_accompaniment_MIDI_patch_number,
|
37 |
base_MIDI_patch_number
|
@@ -52,6 +53,7 @@ def Harmonize_Melody(input_src_midi,
|
|
52 |
print('Requested settings:')
|
53 |
print('Source melody transpose value:', source_melody_transpose_value)
|
54 |
print('Model top_k sampling value:', model_top_k_sampling_value)
|
|
|
55 |
print('Melody MIDI patch number:', melody_MIDI_patch_number)
|
56 |
print('Harmonized accompaniment MIDI patch number:', harmonized_accompaniment_MIDI_patch_number)
|
57 |
print('Base MIDI patch number:', base_MIDI_patch_number)
|
@@ -316,7 +318,7 @@ if __name__ == "__main__":
|
|
316 |
|
317 |
source_melody_transpose_value = gr.Slider(-6, 6, value=0, step=1, label="Source melody transpose value", info="You can transpose source melody by specified number of semitones if the original melody key does not harmonize well")
|
318 |
model_top_k_sampling_value = gr.Slider(1, 50, value=15, step=1, label="Model sampling top_k value", info="Decreasing this value may produce better harmonization results in some cases")
|
319 |
-
|
320 |
melody_MIDI_patch_number = gr.Slider(0, 127, value=40, step=1, label="Source melody MIDI patch number")
|
321 |
harmonized_accompaniment_MIDI_patch_number = gr.Slider(0, 127, value=0, step=1, label="Harmonized accompaniment MIDI patch number")
|
322 |
base_MIDI_patch_number = gr.Slider(-1, 127, value=35, step=1, label="Base MIDI patch number")
|
@@ -335,6 +337,7 @@ if __name__ == "__main__":
|
|
335 |
[input_src_midi,
|
336 |
source_melody_transpose_value,
|
337 |
model_top_k_sampling_value,
|
|
|
338 |
melody_MIDI_patch_number,
|
339 |
harmonized_accompaniment_MIDI_patch_number,
|
340 |
base_MIDI_patch_number],
|
@@ -343,11 +346,12 @@ if __name__ == "__main__":
|
|
343 |
|
344 |
gr.Examples(
|
345 |
[
|
346 |
-
["USSR Anthem Seed Melody.mid", 0, 15, 40, 0, 35],
|
347 |
],
|
348 |
[input_src_midi,
|
349 |
source_melody_transpose_value,
|
350 |
model_top_k_sampling_value,
|
|
|
351 |
melody_MIDI_patch_number,
|
352 |
harmonized_accompaniment_MIDI_patch_number,
|
353 |
base_MIDI_patch_number],
|
|
|
32 |
def Harmonize_Melody(input_src_midi,
|
33 |
source_melody_transpose_value,
|
34 |
model_top_k_sampling_value,
|
35 |
+
texture_harmonized_chords,
|
36 |
melody_MIDI_patch_number,
|
37 |
harmonized_accompaniment_MIDI_patch_number,
|
38 |
base_MIDI_patch_number
|
|
|
53 |
print('Requested settings:')
|
54 |
print('Source melody transpose value:', source_melody_transpose_value)
|
55 |
print('Model top_k sampling value:', model_top_k_sampling_value)
|
56 |
+
print('Texture harmonized chords:', texture_harmonized_chords)
|
57 |
print('Melody MIDI patch number:', melody_MIDI_patch_number)
|
58 |
print('Harmonized accompaniment MIDI patch number:', harmonized_accompaniment_MIDI_patch_number)
|
59 |
print('Base MIDI patch number:', base_MIDI_patch_number)
|
|
|
318 |
|
319 |
source_melody_transpose_value = gr.Slider(-6, 6, value=0, step=1, label="Source melody transpose value", info="You can transpose source melody by specified number of semitones if the original melody key does not harmonize well")
|
320 |
model_top_k_sampling_value = gr.Slider(1, 50, value=15, step=1, label="Model sampling top_k value", info="Decreasing this value may produce better harmonization results in some cases")
|
321 |
+
texture_harmonized_chords = gr.Checkbox(label="Texture harmonized chords", value=True, info="Texture harmonized chords for more pleasant listening")
|
322 |
melody_MIDI_patch_number = gr.Slider(0, 127, value=40, step=1, label="Source melody MIDI patch number")
|
323 |
harmonized_accompaniment_MIDI_patch_number = gr.Slider(0, 127, value=0, step=1, label="Harmonized accompaniment MIDI patch number")
|
324 |
base_MIDI_patch_number = gr.Slider(-1, 127, value=35, step=1, label="Base MIDI patch number")
|
|
|
337 |
[input_src_midi,
|
338 |
source_melody_transpose_value,
|
339 |
model_top_k_sampling_value,
|
340 |
+
texture_harmonized_chords,
|
341 |
melody_MIDI_patch_number,
|
342 |
harmonized_accompaniment_MIDI_patch_number,
|
343 |
base_MIDI_patch_number],
|
|
|
346 |
|
347 |
gr.Examples(
|
348 |
[
|
349 |
+
["USSR Anthem Seed Melody.mid", 0, 15, True, 40, 0, 35],
|
350 |
],
|
351 |
[input_src_midi,
|
352 |
source_melody_transpose_value,
|
353 |
model_top_k_sampling_value,
|
354 |
+
texture_harmonized_chords,
|
355 |
melody_MIDI_patch_number,
|
356 |
harmonized_accompaniment_MIDI_patch_number,
|
357 |
base_MIDI_patch_number],
|