Skip to main content

Add your description here

Project description

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 Usage

Install

$ pip install midi-neural-processor

Encoding & Load midi file

  • You can load & encode your midi file just one line
  • encode_midi() is a role of pre-processing.
from midi_neural_processor.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 midi_neural_processor.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 :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

midi_neural_processor-1.0.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

midi_neural_processor-1.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file midi_neural_processor-1.0.1.tar.gz.

File metadata

File hashes

Hashes for midi_neural_processor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c254aedeb75c074a33b43bb480b0780c7f0a28deab1f3a288f6f17494a8675da
MD5 ed8dc2a49f1f594a46cd770b1926229b
BLAKE2b-256 59fe2de883cdc15eecd1d2addb920c74db3dd41f2639799cfed4d6b847511c9c

See more details on using hashes here.

File details

Details for the file midi_neural_processor-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for midi_neural_processor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25186722daec03d38c930874f77f5948f3f7daedd165cdeb9799405319748b1c
MD5 8864d33bbba984f73168367fcf5bd38a
BLAKE2b-256 69da7bb3095853e3c7f1e9c39ca1d57ec512358d8e01febbb12963615ad38854

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page