admin commited on
Commit
b4bbbc2
1 Parent(s): 68d20f1

upl scripts

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. README.md +153 -1
  3. instrument_timbre.py +193 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ rename.sh
README.md CHANGED
@@ -1,3 +1,155 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-nc-nd-4.0
3
+ task_categories:
4
+ - audio-classification
5
+ language:
6
+ - zh
7
+ - en
8
+ tags:
9
+ - music
10
+ - art
11
+ pretty_name: Musical Instruments Timbre Evaluation Database
12
+ size_categories:
13
+ - n<1K
14
+ viewer: false
15
  ---
16
+
17
+ # Dataset Card for Chinese Musical Instruments Timbre Evaluation Database
18
+ The raw dataset is sourced from the [National Musical Instruments Timbre Evaluation Dataset](https://ccmusic-database.github.io/en/database/ccm.html#shou4), which includes subjective timbre evaluation scores using 16 terms such as bright, dark, raspy, etc., evaluated across 37 Chinese instruments and 24 Western instruments by 14 participants with musical backgrounds in a subjective evaluation experiment. Additionally, it contains 10 spectrogram analysis reports for 10 instruments.
19
+
20
+ Based on the aforementioned raw dataset, after data processing, we have constructed the `default subset` of the current integrated version of the dataset, dividing the Chinese section and the Western section into two splits. Each split consists of multiple data entries, with each entry structured across 18 columns. The Chinese split includes 37 entries, while the Western split comprises 24 entries. The first column of each data entry presents the instrument recordings in .wav format, sampled at a rate of 44,100 Hz. The second column provides the Chinese pinyin or English name of the instrument. The following 16 columns correspond to the 10-point scores of the 16 terms. This dataset is suitable for conducting timbre analysis of musical instruments and can also be utilized for various single or multiple regression tasks related to term scoring. The data structure of the default subset can be viewed in the [viewer](https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/dataPeview). As the current dataset has been cited and used in two published articles, the construction of `eval subset` has been omitted.
21
+
22
+ ## Viewer
23
+ <https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/dataPeview>
24
+
25
+ ## Dataset Structure
26
+ <style>
27
+ .datastructure td {
28
+ vertical-align: middle !important;
29
+ text-align: center;
30
+ }
31
+ .datastructure th {
32
+ text-align: center;
33
+ }
34
+ </style>
35
+
36
+ <table class="datastructure">
37
+ <tr>
38
+ <th>audio</th>
39
+ <th>mel</th>
40
+ <th>instrument_name</th>
41
+ <th>slim / bright / ... / turbid (16 colums)</th>
42
+ </tr>
43
+ <tr>
44
+ <td>.wav, 44100Hz</td>
45
+ <td>.jpg, 44100Hz</td>
46
+ <td>string</td>
47
+ <td>float(0-10)</td>
48
+ </tr>
49
+ <tr>
50
+ <td>...</td>
51
+ <td>...</td>
52
+ <td>...</td>
53
+ <td>...</td>
54
+ </tr>
55
+ </table>
56
+
57
+ ### Data Instances
58
+ .zip(.wav), .csv
59
+
60
+ ### Data Fields
61
+ Chinese traditional instruments / Western instruments
62
+
63
+ ### Data Splits
64
+ Chinese, Western
65
+
66
+ ## Dataset Description
67
+ - **Homepage:** <https://ccmusic-database.github.io>
68
+ - **Repository:** <https://huggingface.co/datasets/ccmusic-database/CMITE>
69
+ - **Paper:** <https://doi.org/10.5281/zenodo.5676893>
70
+ - **Leaderboard:** <https://ccmusic-database.github.io/team.html>
71
+ - **Point of Contact:** <https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre>
72
+
73
+ ### Dataset Summary
74
+ During the integration, we have crafted the Chinese part and the Non-Chinese part into two splits. Each split is composed of multiple data entries, with each entry structured across 18 columns. The Chinese split encompasses 37 entries, while the Non-Chinese split includes 24 entries. The premier column of each data entry presents the instrument recordings in the .wav format, sampled at a rate of 22,050 Hz. The second column provides the Chinese pinyin or English name of the instrument. The subsequent 16 columns correspond to the 10-point score of the 16 terms. This dataset is suitable for conducting timber analysis of musical instruments and can also be utilized for various single or multiple regression tasks related to term scoring.
75
+
76
+ ### Supported Tasks and Leaderboards
77
+ Musical Instruments Timbre Evaluation
78
+
79
+ ### Languages
80
+ Chinese, English
81
+
82
+ ## Usage
83
+ ```python
84
+ from datasets import load_dataset
85
+
86
+ dataset = load_dataset("ccmusic-database/instrument_timbre")
87
+ for item in ds["Chinese"]:
88
+ print(item)
89
+
90
+ for item in ds["Western"]:
91
+ print(item)
92
+ ```
93
+
94
+ ## Maintenance
95
+ ```bash
96
+ GIT_LFS_SKIP_SMUDGE=1 git clone [email protected]:datasets/ccmusic-database/instrument_timbre
97
+ cd instrument_timbre
98
+ ```
99
+
100
+ ## Dataset Creation
101
+ ### Curation Rationale
102
+ Lack of a dataset for musical instruments timbre evaluation
103
+
104
+ ### Source Data
105
+ #### Initial Data Collection and Normalization
106
+ Zhaorui Liu, Monan Zhou
107
+
108
+ #### Who are the source language producers?
109
+ Students from CCMUSIC
110
+
111
+ ### Annotations
112
+ #### Annotation process
113
+ Subjective timbre evaluation scores of 16 subjective timbre evaluation terms (such as bright, dark, raspy) on 37 Chinese national and 24 Non-Chinese terms given by 14 participants in a subjective evaluation experiment
114
+
115
+ #### Who are the annotators?
116
+ Students from CCMUSIC
117
+
118
+ ### Personal and Sensitive Information
119
+ None
120
+
121
+ ## Considerations for Using the Data
122
+ ### Social Impact of Dataset
123
+ Promoting the development of AI in the music industry
124
+
125
+ ### Discussion of Biases
126
+ Only for traditional instruments
127
+
128
+ ### Other Known Limitations
129
+ Limited data
130
+
131
+ ## Additional Information
132
+ ### Dataset Curators
133
+ Zijin Li
134
+
135
+ ### Evaluation
136
+ #### For Chinese instruments
137
+ [Yiliang, J. et al. (2020) ‘Analysis of Chinese Musical Instrument Timbre Based on Objective Features’, Journal of Fudan University(Natural Science), pp. 346-353+359. doi:10.15943/j.cnki.fdxb-jns.2020.03.014.](https://kns.cnki.net/kcms/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2020&filename=FDXB202003014&uniplatform=NZKPT&v=85qLeLUyrDt%25mmd2Btak%25mmd2BN90N7vYZSv%25mmd2BVc1EfPmaYcvpvrgY1XkL215gYG4J%25mmd2FD09viR0w)
138
+ #### For Non-Chinese instruments
139
+ [Jiang, Wei et al. “Analysis and Modeling of Timbre Perception Features of Chinese Musical Instruments.” 2019 IEEE/ACIS 18th International Conference on Computer and Information Science (ICIS) (2019): 191-195.](https://ieeexplore.ieee.org/document/8940168)
140
+
141
+ ### Citation Information
142
+ ```bibtex
143
+ @dataset{zhaorui_liu_2021_5676893,
144
+ author = {Monan Zhou, Shenyang Xu, Zhaorui Liu, Zhaowen Wang, Feng Yu, Wei Li and Baoqiang Han},
145
+ title = {CCMusic: an Open and Diverse Database for Chinese and General Music Information Retrieval Research},
146
+ month = {mar},
147
+ year = {2024},
148
+ publisher = {HuggingFace},
149
+ version = {1.2},
150
+ url = {https://huggingface.co/ccmusic-database}
151
+ }
152
+ ```
153
+
154
+ ### Contributions
155
+ Provide a dataset for musical instruments' timbre evaluation
instrument_timbre.py ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import datasets
3
+ import pandas as pd
4
+ from datasets.tasks import AudioClassification
5
+
6
+
7
+ _NAMES = [
8
+ # Chinese 0-36
9
+ "gao_hu",
10
+ "er_hu",
11
+ "zhong_hu",
12
+ "ge_hu",
13
+ "di_yin_ge_hu",
14
+ "jing_hu",
15
+ "ban_hu",
16
+ "bang_di",
17
+ "qu_di",
18
+ "xin_di",
19
+ "da_di",
20
+ "gao_yin_sheng",
21
+ "zhong_yin_sheng",
22
+ "di_yin_sheng",
23
+ "gao_yin_suo_na",
24
+ "zhong_yin_suo_na",
25
+ "ci_zhong_yin_suo_na",
26
+ "di_yin_suo_na",
27
+ "gao_yin_guan",
28
+ "zhong_yin_guan",
29
+ "di_yin_guan",
30
+ "bei_di_yin_guan",
31
+ "ba_wu",
32
+ "xun",
33
+ "xiao",
34
+ "liu_qin",
35
+ "xiao_ruan",
36
+ "pi_pa",
37
+ "yang_qin",
38
+ "zhong_ruan",
39
+ "da_ruan",
40
+ "gu_zheng",
41
+ "gu_qin",
42
+ "kong_hou",
43
+ "san_xian",
44
+ "yun_luo",
45
+ "bian_zhong",
46
+ # Western 37-60
47
+ "violin",
48
+ "viola",
49
+ "cello",
50
+ "double_bass",
51
+ "piccolo",
52
+ "flute",
53
+ "oboe",
54
+ "clarinet",
55
+ "bassoon",
56
+ "saxophone",
57
+ "trumpet",
58
+ "trombone",
59
+ "horn",
60
+ "tuba",
61
+ "harp",
62
+ "tubular_bells",
63
+ "bells",
64
+ "xylophone",
65
+ "vibraphone",
66
+ "marimba",
67
+ "piano",
68
+ "clavichord",
69
+ "accordion",
70
+ "organ",
71
+ ]
72
+
73
+ _DBNAME = os.path.basename(__file__).split(".")[0]
74
+
75
+ _DOMAIN = f"https://www.modelscope.cn/api/v1/datasets/ccmusic-database/{_DBNAME}/repo?Revision=master&FilePath=data"
76
+
77
+ _HOMEPAGE = f"https://www.modelscope.cn/datasets/ccmusic-database/{_DBNAME}"
78
+
79
+
80
+ _URLS = {
81
+ "audio": f"{_DOMAIN}/audio.zip",
82
+ "mel": f"{_DOMAIN}/mel.zip",
83
+ "Chinese": f"{_DOMAIN}/Chinese.csv",
84
+ "Western": f"{_DOMAIN}/Western.csv",
85
+ }
86
+
87
+
88
+ class instrument_timbre(datasets.GeneratorBasedBuilder):
89
+ def _info(self):
90
+ return datasets.DatasetInfo(
91
+ features=datasets.Features(
92
+ {
93
+ "audio": datasets.Audio(sampling_rate=44100),
94
+ "mel": datasets.Image(),
95
+ "instrument": datasets.features.ClassLabel(names=_NAMES),
96
+ "slim": datasets.Value("float32"),
97
+ "bright": datasets.Value("float32"),
98
+ "dim": datasets.Value("float32"),
99
+ "sharp": datasets.Value("float32"),
100
+ "thick": datasets.Value("float32"),
101
+ "thin": datasets.Value("float32"),
102
+ "solid": datasets.Value("float32"),
103
+ "clear": datasets.Value("float32"),
104
+ "dry": datasets.Value("float32"),
105
+ "plump": datasets.Value("float32"),
106
+ "rough": datasets.Value("float32"),
107
+ "pure": datasets.Value("float32"),
108
+ "hoarse": datasets.Value("float32"),
109
+ "harmonious": datasets.Value("float32"),
110
+ "soft": datasets.Value("float32"),
111
+ "turbid": datasets.Value("float32"),
112
+ }
113
+ ),
114
+ supervised_keys=("audio", "instrument"),
115
+ homepage=_HOMEPAGE,
116
+ license="CC-BY-NC-ND",
117
+ version="1.2.0",
118
+ task_templates=[
119
+ AudioClassification(
120
+ task="audio-classification",
121
+ audio_column="audio",
122
+ label_column="instrument",
123
+ )
124
+ ],
125
+ )
126
+
127
+ def _split_generators(self, dl_manager):
128
+ audio_files = dl_manager.download_and_extract(_URLS["audio"])
129
+ mel_files = dl_manager.download_and_extract(_URLS["mel"])
130
+ cn_ins_eval = dl_manager.download(_URLS["Chinese"])
131
+ en_ins_eval = dl_manager.download(_URLS["Western"])
132
+ cn_labels = pd.read_csv(cn_ins_eval, index_col="instrument_id")
133
+ en_labels = pd.read_csv(en_ins_eval, index_col="instrument_id")
134
+ cn_dataset, en_dataset = {}, {}
135
+ for path in dl_manager.iter_files([audio_files]):
136
+ fname: str = os.path.basename(path)
137
+ i = int(fname.split(".wa")[0]) - 1
138
+ if fname.endswith(".wav"):
139
+ region = os.path.basename(os.path.dirname(path))
140
+ labels = cn_labels if region == "Chinese" else en_labels
141
+ data = {
142
+ "audio": path,
143
+ "mel": "",
144
+ "instrument": labels.iloc[i]["instrument_name"],
145
+ "slim": labels.iloc[i]["slim"],
146
+ "bright": labels.iloc[i]["bright"],
147
+ "dim": labels.iloc[i]["dim"],
148
+ "sharp": labels.iloc[i]["sharp"],
149
+ "thick": labels.iloc[i]["thick"],
150
+ "thin": labels.iloc[i]["thin"],
151
+ "solid": labels.iloc[i]["solid"],
152
+ "clear": labels.iloc[i]["clear"],
153
+ "dry": labels.iloc[i]["dry"],
154
+ "plump": labels.iloc[i]["plump"],
155
+ "rough": labels.iloc[i]["rough"],
156
+ "pure": labels.iloc[i]["pure"],
157
+ "hoarse": labels.iloc[i]["hoarse"],
158
+ "harmonious": labels.iloc[i]["harmonious"],
159
+ "soft": labels.iloc[i]["soft"],
160
+ "turbid": labels.iloc[i]["turbid"],
161
+ }
162
+ if region == "Chinese":
163
+ cn_dataset[i] = data
164
+ else:
165
+ en_dataset[i] = data
166
+
167
+ for path in dl_manager.iter_files([mel_files]):
168
+ fname = os.path.basename(path)
169
+ i = int(fname.split(".jp")[0]) - 1
170
+ if fname.endswith(".jpg"):
171
+ if os.path.basename(os.path.dirname(path)) == "Chinese":
172
+ cn_dataset[i]["mel"] = path
173
+ else:
174
+ en_dataset[i]["mel"] = path
175
+
176
+ return [
177
+ datasets.SplitGenerator(
178
+ name="Chinese",
179
+ gen_kwargs={
180
+ "files": [cn_dataset[k] for k in sorted(cn_dataset)],
181
+ },
182
+ ),
183
+ datasets.SplitGenerator(
184
+ name="Western",
185
+ gen_kwargs={
186
+ "files": [en_dataset[k] for k in sorted(en_dataset)],
187
+ },
188
+ ),
189
+ ]
190
+
191
+ def _generate_examples(self, files):
192
+ for i, path in enumerate(files):
193
+ yield i, path