Datasets:
File size: 1,642 Bytes
f77f154 feb4363 f77f154 60fb137 b70f40c 60fb137 | 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 | ---
license: apache-2.0
task_categories:
- text-to-audio
language:
- en
tags:
- text
- audio
pretty_name: MidiMUS 1K
size_categories:
- 1K<n<10K
---
This dataset provided for Midi generation models using.
Dataset have 1000 .txt files with descriptions and 1000 .mid files with MIDI.
##Instructions for install:
###1. Install :
Install the dataset to folder - in guide this be "music_dataset"
In terminal if you on GNU Linux or on CMD if you on Windows write this:
```
git clone https://huggingface.co/datasets/RedCatTeam/MidiMus-1K
```
###2.Preparing :
Rename the "MidiMus-1K" to "music_dataset" (or yourself choosed name) and delete .git file and gitgnore file - after it - dataset downloading done!
###.3 Using :
Example loader with Keras's Tokenizer training:
```python
from mido import MidiFile
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
import numpy as np
tokenizer=Tokenizer()
def loadFile(fl):
mid=MidiFile('./music_dataset/'+fl)
notes=[]
for track in mid.tracks[1]:
if track.dict().get('note')!=None:
notes.append(track.dict().get('note')/88)
return notes
def loadDataset():
x=[]
texts=[]
y=[]
for i in range(1000):
mid='piece_'+str(i)+'.mid'
txt='piece_'+str(i)+'.txt'
notes=loadFile(mid)
with open('./music_dataset/'+txt,'r') as f:
desc=f.read()
texts.append(desc)
y.append(notes)
tokenizer.fit_on_texts(texts)
x=pad_sequences(tokenizer.texts_to_sequences(texts),maxlen=6)
return np.array(x),np.array(y)
# ...
``` |