Downloads · 30 days
0
RSPRIMES1234/LSTM_Melody_Generator_for_Music_Composition
LSTM_Melody_Generator_for_Music_Composition is a machine learning model from RSPRIMES1234. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
<img src="https://cdn-uploads.huggingface.co/production/uploads/6687817abcb8e14746fd3765/7cUPDw6tszldMPRUlUiVZ.jpeg" width="500"
Downloads · 30 days
0
Access
Public
Updated Jul 24, 2024
Repo size
3.8 MB
Likes
0
Public
Click a slice to open those files.
.h53.8 MB · 100%
From the Hugging Face model README
This model generates melodies using an LSTM neural network trained on folk songs.
The LSTM Melody Generator is a deep learning model trained to generate musical melodies. It uses a Long Short-Term Memory (LSTM) neural network architecture to learn patterns from a dataset of folk songs and generate new, original melodies based on these patterns.
The model takes a seed melody as input, represented as a string of space-separated integers and underscores. For example: "60 _ 60 _ 67 _ 67 _ 69 _ 69 _ 67 _ _"
Each integer represents a MIDI note number, and underscores represent continuations of the previous note.
The model outputs a generated melody in the same format as the input.
Here's how to use the model:
from model import load_model
# Load the model
melody_generator = load_model("model.h5", "mapping.json")
# Generate a melody
seed = "60 _ 60 _ 67 _ 67 _ 69 _ 69 _ 67 _ _"
melody = melody_generator.generate_melody(seed, num_steps=500, max_sequence_length=64, temperature=0.3)
print(melody)
This model was trained on the Erk dataset from the "deutschl" folk song collection.
The model was trained using a sequence-to-sequence approach, where it learns to predict the next note in a sequence given the previous notes.
This model is released under the MIT License.
For a deeper understanding of how this model works, including the preprocessing steps, training procedure, and melody generation process, please check out the GitHub repository. The repository contains the full source code and detailed explanations of each step in the model's development.
We encourage you to explore the GitHub repo to gain insights into the inner workings of this LSTM-based melody generator. It's a great resource for those interested in music generation, deep learning, or both!