projectlosangeles
commited on
Commit
•
13c7243
1
Parent(s):
da06a76
Upload 10 files
Browse files
Los_Angeles_MIDI_Dataset_Search_and_Explore.ipynb
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
"id": "SiTIpPjArIyr"
|
12 |
},
|
13 |
"source": [
|
14 |
-
"# Los Angeles MIDI Dataset: Search and Explore (ver.
|
15 |
"\n",
|
16 |
"***\n",
|
17 |
"\n",
|
@@ -207,7 +207,7 @@
|
|
207 |
"print('=' * 70)\n",
|
208 |
"\n",
|
209 |
"hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',\n",
|
210 |
-
" filename='Los-Angeles-MIDI-Dataset-Ver-
|
211 |
" repo_type=\"dataset\",\n",
|
212 |
" local_dir='/content/LAMD',\n",
|
213 |
" local_dir_use_symlinks=False)\n",
|
@@ -230,7 +230,7 @@
|
|
230 |
"\n",
|
231 |
"print('=' * 70)\n",
|
232 |
"print('Unzipping Los Angeles MIDI Dataset...Please wait...')\n",
|
233 |
-
"!unzip 'Los-Angeles-MIDI-Dataset-Ver-
|
234 |
"print('=' * 70)\n",
|
235 |
"\n",
|
236 |
"print('Done! Enjoy! :)')\n",
|
|
|
11 |
"id": "SiTIpPjArIyr"
|
12 |
},
|
13 |
"source": [
|
14 |
+
"# Los Angeles MIDI Dataset: Search and Explore (ver. 4.0)\n",
|
15 |
"\n",
|
16 |
"***\n",
|
17 |
"\n",
|
|
|
207 |
"print('=' * 70)\n",
|
208 |
"\n",
|
209 |
"hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',\n",
|
210 |
+
" filename='Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip',\n",
|
211 |
" repo_type=\"dataset\",\n",
|
212 |
" local_dir='/content/LAMD',\n",
|
213 |
" local_dir_use_symlinks=False)\n",
|
|
|
230 |
"\n",
|
231 |
"print('=' * 70)\n",
|
232 |
"print('Unzipping Los Angeles MIDI Dataset...Please wait...')\n",
|
233 |
+
"!unzip 'Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip'\n",
|
234 |
"print('=' * 70)\n",
|
235 |
"\n",
|
236 |
"print('Done! Enjoy! :)')\n",
|
MIDI.py
CHANGED
@@ -32,6 +32,8 @@ and put it in your PYTHONPATH. MIDI.py depends on Python3.
|
|
32 |
There is also a call-compatible translation into Lua of this
|
33 |
module: see http://www.pjb.com.au/comp/lua/MIDI.html
|
34 |
|
|
|
|
|
35 |
The "opus" is a direct translation of the midi-file-events, where
|
36 |
the times are delta-times, in ticks, since the previous event.
|
37 |
|
|
|
32 |
There is also a call-compatible translation into Lua of this
|
33 |
module: see http://www.pjb.com.au/comp/lua/MIDI.html
|
34 |
|
35 |
+
Backup web site: https://peterbillam.gitlab.io/miditools/
|
36 |
+
|
37 |
The "opus" is a direct translation of the midi-file-events, where
|
38 |
the times are delta-times, in ticks, since the previous event.
|
39 |
|
Master_MIDI_Dataset_Search_and_Filter.ipynb
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
"id": "SiTIpPjArIyr"
|
12 |
},
|
13 |
"source": [
|
14 |
-
"# Master MIDI Dataset Search and Filter (ver.
|
15 |
"\n",
|
16 |
"***\n",
|
17 |
"\n",
|
@@ -129,13 +129,13 @@
|
|
129 |
{
|
130 |
"cell_type": "code",
|
131 |
"source": [
|
132 |
-
"#@title Download
|
133 |
"print('=' * 70)\n",
|
134 |
"print('Downloading Los Angeles MIDI Dataset...Please wait...')\n",
|
135 |
"print('=' * 70)\n",
|
136 |
"\n",
|
137 |
"hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',\n",
|
138 |
-
" filename='Los-Angeles-MIDI-Dataset-Ver-
|
139 |
" repo_type=\"dataset\",\n",
|
140 |
" local_dir='/content/Main-MIDI-Dataset',\n",
|
141 |
" local_dir_use_symlinks=False)\n",
|
@@ -153,12 +153,12 @@
|
|
153 |
{
|
154 |
"cell_type": "code",
|
155 |
"source": [
|
156 |
-
"#@title Unzip
|
157 |
"%cd /content/Main-MIDI-Dataset/\n",
|
158 |
"\n",
|
159 |
"print('=' * 70)\n",
|
160 |
"print('Unzipping Los Angeles MIDI Dataset...Please wait...')\n",
|
161 |
-
"!unzip 'Los-Angeles-MIDI-Dataset-Ver-
|
162 |
"print('=' * 70)\n",
|
163 |
"\n",
|
164 |
"print('Done! Enjoy! :)')\n",
|
@@ -175,7 +175,7 @@
|
|
175 |
{
|
176 |
"cell_type": "code",
|
177 |
"source": [
|
178 |
-
"#@title Create
|
179 |
"print('=' * 70)\n",
|
180 |
"print('Creating dataset files list...')\n",
|
181 |
"dataset_addr = \"/content/Main-MIDI-Dataset/MIDIs\"\n",
|
@@ -211,7 +211,7 @@
|
|
211 |
{
|
212 |
"cell_type": "code",
|
213 |
"source": [
|
214 |
-
"#@title Load
|
215 |
"print('=' * 70)\n",
|
216 |
"print('Loading LAMDa data...Please wait...')\n",
|
217 |
"print('=' * 70)\n",
|
|
|
11 |
"id": "SiTIpPjArIyr"
|
12 |
},
|
13 |
"source": [
|
14 |
+
"# Master MIDI Dataset Search and Filter (ver. 4.0)\n",
|
15 |
"\n",
|
16 |
"***\n",
|
17 |
"\n",
|
|
|
129 |
{
|
130 |
"cell_type": "code",
|
131 |
"source": [
|
132 |
+
"#@title Download Los Angeles MIDI Dataset\n",
|
133 |
"print('=' * 70)\n",
|
134 |
"print('Downloading Los Angeles MIDI Dataset...Please wait...')\n",
|
135 |
"print('=' * 70)\n",
|
136 |
"\n",
|
137 |
"hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',\n",
|
138 |
+
" filename='Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip',\n",
|
139 |
" repo_type=\"dataset\",\n",
|
140 |
" local_dir='/content/Main-MIDI-Dataset',\n",
|
141 |
" local_dir_use_symlinks=False)\n",
|
|
|
153 |
{
|
154 |
"cell_type": "code",
|
155 |
"source": [
|
156 |
+
"#@title Unzip Los Angeles MIDI Dataset\n",
|
157 |
"%cd /content/Main-MIDI-Dataset/\n",
|
158 |
"\n",
|
159 |
"print('=' * 70)\n",
|
160 |
"print('Unzipping Los Angeles MIDI Dataset...Please wait...')\n",
|
161 |
+
"!unzip 'Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip'\n",
|
162 |
"print('=' * 70)\n",
|
163 |
"\n",
|
164 |
"print('Done! Enjoy! :)')\n",
|
|
|
175 |
{
|
176 |
"cell_type": "code",
|
177 |
"source": [
|
178 |
+
"#@title Create Los Angeles MIDI Dataset files list\n",
|
179 |
"print('=' * 70)\n",
|
180 |
"print('Creating dataset files list...')\n",
|
181 |
"dataset_addr = \"/content/Main-MIDI-Dataset/MIDIs\"\n",
|
|
|
211 |
{
|
212 |
"cell_type": "code",
|
213 |
"source": [
|
214 |
+
"#@title Load Los Angeles MIDI Dataset metadata\n",
|
215 |
"print('=' * 70)\n",
|
216 |
"print('Loading LAMDa data...Please wait...')\n",
|
217 |
"print('=' * 70)\n",
|
TMIDIX.py
CHANGED
@@ -41,7 +41,9 @@ r'''############################################################################
|
|
41 |
# Please see TMIDI 2.3/tegridy-tools repo for full MIDI.py module code
|
42 |
#
|
43 |
# Or you can always download the latest full version from:
|
44 |
-
#
|
|
|
|
|
45 |
#
|
46 |
# Copyright 2020 Peter Billam
|
47 |
#
|
@@ -1622,6 +1624,72 @@ def Tegridy_SONG_to_MIDI_Converter(SONG,
|
|
1622 |
print('Done! Enjoy! :)')
|
1623 |
|
1624 |
return detailed_MIDI_stats
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1625 |
###################################################################################
|
1626 |
|
1627 |
def Tegridy_SONG_to_Full_MIDI_Converter(SONG,
|
|
|
41 |
# Please see TMIDI 2.3/tegridy-tools repo for full MIDI.py module code
|
42 |
#
|
43 |
# Or you can always download the latest full version from:
|
44 |
+
#
|
45 |
+
# https://pjb.com.au/
|
46 |
+
# https://peterbillam.gitlab.io/miditools/
|
47 |
#
|
48 |
# Copyright 2020 Peter Billam
|
49 |
#
|
|
|
1624 |
print('Done! Enjoy! :)')
|
1625 |
|
1626 |
return detailed_MIDI_stats
|
1627 |
+
|
1628 |
+
###################################################################################
|
1629 |
+
|
1630 |
+
def Tegridy_ms_SONG_to_MIDI_Converter(SONG,
|
1631 |
+
output_signature = 'Tegridy TMIDI Module',
|
1632 |
+
track_name = 'Composition Track',
|
1633 |
+
list_of_MIDI_patches = [0, 24, 32, 40, 42, 46, 56, 71, 73, 0, 0, 0, 0, 0, 0, 0],
|
1634 |
+
output_file_name = 'TMIDI-Composition',
|
1635 |
+
text_encoding='ISO-8859-1',
|
1636 |
+
verbose=True):
|
1637 |
+
|
1638 |
+
'''Tegridy milisecond SONG to MIDI Converter
|
1639 |
+
|
1640 |
+
Input: Input ms SONG in TMIDI ms SONG/MIDI.py ms Score format
|
1641 |
+
Output MIDI Track 0 name / MIDI Signature
|
1642 |
+
Output MIDI Track 1 name / Composition track name
|
1643 |
+
List of 16 MIDI patch numbers for output MIDI. Def. is MuseNet compatible patches.
|
1644 |
+
Output file name w/o .mid extension.
|
1645 |
+
Optional text encoding if you are working with text_events/lyrics. This is especially useful for Karaoke. Please note that anything but ISO-8859-1 is a non-standard way of encoding text_events according to MIDI specs.
|
1646 |
+
|
1647 |
+
Output: MIDI File
|
1648 |
+
Detailed MIDI stats
|
1649 |
+
|
1650 |
+
Project Los Angeles
|
1651 |
+
Tegridy Code 2020'''
|
1652 |
+
|
1653 |
+
if verbose:
|
1654 |
+
print('Converting to MIDI. Please stand-by...')
|
1655 |
+
|
1656 |
+
output_header = [1000,
|
1657 |
+
[['set_tempo', 0, 1000000],
|
1658 |
+
['time_signature', 0, 4, 2, 24, 8],
|
1659 |
+
['track_name', 0, bytes(output_signature, text_encoding)]]]
|
1660 |
+
|
1661 |
+
patch_list = [['patch_change', 0, 0, list_of_MIDI_patches[0]],
|
1662 |
+
['patch_change', 0, 1, list_of_MIDI_patches[1]],
|
1663 |
+
['patch_change', 0, 2, list_of_MIDI_patches[2]],
|
1664 |
+
['patch_change', 0, 3, list_of_MIDI_patches[3]],
|
1665 |
+
['patch_change', 0, 4, list_of_MIDI_patches[4]],
|
1666 |
+
['patch_change', 0, 5, list_of_MIDI_patches[5]],
|
1667 |
+
['patch_change', 0, 6, list_of_MIDI_patches[6]],
|
1668 |
+
['patch_change', 0, 7, list_of_MIDI_patches[7]],
|
1669 |
+
['patch_change', 0, 8, list_of_MIDI_patches[8]],
|
1670 |
+
['patch_change', 0, 9, list_of_MIDI_patches[9]],
|
1671 |
+
['patch_change', 0, 10, list_of_MIDI_patches[10]],
|
1672 |
+
['patch_change', 0, 11, list_of_MIDI_patches[11]],
|
1673 |
+
['patch_change', 0, 12, list_of_MIDI_patches[12]],
|
1674 |
+
['patch_change', 0, 13, list_of_MIDI_patches[13]],
|
1675 |
+
['patch_change', 0, 14, list_of_MIDI_patches[14]],
|
1676 |
+
['patch_change', 0, 15, list_of_MIDI_patches[15]],
|
1677 |
+
['track_name', 0, bytes(track_name, text_encoding)]]
|
1678 |
+
|
1679 |
+
output = output_header + [patch_list + SONG]
|
1680 |
+
|
1681 |
+
midi_data = score2midi(output, text_encoding)
|
1682 |
+
detailed_MIDI_stats = score2stats(output)
|
1683 |
+
|
1684 |
+
with open(output_file_name + '.mid', 'wb') as midi_file:
|
1685 |
+
midi_file.write(midi_data)
|
1686 |
+
midi_file.close()
|
1687 |
+
|
1688 |
+
if verbose:
|
1689 |
+
print('Done! Enjoy! :)')
|
1690 |
+
|
1691 |
+
return detailed_MIDI_stats
|
1692 |
+
|
1693 |
###################################################################################
|
1694 |
|
1695 |
def Tegridy_SONG_to_Full_MIDI_Converter(SONG,
|
los_angeles_midi_dataset_search_and_explore.py
CHANGED
@@ -6,7 +6,7 @@ Automatically generated by Colaboratory.
|
|
6 |
Original file is located at
|
7 |
https://colab.research.google.com/github/asigalov61/Los-Angeles-MIDI-Dataset/blob/main/Los_Angeles_MIDI_Dataset_Search_and_Explore.ipynb
|
8 |
|
9 |
-
# Los Angeles MIDI Dataset: Search and Explore (ver.
|
10 |
|
11 |
***
|
12 |
|
@@ -124,7 +124,7 @@ print('Downloading Los Angeles MIDI Dataset...Please wait...')
|
|
124 |
print('=' * 70)
|
125 |
|
126 |
hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',
|
127 |
-
filename='Los-Angeles-MIDI-Dataset-Ver-
|
128 |
repo_type="dataset",
|
129 |
local_dir='/content/LAMD',
|
130 |
local_dir_use_symlinks=False)
|
@@ -138,7 +138,7 @@ print('=' * 70)
|
|
138 |
|
139 |
print('=' * 70)
|
140 |
print('Unzipping Los Angeles MIDI Dataset...Please wait...')
|
141 |
-
!unzip 'Los-Angeles-MIDI-Dataset-Ver-
|
142 |
print('=' * 70)
|
143 |
|
144 |
print('Done! Enjoy! :)')
|
|
|
6 |
Original file is located at
|
7 |
https://colab.research.google.com/github/asigalov61/Los-Angeles-MIDI-Dataset/blob/main/Los_Angeles_MIDI_Dataset_Search_and_Explore.ipynb
|
8 |
|
9 |
+
# Los Angeles MIDI Dataset: Search and Explore (ver. 4.0)
|
10 |
|
11 |
***
|
12 |
|
|
|
124 |
print('=' * 70)
|
125 |
|
126 |
hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',
|
127 |
+
filename='Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip',
|
128 |
repo_type="dataset",
|
129 |
local_dir='/content/LAMD',
|
130 |
local_dir_use_symlinks=False)
|
|
|
138 |
|
139 |
print('=' * 70)
|
140 |
print('Unzipping Los Angeles MIDI Dataset...Please wait...')
|
141 |
+
!unzip 'Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip'
|
142 |
print('=' * 70)
|
143 |
|
144 |
print('Done! Enjoy! :)')
|
master_midi_dataset_search_and_filter.py
CHANGED
@@ -6,7 +6,7 @@ Automatically generated by Colaboratory.
|
|
6 |
Original file is located at
|
7 |
https://colab.research.google.com/github/asigalov61/Los-Angeles-MIDI-Dataset/blob/main/Extras/Master_MIDI_Dataset_Search_and_Filter.ipynb
|
8 |
|
9 |
-
# Master MIDI Dataset Search and Filter (ver.
|
10 |
|
11 |
***
|
12 |
|
@@ -67,13 +67,13 @@ print('Enjoy! :)')
|
|
67 |
|
68 |
"""# (PREP MAIN MIDI DATASET)"""
|
69 |
|
70 |
-
#@title Download
|
71 |
print('=' * 70)
|
72 |
print('Downloading Los Angeles MIDI Dataset...Please wait...')
|
73 |
print('=' * 70)
|
74 |
|
75 |
hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',
|
76 |
-
filename='Los-Angeles-MIDI-Dataset-Ver-
|
77 |
repo_type="dataset",
|
78 |
local_dir='/content/Main-MIDI-Dataset',
|
79 |
local_dir_use_symlinks=False)
|
@@ -82,19 +82,19 @@ print('Done! Enjoy! :)')
|
|
82 |
print('=' * 70)
|
83 |
|
84 |
# Commented out IPython magic to ensure Python compatibility.
|
85 |
-
#@title Unzip
|
86 |
# %cd /content/Main-MIDI-Dataset/
|
87 |
|
88 |
print('=' * 70)
|
89 |
print('Unzipping Los Angeles MIDI Dataset...Please wait...')
|
90 |
-
!unzip 'Los-Angeles-MIDI-Dataset-Ver-
|
91 |
print('=' * 70)
|
92 |
|
93 |
print('Done! Enjoy! :)')
|
94 |
print('=' * 70)
|
95 |
# %cd /content/
|
96 |
|
97 |
-
#@title Create
|
98 |
print('=' * 70)
|
99 |
print('Creating dataset files list...')
|
100 |
dataset_addr = "/content/Main-MIDI-Dataset/MIDIs"
|
@@ -120,7 +120,7 @@ for f in tqdm(filez):
|
|
120 |
print('Done!')
|
121 |
print('=' * 70)
|
122 |
|
123 |
-
#@title Load
|
124 |
print('=' * 70)
|
125 |
print('Loading LAMDa data...Please wait...')
|
126 |
print('=' * 70)
|
|
|
6 |
Original file is located at
|
7 |
https://colab.research.google.com/github/asigalov61/Los-Angeles-MIDI-Dataset/blob/main/Extras/Master_MIDI_Dataset_Search_and_Filter.ipynb
|
8 |
|
9 |
+
# Master MIDI Dataset Search and Filter (ver. 4.0)
|
10 |
|
11 |
***
|
12 |
|
|
|
67 |
|
68 |
"""# (PREP MAIN MIDI DATASET)"""
|
69 |
|
70 |
+
#@title Download Los Angeles MIDI Dataset
|
71 |
print('=' * 70)
|
72 |
print('Downloading Los Angeles MIDI Dataset...Please wait...')
|
73 |
print('=' * 70)
|
74 |
|
75 |
hf_hub_download(repo_id='projectlosangeles/Los-Angeles-MIDI-Dataset',
|
76 |
+
filename='Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip',
|
77 |
repo_type="dataset",
|
78 |
local_dir='/content/Main-MIDI-Dataset',
|
79 |
local_dir_use_symlinks=False)
|
|
|
82 |
print('=' * 70)
|
83 |
|
84 |
# Commented out IPython magic to ensure Python compatibility.
|
85 |
+
#@title Unzip Los Angeles MIDI Dataset
|
86 |
# %cd /content/Main-MIDI-Dataset/
|
87 |
|
88 |
print('=' * 70)
|
89 |
print('Unzipping Los Angeles MIDI Dataset...Please wait...')
|
90 |
+
!unzip 'Los-Angeles-MIDI-Dataset-Ver-4-0-CC-BY-NC-SA.zip'
|
91 |
print('=' * 70)
|
92 |
|
93 |
print('Done! Enjoy! :)')
|
94 |
print('=' * 70)
|
95 |
# %cd /content/
|
96 |
|
97 |
+
#@title Create Los Angeles MIDI Dataset files list
|
98 |
print('=' * 70)
|
99 |
print('Creating dataset files list...')
|
100 |
dataset_addr = "/content/Main-MIDI-Dataset/MIDIs"
|
|
|
120 |
print('Done!')
|
121 |
print('=' * 70)
|
122 |
|
123 |
+
#@title Load Los Angeles MIDI Dataset metadata
|
124 |
print('=' * 70)
|
125 |
print('Loading LAMDa data...Please wait...')
|
126 |
print('=' * 70)
|