MuGeminorum commited on
Commit
ed686c6
1 Parent(s): 19e050b
README.md CHANGED
@@ -13,16 +13,19 @@ size_categories:
13
  - n<1K
14
  viewer: false
15
  ---
 
16
  # Dataset Card for Chinese Musical Instruments Timbre Evaluation Database
 
 
17
  ## Dataset Description
18
  - **Homepage:** <https://ccmusic-database.github.io>
19
  - **Repository:** <https://huggingface.co/datasets/ccmusic-database/CMITE>
20
  - **Paper:** <https://doi.org/10.5281/zenodo.5676893>
21
  - **Leaderboard:** <https://ccmusic-database.github.io/team.html>
22
- - **Point of Contact:** N/A
23
 
24
  ### Dataset Summary
25
- This database contains 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.
26
 
27
  ### Supported Tasks and Leaderboards
28
  Musical Instruments Timbre Evaluation
@@ -30,7 +33,30 @@ Musical Instruments Timbre Evaluation
30
  ### Languages
31
  Chinese, English
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  ## Dataset Structure
 
 
 
 
 
34
  ### Data Instances
35
  .zip(.wav), .csv
36
 
@@ -107,18 +133,17 @@ SOFTWARE.
107
  ```
108
 
109
  ### Citation Information
110
- ```
111
  @dataset{zhaorui_liu_2021_5676893,
112
- author = {Zhaorui Liu, Monan Zhou, Shenyang Xu, Yuan Wang, Zhaowen Wang, Wei Li and Zijin Li},
113
- title = {CCMUSIC DATABASE: A Music Data Sharing Platform for Computational Musicology Research},
114
- month = {nov},
115
- year = {2021},
116
- publisher = {Zenodo},
117
- version = {1.1},
118
- doi = {10.5281/zenodo.5676893},
119
- url = {https://doi.org/10.5281/zenodo.5676893}
120
  }
121
  ```
122
 
123
  ### Contributions
124
- Provide a dataset for musical instruments timbre evaluation
 
13
  - n<1K
14
  viewer: false
15
  ---
16
+
17
  # Dataset Card for Chinese Musical Instruments Timbre Evaluation Database
18
+ The raw dataset encompasses subjective timbre evaluation scores comprising 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 includes 10 reports on spectrogram analysis of 10 instruments.
19
+
20
  ## Dataset Description
21
  - **Homepage:** <https://ccmusic-database.github.io>
22
  - **Repository:** <https://huggingface.co/datasets/ccmusic-database/CMITE>
23
  - **Paper:** <https://doi.org/10.5281/zenodo.5676893>
24
  - **Leaderboard:** <https://ccmusic-database.github.io/team.html>
25
+ - **Point of Contact:** <https://www.modelscope.cn/datasets/ccmusic/instrument_timbre>
26
 
27
  ### Dataset Summary
28
+ 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.
29
 
30
  ### Supported Tasks and Leaderboards
31
  Musical Instruments Timbre Evaluation
 
33
  ### Languages
34
  Chinese, English
35
 
36
+ ## Usage
37
+ ```python
38
+ from datasets import load_dataset
39
+
40
+ dataset = load_dataset("ccmusic-database/instrument_timbre")
41
+ for item in ds["Chinese"]:
42
+ print(item)
43
+
44
+ for item in ds["Non_Chinese"]:
45
+ print(item)
46
+ ```
47
+
48
+ ## Maintenance
49
+ ```bash
50
+ GIT_LFS_SKIP_SMUDGE=1 git clone git@hf.co:datasets/ccmusic-database/instrument_timbre
51
+ cd instrument_timbre
52
+ ```
53
+
54
  ## Dataset Structure
55
+ | audio(.wav, 22050Hz) | mel(.jpg, 22050Hz) | instrument_name | slim / bright / ... / turbid |
56
+ | :----------------------------------: | :-----------------------: | :-------------: | :--------------------------: |
57
+ | <audio controls src="./data/36.wav"> | <img src="./data/36.jpg"> | string | float(0-10) |
58
+ | ... | ... | ... | ... |
59
+
60
  ### Data Instances
61
  .zip(.wav), .csv
62
 
 
133
  ```
134
 
135
  ### Citation Information
136
+ ```bibtex
137
  @dataset{zhaorui_liu_2021_5676893,
138
+ author = {Monan Zhou, Shenyang Xu, Zhaorui Liu, Zhaowen Wang, Feng Yu, Wei Li and Baoqiang Han},
139
+ title = {CCMusic: an Open and Diverse Database for Chinese and General Music Information Retrieval Research},
140
+ month = {mar},
141
+ year = {2024},
142
+ publisher = {HuggingFace},
143
+ version = {1.2},
144
+ url = {https://huggingface.co/ccmusic-database}
 
145
  }
146
  ```
147
 
148
  ### Contributions
149
+ Provide a dataset for musical instruments' timbre evaluation
data/{Chinese.zip → 36.jpg} RENAMED
File without changes
data/{Non-Chinese.zip → 36.wav} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7dfd960d2293735824bcba1600c362a454bac77d4090d7e47db554c22f6c8a33
3
- size 70292202
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fb2599805b354e5bf43d17e0fb48a839f9f720ed9d25e0609a9ecf20e64279d
3
+ size 719756
data/Chinese.csv DELETED
@@ -1,38 +0,0 @@
1
- instrument_id,instrument_name,slim,bright,dim,sharp,thick,thin,solid,clear,dry,plump,rough,pure,hoarse,harmonious,soft,turbid
2
- 1,gao_hu,6.470588235,6.676470588,3.411764706,7.176470588,2.764705882,6.588235294,3.176470588,6.088235294,6.823529412,3.205882353,5.617647059,4.676470588,5.617647059,4.647058824,3.441176471,4.323529412
3
- 2,er_hu,5.970588235,6.176470588,3.823529412,5.970588235,3.441176471,5.588235294,4.117647059,5.441176471,5.264705882,4.264705882,4.382352941,4.882352941,4.911764706,6.176470588,5.205882353,4.323529412
4
- 3,zhong_hu,4.411764706,4.941176471,4.852941176,4.882352941,5.058823529,4.588235294,5.088235294,4.882352941,5.294117647,5.205882353,5.117647059,5.029411765,4.941176471,5.852941176,4.882352941,4.441176471
5
- 4,ge_hu,2.647058824,2.970588235,6.764705882,2.617647059,7.588235294,2.588235294,7.558823529,2.705882353,3.235294118,7.352941176,4.735294118,5.647058824,4.117647059,7.088235294,7.176470588,6.147058824
6
- 5,di_yin_ge_hu,1.676470588,1.470588235,8.088235294,1.794117647,8.764705882,1.558823529,8.647058824,1.117647059,4.205882353,7.294117647,6.941176471,3,6.794117647,3.617647059,3.323529412,8
7
- 6,jing_hu,7.588235294,7.676470588,2.205882353,8.058823529,1.970588235,7.205882353,2.705882353,7.882352941,5.823529412,3.852941176,3.323529412,6.235294118,3.823529412,5,3.676470588,2.441176471
8
- 7,ban_hu,7.441176471,7.529411765,2.264705882,8.323529412,2.088235294,7.205882353,2.411764706,7.558823529,6.529411765,2.941176471,5.735294118,4.705882353,6.264705882,3.941176471,2.823529412,3.294117647
9
- 8,bang_di,8.323529412,8.588235294,1.5,8.411764706,1.411764706,7.970588235,1.529411765,8.735294118,5.147058824,3.117647059,3.029411765,6.705882353,3.382352941,5.647058824,2.970588235,1.911764706
10
- 9,qu_di,6.264705882,6.878787879,2.970588235,6.294117647,3.176470588,6.029411765,3.382352941,6.911764706,4.294117647,4.147058824,2.764705882,6.617647059,3.441176471,7.058823529,5.294117647,2.558823529
11
- 10,xin_di,4.764705882,4.647058824,5.272727273,4.176470588,4.852941176,4.735294118,4.558823529,4.705882353,4,4.911764706,4.558823529,5.264705882,5.029411765,5.882352941,6.205882353,5.235294118
12
- 11,da_di,5.058823529,5.735294118,4.205882353,4.588235294,4.411764706,4.941176471,4.441176471,5.411764706,3.382352941,5.235294118,3.823529412,6.029411765,3.852941176,6.588235294,6.176470588,4.676470588
13
- 12,gao_yin_sheng,5.617647059,6.117647059,3.96969697,5.882352941,4.235294118,5.941176471,3.970588235,5.147058824,4.970588235,4.5,4.470588235,5.529411765,4.441176471,5.176470588,4.764705882,4.352941176
14
- 13,zhong_yin_sheng,3.794117647,3.617647059,6.176470588,3.852941176,6.323529412,4.117647059,6.029411765,3.205882353,4.058823529,5.5,4.441176471,5.03030303,3.941176471,5.382352941,5.735294118,5.647058824
15
- 14,di_yin_sheng,2.882352941,3.029411765,6.588235294,2.970588235,6.764705882,3.529411765,6.676470588,2.705882353,3.764705882,6.176470588,5,4.088235294,4.558823529,5.470588235,4.705882353,6.441176471
16
- 15,gao_yin_suo_na,7.176470588,7.588235294,2.794117647,7.735294118,2.441176471,7.264705882,2.941176471,7.352941176,6.441176471,4.333333333,4.705882353,5.242424242,5.323529412,3.941176471,2.794117647,3.235294118
17
- 16,zhong_yin_suo_na,4.352941176,5.911764706,4.352941176,6.117647059,3.970588235,6.205882353,4.588235294,5.029411765,7.029411765,4.558823529,5.588235294,4.705882353,5.882352941,3.617647059,2.764705882,4.117647059
18
- 17,ci_zhong_yin_suo_na,3.794117647,4.852941176,5.558823529,5.352941176,4.735294118,5.852941176,4.941176471,3.705882353,7.529411765,4.411764706,6.294117647,4.088235294,6.5,2.676470588,2.470588235,5.058823529
19
- 18,di_yin_suo_na,4.845371972,5.543691675,6.411764706,4.411764706,6.147058824,4.294117647,6.529411765,2.676470588,6.941176471,5.205882353,6.676470588,3.794117647,6.352941176,3.029411765,2.205882353,6.205882353
20
- 19,gao_yin_guan,5.941176471,6,4.470588235,7.235294118,3.5,6.352941176,3.470588235,5.323529412,7.676470588,3.529411765,6.911764706,2.794117647,7.382352941,2.147058824,2.147058824,5.323529412
21
- 20,zhong_yin_guan,4.794117647,5.382352941,4.852941176,5.029411765,5.088235294,4.764705882,5,4.5,4.5,5.382352941,5.176470588,4.852941176,4.970588235,5.058823529,5.264705882,4.823529412
22
- 21,di_yin_guan,3.088235294,3.176470588,6.176470588,3.764705882,7.029411765,3.529411765,7.235294118,2.735294118,4.176470588,6.617647059,5.882352941,4.411764706,6,5.117647059,4.441176471,6.794117647
23
- 22,bei_di_yin_guan,2.176470588,2.235294118,7.147058824,3.235294118,7.911764706,2.941176471,7.941176471,2.058823529,4.352941176,6.705882353,6.911764706,3.029411765,6.382352941,4.205882353,3.470588235,7.617647059
24
- 23,ba_wu,5.181818182,5.558823529,3.882352941,4.264705882,4.470588235,4.411764706,4.735294118,6.088235294,2.735294118,5.794117647,3.058823529,6.794117647,3.470588235,6.970588235,5.735294118,3.588235294
25
- 24,xun,4.647058824,3.323529412,6.529411765,3.205882353,5.147058824,4.911764706,4.323529412,3.382352941,4.676470588,4.5,5.794117647,4.176470588,6.823529412,4.470588235,6.264705882,6.5
26
- 25,xiao,4.882352941,4.382352941,5.676470588,3.5,5.205882353,4.529411765,4.705882353,4.058823529,3.794117647,5.352941176,3.941176471,5.911764706,4.411764706,6.794117647,7.147058824,5.235294118
27
- 26,liu_qin,6.882352941,7.323529412,3,6.352941176,3.382352941,6.029411765,3.088235294,7.5,4,5.235294118,3.441176471,5.941176471,3.058823529,6.363636364,4.882352941,3.058823529
28
- 27,xiao_ruan,6.882352941,7.382352941,2.911764706,6.264705882,3.117647059,6.176470588,2.970588235,7.647058824,3.647058824,5.088235294,3.264705882,6.147058824,3.294117647,6.588235294,5,2.794117647
29
- 28,pi_pa,7,6.941176471,3.323529412,5.794117647,3.264705882,6.352941176,2.705882353,7.205882353,4.323529412,4.235294118,4.117647059,5.235294118,4.176470588,5.705882353,4.411764706,3.352941176
30
- 29,yang_qin,5.794117647,6.5,3.176470588,5.058823529,4.235294118,4.647058824,4.147058824,6.529411765,2.852941176,5.676470588,3.617647059,5.323529412,3.176470588,6.647058824,5.205882353,5.147058824
31
- 30,zhong_ruan,4.470588235,5.264705882,4.941176471,3.794117647,6.147058824,3.588235294,6.088235294,5.294117647,2.882352941,6.647058824,4.147058824,5.676470588,3.176470588,6.529411765,5.617647059,5.352941176
32
- 31,da_ruan,3.088235294,4.088235294,5.823529412,2.588235294,7.382352941,2.676470588,7.5,3.705882353,2.029411765,7.705882353,3.411764706,6.764705882,2.411764706,7.529411765,6.911764706,5.529411765
33
- 32,gu_zheng,5.764705882,6.441176471,3.529411765,5.176470588,4.176470588,5.382352941,4.205882353,6.558823529,3.617647059,5.852941176,3.529411765,5.941176471,3.176470588,6.294117647,5.212121212,3.764705882
34
- 33,gu_qin,3.764705882,4,5.735294118,3.882352941,6.205882353,4.147058824,6.088235294,4.088235294,4.235294118,6.352941176,5.382352941,4.5,4.852941176,4.735294118,5.121212121,5.764705882
35
- 34,kong_hou,5.088235294,5.441176471,4.294117647,3.470588235,5.941176471,3.382352941,5.941176471,5.235294118,2.617647059,7.088235294,3.205882353,6.941176471,2.205882353,7.647058824,7.294117647,4.5
36
- 35,san_xian,5.352941176,4.823529412,4.676470588,4.676470588,3.705882353,6.264705882,3.647058824,5.411764706,6.117647059,3.676470588,6.470588235,3.352941176,5.676470588,4.382352941,3.5,5
37
- 36,yun_luo,6.441176471,6.735294118,3.441176471,6.382352941,2.764705882,7.205882353,2.588235294,7.382352941,5.176470588,2.794117647,4.764705882,5.882352941,4.235294118,4.029411765,4.029411765,4.264705882
38
- 37,bian_zhong,5.205882353,4.882352941,5,4.794117647,4.705882353,5.5,4.205882353,5.852941176,4.676470588,3.882352941,5,5.794117647,4.588235294,4.647058824,5.088235294,5.941176471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/Non-Chinese.csv DELETED
@@ -1,25 +0,0 @@
1
- instrument_id,instrument_name,slim,bright,dim,sharp,thick,thin,solid,clear,dry,plump,rough,pure,hoarse,harmonious,soft,turbid
2
- 1,violin,5.2,5.3,3.4,4.1,4.1,3.7,5,4.5,3.9,6.4,3.5,6,4.1,4.5,6.4,6
3
- 2,viola,3.5,4.4,4.4,3.4,6.2,2.9,6.3,3.6,3.3,7.1,4.2,5.6,4.5,5.2,6.3,6.8
4
- 3,cello,2.7,3.1,5.5,2.3,7.6,1.9,7.6,2.3,2.8,7.8,4.7,6.3,4.5,6,6.8,7.2
5
- 4,double_bass,1.6,1,8.5,1.3,8.8,1.8,8.7,1.1,3.2,6.6,7.6,3.9,6.4,8.1,3,3.8
6
- 5,piccolo,7.2,8,2,7.9,2.5,7.1,3,7.5,3.7,3.5,3.1,5.5,4.1,3.6,5.9,5.1
7
- 6,flute,6.6,6.5,2.9,6.9,3.4,6,3,6.9,3.6,4.7,2.7,5.8,2.8,3.3,6.7,6.6
8
- 7,oboe,5.9,6.5,2.9,6.1,3.1,6.4,3.7,5.7,4.1,5.3,3.2,6,3.6,3.5,6.4,6.4
9
- 8,clarinet,4.2,4.8,4.5,4.3,5.9,4.5,6.2,3.9,3.6,6.5,3.7,6.6,3.5,5,7.2,7.2
10
- 9,bassoon,2.1,2.3,7.1,2.3,7.7,4.5,8.1,1.9,5.7,6.4,7.4,3,7,7.6,3.1,3.9
11
- 10,saxophone,3.2,4.3,6.1,3.3,7.3,4.3,6.9,3.1,4.6,5.6,6.6,5,6.3,7.2,3.6,5.1
12
- 11,trumpet,5.5,7.1,2.4,7.2,3,6,3.8,6.1,5.7,4.2,6.3,3.4,5.8,3.9,3.6,2.1
13
- 12,trombone,3.5,4.8,5,4.7,5.6,3.4,6.7,3.8,4.8,6.2,6.5,4.2,4.9,5.7,5,4.2
14
- 13,horn,2.4,2.9,6.5,3.6,7.4,3,7.6,2.4,6.1,6,6.6,4.1,5.9,7.7,4.3,4.3
15
- 14,tuba,1.2,1,8.7,1.5,8.6,1.6,8.6,1,5.7,7.4,7.6,3.5,7.1,8.6,5,5.2
16
- 15,harp,5.3,5.6,3.8,4,4.1,4.2,5,6,2.9,6.1,2.7,7.5,2.9,3.9,7.2,6.9
17
- 16,tubular_bells,5.5,6.7,2.4,6.1,2.7,7.4,2.5,7.6,6.3,3.2,6.1,3,4.3,5.9,2.5,2.1
18
- 17,bells,8.8,8.7,1,8.5,1,8.7,1,9,5.7,2.5,1.7,8.6,2.3,1.3,7.2,3.4
19
- 18,xylophone,6,6.5,2.4,6.8,1.8,8,2,8,5.2,3,2.9,7.9,2.1,1.9,5.4,4.1
20
- 19,vibraphone,5.5,6.9,2,5.9,2.7,6.3,3.5,7.8,3.2,5.5,2.3,7.1,2.1,3.9,7.2,6
21
- 20,marimba,3.8,4.6,4.8,4.6,5,4.6,5.7,5.7,4.7,5,3.4,5.8,3.4,4.4,6.3,6
22
- 21,piano,3,4.5,4.8,3.7,5.9,3.5,6.1,5.1,3.6,6.8,3.9,6.8,3.3,4.3,7.6,6.1
23
- 22,clavichord,3.8,5.9,3.4,6.7,4.1,6.8,3.9,5.3,5.2,4.4,6.6,2.8,7.9,6.9,3.5,2.1
24
- 23,accordion,4.7,6.5,2.6,5.8,4.6,5.3,4.3,5.1,3.2,6.6,4.9,5.1,3.8,4.8,7.2,4.5
25
- 24,organ,3.1,6.3,3.5,5.7,6.6,4.3,5.9,2.8,3.6,7.6,4.9,4.1,5.4,7.5,5.6,4.5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
instrument_timbre.py CHANGED
@@ -6,41 +6,99 @@ from datasets.tasks import AudioClassification
6
 
7
  _NAMES = [
8
  # Chinese
9
- 'gao_hu', 'er_hu', 'zhong_hu', 'ge_hu', 'di_yin_ge_hu', 'jing_hu', 'ban_hu', 'bang_di', 'qu_di', 'xin_di', 'da_di',
10
- 'gao_yin_sheng', 'zhong_yin_sheng', 'di_yin_sheng', 'gao_yin_suo_na', 'zhong_yin_suo_na', 'ci_zhong_yin_suo_na',
11
- 'di_yin_suo_na', 'gao_yin_guan', 'zhong_yin_guan', 'di_yin_guan', 'bei_di_yin_guan', 'ba_wu', 'xun', 'xiao', 'liu_qin',
12
- 'xiao_ruan', 'pi_pa', 'yang_qin', 'zhong_ruan', 'da_ruan', 'gu_zheng', 'gu_qin', 'kong_hou', 'san_xian', 'yun_luo',
13
- 'bian_zhong',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  # Non-Chinese
15
- 'violin', 'viola', 'cello', 'double_bass', 'piccolo', 'flute', 'oboe', 'clarinet', 'bassoon', 'saxophone', 'trumpet',
16
- 'trombone', 'horn', 'tuba', 'harp', 'tubular_bells', 'bells', 'xylophone', 'vibraphone', 'marimba', 'piano',
17
- 'clavichord', 'accordion', 'organ'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ]
19
 
20
- _HOMEPAGE = f"https://huggingface.co/datasets/ccmusic-database/{os.path.basename(__file__).split('.')[0]}"
 
 
 
 
21
 
22
  _CITATION = """\
23
  @dataset{zhaorui_liu_2021_5676893,
24
- author = {Zhaorui Liu, Monan Zhou, Shenyang Xu, Yuan Wang, Zhaowen Wang, Wei Li and Zijin Li},
25
- title = {CCMUSIC DATABASE: A Music Data Sharing Platform for Computational Musicology Research},
26
- month = {nov},
27
- year = {2021},
28
- publisher = {Zenodo},
29
- version = {1.1},
30
- doi = {10.5281/zenodo.5676893},
31
- url = {https://doi.org/10.5281/zenodo.5676893}
32
  }
33
  """
34
 
35
  _DESCRIPTION = """\
36
- This database contains 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. Furthermore, 10 reports on spectrum analysis of 10 instruments are also included.
 
 
37
  """
38
 
39
  _URLS = {
40
- 'cn_zip': f"{_HOMEPAGE}/resolve/main/data/Chinese.zip",
41
- 'cn_csv': f"{_HOMEPAGE}/resolve/main/data/Chinese.csv",
42
- 'zip': f"{_HOMEPAGE}/resolve/main/data/Non-Chinese.zip",
43
- 'csv': f"{_HOMEPAGE}/resolve/main/data/Non-Chinese.csv"
44
  }
45
 
46
 
@@ -48,26 +106,29 @@ class instrument_timbre(datasets.GeneratorBasedBuilder):
48
  def _info(self):
49
  return datasets.DatasetInfo(
50
  description=_DESCRIPTION,
51
- features=datasets.Features({
52
- "audio": datasets.Audio(sampling_rate=44_100),
53
- "instrument_name": datasets.features.ClassLabel(names=_NAMES),
54
- "slim": datasets.Value("float64"),
55
- "bright": datasets.Value("float64"),
56
- "dim": datasets.Value("float64"),
57
- "sharp": datasets.Value("float64"),
58
- "thick": datasets.Value("float64"),
59
- "thin": datasets.Value("float64"),
60
- "solid": datasets.Value("float64"),
61
- "clear": datasets.Value("float64"),
62
- "dry": datasets.Value("float64"),
63
- "plump": datasets.Value("float64"),
64
- "rough": datasets.Value("float64"),
65
- "pure": datasets.Value("float64"),
66
- "hoarse": datasets.Value("float64"),
67
- "harmonious": datasets.Value("float64"),
68
- "soft": datasets.Value("float64"),
69
- "turbid": datasets.Value("float64")
70
- }),
 
 
 
71
  supervised_keys=("audio", "instrument_name"),
72
  homepage=_HOMEPAGE,
73
  license="mit",
@@ -76,73 +137,76 @@ class instrument_timbre(datasets.GeneratorBasedBuilder):
76
  AudioClassification(
77
  task="audio-classification",
78
  audio_column="audio",
79
- label_column="instrument_name"
80
  )
81
- ]
82
  )
83
 
84
- def _custom_sort(self, item):
85
- return int(os.path.basename(item).split('.wa')[0])
86
-
87
  def _split_generators(self, dl_manager):
88
- cn_data_files = dl_manager.download_and_extract(_URLS['cn_zip'])
89
- data_files = dl_manager.download_and_extract(_URLS['zip'])
90
-
91
- cn_files = dl_manager.iter_files([cn_data_files])
92
- files = dl_manager.iter_files([data_files])
93
-
94
- cn_ins_eval = dl_manager.download(_URLS['cn_csv'])
95
- ins_eval = dl_manager.download(_URLS['csv'])
96
-
97
- cn_labels = pd.read_csv(cn_ins_eval, index_col='instrument_id')
98
- labels = pd.read_csv(ins_eval, index_col='instrument_id')
99
-
100
- cn_dataset, dataset = [], []
101
- for cpath in cn_files:
102
- if os.path.basename(cpath).endswith(".wav"):
103
- cn_dataset.append(cpath)
104
-
105
- for epath in files:
106
- if os.path.basename(epath).endswith(".wav"):
107
- dataset.append(epath)
 
 
 
 
 
 
108
 
109
  return [
110
  datasets.SplitGenerator(
111
  name="Chinese",
112
  gen_kwargs={
113
- "files": sorted(cn_dataset, key=self._custom_sort),
114
- "labels": cn_labels
115
- }
116
  ),
117
  datasets.SplitGenerator(
118
  name="Non_Chinese",
119
  gen_kwargs={
120
- "files": sorted(dataset, key=self._custom_sort),
121
- "labels": labels
122
- }
123
- )
124
  ]
125
 
126
- def _generate_examples(self, files, labels):
127
- for path in files:
128
- i = int(os.path.basename(path).split('.wa')[0]) - 1
129
  yield i, {
130
- "audio": path,
131
- "instrument_name": labels.iloc[i]['instrument_name'],
132
- "slim": labels.iloc[i]['slim'],
133
- "bright": labels.iloc[i]['bright'],
134
- "dim": labels.iloc[i]['dim'],
135
- "sharp": labels.iloc[i]['sharp'],
136
- "thick": labels.iloc[i]['thick'],
137
- "thin": labels.iloc[i]['thin'],
138
- "solid": labels.iloc[i]['solid'],
139
- "clear": labels.iloc[i]['clear'],
140
- "dry": labels.iloc[i]['dry'],
141
- "plump": labels.iloc[i]['plump'],
142
- "rough": labels.iloc[i]['rough'],
143
- "pure": labels.iloc[i]['pure'],
144
- "hoarse": labels.iloc[i]['hoarse'],
145
- "harmonious": labels.iloc[i]['harmonious'],
146
- "soft": labels.iloc[i]['soft'],
147
- "turbid": labels.iloc[i]['turbid']
 
148
  }
 
6
 
7
  _NAMES = [
8
  # Chinese
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
  # Non-Chinese
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/{_DBNAME}/repo?Revision=master&FilePath=data"
76
+
77
+ _HOMEPAGE = f"https://www.modelscope.cn/datasets/ccmusic/{_DBNAME}"
78
 
79
  _CITATION = """\
80
  @dataset{zhaorui_liu_2021_5676893,
81
+ author = {Monan Zhou, Shenyang Xu, Zhaorui Liu, Zhaowen Wang, Feng Yu, Wei Li and Baoqiang Han},
82
+ title = {CCMusic: an Open and Diverse Database for Chinese and General Music Information Retrieval Research},
83
+ month = {mar},
84
+ year = {2024},
85
+ publisher = {HuggingFace},
86
+ version = {1.2},
87
+ url = {https://huggingface.co/ccmusic-database}
 
88
  }
89
  """
90
 
91
  _DESCRIPTION = """\
92
+ The raw dataset encompasses subjective timbre evaluation scores comprising 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 includes 10 reports on spectrogram analysis of 10 instruments.
93
+
94
+ 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 44,100 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.
95
  """
96
 
97
  _URLS = {
98
+ "audio": f"{_DOMAIN}/audio.zip",
99
+ "mel": f"{_DOMAIN}/mel.zip",
100
+ "csv": f"{_DOMAIN}/Chinese.csv",
101
+ "label": f"{_DOMAIN}/Non-Chinese.csv",
102
  }
103
 
104
 
 
106
  def _info(self):
107
  return datasets.DatasetInfo(
108
  description=_DESCRIPTION,
109
+ features=datasets.Features(
110
+ {
111
+ "audio": datasets.Audio(sampling_rate=22050),
112
+ "mel": datasets.Image(),
113
+ "instrument_name": datasets.features.ClassLabel(names=_NAMES),
114
+ "slim": datasets.Value("float64"),
115
+ "bright": datasets.Value("float64"),
116
+ "dim": datasets.Value("float64"),
117
+ "sharp": datasets.Value("float64"),
118
+ "thick": datasets.Value("float64"),
119
+ "thin": datasets.Value("float64"),
120
+ "solid": datasets.Value("float64"),
121
+ "clear": datasets.Value("float64"),
122
+ "dry": datasets.Value("float64"),
123
+ "plump": datasets.Value("float64"),
124
+ "rough": datasets.Value("float64"),
125
+ "pure": datasets.Value("float64"),
126
+ "hoarse": datasets.Value("float64"),
127
+ "harmonious": datasets.Value("float64"),
128
+ "soft": datasets.Value("float64"),
129
+ "turbid": datasets.Value("float64"),
130
+ }
131
+ ),
132
  supervised_keys=("audio", "instrument_name"),
133
  homepage=_HOMEPAGE,
134
  license="mit",
 
137
  AudioClassification(
138
  task="audio-classification",
139
  audio_column="audio",
140
+ label_column="instrument_name",
141
  )
142
+ ],
143
  )
144
 
 
 
 
145
  def _split_generators(self, dl_manager):
146
+ audio_files = dl_manager.download_and_extract(_URLS["audio"])
147
+ mel_files = dl_manager.download_and_extract(_URLS["mel"])
148
+ cn_ins_eval = dl_manager.download(_URLS["csv"])
149
+ ins_eval = dl_manager.download(_URLS["label"])
150
+
151
+ cn_labels = pd.read_csv(cn_ins_eval, index_col="instrument_id")
152
+ labels = pd.read_csv(ins_eval, index_col="instrument_id")
153
+ cn_dataset, dataset = {}, {}
154
+
155
+ for path in dl_manager.iter_files([audio_files]):
156
+ fname = os.path.basename(path)
157
+ ins_id = int(fname.split(".wa")[0]) - 1
158
+ if fname.endswith(".wav"):
159
+ if os.path.basename(os.path.dirname(path)) == "Chinese":
160
+ cn_dataset[ins_id] = {"audio": path}
161
+ else:
162
+ dataset[ins_id] = {"audio": path}
163
+
164
+ for path in dl_manager.iter_files([mel_files]):
165
+ fname = os.path.basename(path)
166
+ ins_id = int(fname.split(".jp")[0]) - 1
167
+ if fname.endswith(".jpg"):
168
+ if os.path.basename(os.path.dirname(path)) == "Chinese":
169
+ cn_dataset[ins_id]["mel"] = path
170
+ else:
171
+ dataset[ins_id]["mel"] = path
172
 
173
  return [
174
  datasets.SplitGenerator(
175
  name="Chinese",
176
  gen_kwargs={
177
+ "files": [cn_dataset[k] for k in sorted(cn_dataset)],
178
+ "labels": cn_labels,
179
+ },
180
  ),
181
  datasets.SplitGenerator(
182
  name="Non_Chinese",
183
  gen_kwargs={
184
+ "files": [dataset[k] for k in sorted(dataset)],
185
+ "labels": labels,
186
+ },
187
+ ),
188
  ]
189
 
190
+ def _generate_examples(self, files, labels: pd.DataFrame):
191
+ for i, path in enumerate(files):
 
192
  yield i, {
193
+ "audio": path["audio"],
194
+ "mel": path["mel"],
195
+ "instrument_name": labels.iloc[i]["instrument_name"],
196
+ "slim": labels.iloc[i]["slim"],
197
+ "bright": labels.iloc[i]["bright"],
198
+ "dim": labels.iloc[i]["dim"],
199
+ "sharp": labels.iloc[i]["sharp"],
200
+ "thick": labels.iloc[i]["thick"],
201
+ "thin": labels.iloc[i]["thin"],
202
+ "solid": labels.iloc[i]["solid"],
203
+ "clear": labels.iloc[i]["clear"],
204
+ "dry": labels.iloc[i]["dry"],
205
+ "plump": labels.iloc[i]["plump"],
206
+ "rough": labels.iloc[i]["rough"],
207
+ "pure": labels.iloc[i]["pure"],
208
+ "hoarse": labels.iloc[i]["hoarse"],
209
+ "harmonious": labels.iloc[i]["harmonious"],
210
+ "soft": labels.iloc[i]["soft"],
211
+ "turbid": labels.iloc[i]["turbid"],
212
  }