asigalov61
commited on
Commit
•
f75e115
1
Parent(s):
a2952e6
Upload TMIDIX.py
Browse files
TMIDIX.py
CHANGED
@@ -1798,8 +1798,8 @@ def plot_ms_SONG(ms_song,
|
|
1798 |
if show_grid_lines:
|
1799 |
ax.grid(color='white')
|
1800 |
|
1801 |
-
plt.xlabel('Time (
|
1802 |
-
plt.ylabel('Pitch', c='black')
|
1803 |
|
1804 |
plt.title(plot_title)
|
1805 |
|
@@ -4696,6 +4696,28 @@ def augment_enhanced_score_notes(enhanced_score_notes,
|
|
4696 |
|
4697 |
###################################################################################
|
4698 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4699 |
# This is the end of the TMIDI X Python module
|
4700 |
|
4701 |
###################################################################################
|
|
|
1798 |
if show_grid_lines:
|
1799 |
ax.grid(color='white')
|
1800 |
|
1801 |
+
plt.xlabel('Time (s)', c='black')
|
1802 |
+
plt.ylabel('MIDI Pitch', c='black')
|
1803 |
|
1804 |
plt.title(plot_title)
|
1805 |
|
|
|
4696 |
|
4697 |
###################################################################################
|
4698 |
|
4699 |
+
def extract_melody(chordified_enhanced_score,
|
4700 |
+
melody_range=[60, 84],
|
4701 |
+
melody_channel=0,
|
4702 |
+
melody_patch=0
|
4703 |
+
):
|
4704 |
+
|
4705 |
+
melody_score = copy.deepcopy([c[0] for c in chordified_enhanced_score if c[0][3] != 9])
|
4706 |
+
|
4707 |
+
for e in melody_score:
|
4708 |
+
e[3] = melody_channel
|
4709 |
+
e[6] = melody_patch
|
4710 |
+
|
4711 |
+
if e[4] < melody_range[0]:
|
4712 |
+
e[4] = (e[4] % 12) + melody_range[0]
|
4713 |
+
|
4714 |
+
if e[4] > melody_range[1]:
|
4715 |
+
e[4] = (e[4] % 12) + melody_range[1]
|
4716 |
+
|
4717 |
+
return fix_monophonic_score_durations(melody_score)
|
4718 |
+
|
4719 |
+
###################################################################################
|
4720 |
+
|
4721 |
# This is the end of the TMIDI X Python module
|
4722 |
|
4723 |
###################################################################################
|