Midi Neural Processor (Fork)
This repository is a fork of this repo with the main objective of structuring as an installable python package via pip.
-
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
- Pedal Control
- 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 :)
Metadata
Release files for midi-neural-processor 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| midi_neural_processor-1.0.3.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| midi_neural_processor-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / midi_neural_processor-1.0.3.tar.gz
| Download URL | midi_neural_processor-1.0.3.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ade48a8861e692d187a24dcd01667e69634c7b77b0617cb87fd753f35b7b336
|
|
BLAKE2b-256 checksum How to use checksums |
1f29c81b800817ac64108f1784748aabca760b4612645b56c53499f60ced0371
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.3
|
Release files / midi_neural_processor-1.0.3-py3-none-any.whl
| Download URL | midi_neural_processor-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d915e194d738c50a63e20fab8922270de69ee5caa964bac507a6cbd183a559b
|
|
BLAKE2b-256 checksum How to use checksums |
28fe528951e9994e3b2ca9cc6f86b81912cca338aafd53b3f990981aadb8b36c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.3
|