Edit model card

GitHub

LSTM Melody Generator

This model generates melodies using an LSTM neural network trained on folk songs.

Model Description

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.

Input

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.

Output

The model outputs a generated melody in the same format as the input.

Usage

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)

Training Data

This model was trained on the Erk dataset from the "deutschl" folk song collection.

Training Procedure

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.

Limitations

  • The model generates MIDI note numbers and doesn't include information about rhythm or dynamics.
  • The output quality may vary depending on the input seed and generation parameters.

License

This model is released under the MIT License.

Additional Information

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!

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference API
Unable to determine this model's library. Check the docs .