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
Install via pip...
$ pip install midi-neural-processor
... or clone Repository
$ git clone https://github.com/jason9693/midi-neural-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
- 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 :)
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
Built Distribution
File details
Details for the file midi_neural_processor-1.0.0.tar.gz
.
File metadata
- Download URL: midi_neural_processor-1.0.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa31e54c983bba62bf614aed3abda87f1bad3a820079ad54b20be3fc01b3d38d |
|
MD5 | dfea98a9285cf4029f9ad94f4577bd04 |
|
BLAKE2b-256 | b4a80c81c9c84bd32c1ede5da1f310042c0920ed8b27efafbdac0ab051dcb40a |
File details
Details for the file midi_neural_processor-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: midi_neural_processor-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 630102da02e31388a4a6e9625f8a8c10f7cab801ce2bd85481cf864c5d8fce05 |
|
MD5 | a117d73ff0fa765df10941ee7c2ee978 |
|
BLAKE2b-256 | 8a81118bb80e4270191b5dacf310c53a5979dbf26b6486143c610f21ee23bcaf |