File size: 4,965 Bytes
3d11359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cb27841
3d11359
 
 
 
 
3ec8b8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dc2b258
b83f30b
 
dc2b258
 
 
b83f30b
 
 
 
 
 
 
 
 
 
 
 
 
 
68916a2
 
 
 
 
 
 
ace125b
68916a2
cb27841
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
license: cc-by-nc-sa-4.0
dataset_info:
  features:
  - name: midi_source
    dtype: string
  - name: metadata_source
    dtype: string
  - name: file_name
    dtype: string
  - name: title
    dtype: string
  - name: composer
    dtype: string
  - name: year
    dtype: float64
  - name: era
    dtype: string
  - name: style
    dtype: string
  - name: key
    dtype: string
  - name: license
    dtype: string
  - name: midi
    dtype: binary
  - name: midi_mido
    dtype: string
  splits:
  - name: train
    num_bytes: 2015536891
    num_examples: 6068
  - name: validation
    num_bytes: 255732310
    num_examples: 759
  - name: test
    num_bytes: 226020849
    num_examples: 759
  download_size: 298152520
  dataset_size: 2497290050
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
  - split: test
    path: data/test-*
task_categories:
- audio-classification
- tabular-classification
- tabular-regression
tags:
- audio
- music
- classification
- regression
- era
- song
- year
- classical_music
- composer
- midi
pretty_name: >-
  IMSLP MIDI Classification Dataset (Creative Commons Attribution Non Commercial
  Share Alike 4.0 Version)
size_categories:
- 1K<n<10K
---

# IMSLP MIDI Dataset (CC-BY-NC-SA-4.0)

This dataset contains MIDI files and metadata crawled from IMSLP (International Music Score Library Project) on **July 21-22, 2024**.

## Data Fields
- `midi_source`: URL to the original MIDI file on IMSLP (incl. original uploader).
- `metadata_source`: URL to the original metadata on IMSLP.
- `file_name`, `title`, `composer`, `year`, `era`, `style`, `key`, `license`: Metadata fields.
- `midi`: Raw MIDI bytes.
- `midi_mido`: JSON-serialized mido object.

## How to Retrieve Origin Data and Authors
- For each entry, use `midi_source` to find the original MIDI file and `metadata_source` for the metadata information.

## Statistics & Visualizations

- **Total entries:** 7586
- **Unique composers:** 1388
- **Eras:** Romantic (2729), Baroque (1902), Renaissance (1319), Modern (944), Classical (463), Other (118), Early 20th century (94), Medieval (17)
- **Styles:** Romantic (2736), Baroque (2033), Renaissance (1368), Modern (720), Classical (462), Early 20th century (184), Traditional (35), Medieval (22), Jazz (15), Ancient (8), Non-western classical (3)

![Top 10 Composers](readme_plots/by-nc-sa_top_composers.png)

![Era Distribution](readme_plots/by-nc-sa_era.png)

![Style Distribution](readme_plots/by-nc-sa_style.png)

![Year Distribution](readme_plots/by-nc-sa_year.png)



## How to Use
```python
from datasets import load_dataset
dataset = load_dataset('TiMauzi/imslp-midi-by-nc-sa')
```

The data in the column `midi` are raw bytes. You may want to use [packages like `mido`](https://github.com/mido/mido) to analyze them. For example, to view the content of the first MIDI file, you can use a script as follows:

```python
import mido
import io

train_data = dataset['train']  # assuming you already loaded the dataset as described

# Take the first example
midi_bytes = train_data[0]['midi']  # this is raw bytes

# Load with mido
midi_file = mido.MidiFile(file=io.BytesIO(midi_bytes))

# Inspect tracks and messages
for i, track in enumerate(midi_file.tracks):
    print(f"Track {i}: {track.name}")
    for msg in track[:10]:  # print first 10 messages
        print(msg)
```

## License Merging
While most files in IMSLP are stored as public domain or open source, different and sometimes incompatible licensing agreements exacerbate the conflation of individual pieces into a single data collection.
While there are several customized licenses for some of the MIDI files, some of the crawled and observed data were purely from the public domain globally, whereas the vast majority of all MIDI files make use of Creative Commons (CC) agreements. The latter may be combined under [specific circumstances](https://wiki.creativecommons.org/wiki/Wiki/cc_license_compatibility): 
For example, CC-BY-licensed pieces may be remixed with CC-BY-SA- and CC-BY-NC-licensed pieces into a CC-BY-SA or CC-BY-NC remix, respectively. Furthermore, CC-BY-NC-licensed pieces or remixes may again be remixed using the CC-BY-NC-SA license. Finally, ShareAlike (SA) licenses CC-BY-SA and CC-BY-NC-SA of version 3.0 are [upgradable](https://creativecommons.org/share-your-work/licensing-considerations/compatible-licenses/) to those of version 4.0.
Since the compatibility of all other, mostly custom licenses, remains ambiguous, they have been dropped.

This specific dataset contains data that can be remixed as CC-BY-NC-SA-4.0.  For other versions, please check out [TiMauzi/imslp-midi-cc0-1.0](https://huggingface.co/datasets/TiMauzi/imslp-midi-cc0-1.0) or [TiMauzi/imslp-midi-by-sa](https://huggingface.co/datasets/TiMauzi/imslp-midi-by-sa).

In case of any copyright issues or concerns, feel free to contact me, so I can take this dataset offline.