Datasets:
|
Download README.md from RedCatTeam/MidiMus-1K: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/datasets/RedCatTeam/MidiMus-1K/resolve/main/README.md
- Command line
-
hf download hf://datasets/RedCatTeam/MidiMus-1K/README.md
-
curl -L -o README.md https://huggingface.co/datasets/RedCatTeam/MidiMus-1K/resolve/main/README.md
1.64 kB
metadata
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:
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)
# ...