GithubHelp home page GithubHelp logo

immzz / midi-neural-processor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jason9693/midi-neural-processor

0.0 0.0 0.0 7 KB

midi processor library for PerformanceRNN & MusicTransformer published by "Google Magenta"

Python 100.00%

midi-neural-processor's Introduction

Midi Neural Processor

  • Repository for midi-based machine learning model's {pre/post} processing.

  • You can use this processor in any machine learnig library like tensorflow, pytorch, etc...

  • This processor's algorithm is based on PerformanceRNN & Music Transformer (Polyphonic Music) Model's preprocessing algorithm suggested by Google Magenta.

Simple Useage

Download

$ git clone https://github.com/jason9693/midi-processor.git

Encoding & Load midi file

  • You can load & encode your midi file just one line
  • encode_midi() is a role of pre-processing.
from processor import encode_midi
encoded = encode_midi('bin/ADIG04.mid') ## 'bin/AIDG04.mid' is midi file path.
## output: [int, int, int, int, ... ].
## int range is range(0,388). 388 = NOTE_ON + NOTE_OFF + TIME_SHIFT + VELOCITY 

Decoding

  • decode_midi is convert integer array to midi form.
  • you can gave method to file_path as a second args in that if you want to save midi as .mid file.
  • all elements in integer array should be range(0,388).
from processor import decode_midi
decode_midi(encoded, 'bin/test.mid') ## 'bin/test.mid' is midi file path.

Comming Soon

  1. Pedal Control
  2. Midi Converter to .tfrecords

License

Project is published under the MIT licence. Feel free to clone and modify repo as you want, but don't forget to add reference to authors :)

midi-neural-processor's People

Contributors

jason9693 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.