Giter Site home page Giter Site logo

scidle-midi-rnn's Introduction

English

Generate MIDI Music with Recurrent Neural Networks

The project consists of the following files:

  • raw_music.py: More than 600 songs in text format converted from MIDI format.
  • rnn_midi.py: Generator of the neural recurrent network model based on raw_music.py.
  • keyboard2midi.py: Program that will load the model generated by rnn_midi.py and generate a MIDI file.
  • rnn_midi_25_100_50000.dat : Model saved with 50,000 iterations.
  • rnn_midi_25_100_200000.dat : Model saved with 200,000 iterations.
  • rnn_midi_25_100_250000.dat : Model saved with 250,000 iterations.
 

The requirements to use this project are:

  • Python 2.7or higher.
  • Numpy:Mathematical library for python.
  • Mido: MIDI file library for python.

Model Training

Although the project contains several models already trained with different number of iterations we can train it ourselves.
python rrn_midi.py
This generates the trained model in a file with .dat extension.

Generate MIDI Files with the trained model

python keyboard2midi.py
This generates a file with .mid extension.

Play MIDI files

To play MIDI files we have several options, although one of the simplest in timidity, which in addition to playing MIDI can convert them to WAV.
timidity song1.mid

Generate MIDI file, convert it to wav and play it on a single line.

python keyboard2midi.py; timidity --output-24bit --output-mono -A120 song1.mid -Ow -o song1.wav; aplay song1.wav

Convert MIDI files to MP3

ffmpeg -i song1.wav -acodec libmp3lame song1.mp3

Tests performed

These are several of the tests generated by our Artificial Intelligence.

Trumpet song created by Artificial Intelligence:

https://youtu.be/rc6b8yPH-uc

Harp song created by Artificial Intelligence:

https://youtu.be/KhDHeM8mW-M

Violin song created by Artificial Intelligence:

https://youtu.be/E1RZeuG0d78

Español

Generar música MIDI con Redes Neuronales Recurrentes

El proyecto está formado por los siguientes archivos:

  • raw_music.py: Más de 600 caciones en formato texto convertidas desde formato MIDI.
  • rnn_midi.py: Generador del modelo de red recurrente neuronal basado en raw_music.py.
  • keyboard2midi.py: Programa que cargará el modelo generado por rnn_midi.py y genera un archivo MIDI.
  • rnn_midi_25_100_50000.dat : Modelo guardado con 50.000 iteraciones.
  • rnn_midi_25_100_200000.dat : Modelo guardado con 200.000 iteraciones.
  • rnn_midi_25_100_250000.dat :Modelo guardado con 250.000 iteraciones.
 

Los requisitos necesarios para poder utilizar este proyecto son:

  • Python 2.7 o superior.
  • Numpy: Librería matemática para python.
  • Mido: Librería de archivos MIDI para python

Entrenamiento del modelo

Aunque el proyecto contiene varios modelos ya entrenados con diferentes número de iteraciones podemos entrenarlo nosotros.
python rrn_midi.py
Esto genera el modelo entrenado en un archivo con extensión .dat.

Generar Archivos MIDI con el modelo entrenado

python keyboard2midi.py
Esto genera un archivo con la extensión .mid.

Reproducir archivos MIDI

Para reproducir archivos MIDI tenemos varias opciones, aunque una de las más sencillas en timidity, que además de reproducir MIDI puede convertirloas a WAV.
timidity song1.mid

Generar archivo MIDI, covertirlo a WAV y reproducirlo en una sola línea.

python keyboard2midi.py; timidity --output-24bit --output-mono -A120 song1.mid -Ow -o song1.wav; aplay song1.wav

Convertir archivos MIDI a MP3

ffmpeg -i song1.wav -acodec libmp3lame song1.mp3

Pruebas realizadas

Estas son varias de las pruebas generadas por nuesta Inteligencia Artificial.

Canción de trompeta creada por Inteligencia Artificial:

https://youtu.be/rc6b8yPH-uc

Canción de harpa creada por Inteligencia Artificial:

https://youtu.be/KhDHeM8mW-M

Canción de violín creada por Inteligencia Artificial:

https://youtu.be/E1RZeuG0d78

scidle-midi-rnn's People

Contributors

dcervantes avatar

Stargazers

Brian Roach avatar  avatar Ronildo Silva avatar Nicolò Pinciroli avatar Pete  avatar Kristijan Bartol avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.