Giter Club home page Giter Club logo

add_trill's Introduction

Ornamentation Suggester [Trills]

This project uses a CNN autoencoder model to generate trill suggestions from a midi input primer. You can upload and convert your own MIDI data in main.py and model() will generate a prediction of where a trill could go in the midi data.

The goal of this project is to be able to provide ornamentation suggestions for composers, when they are composing music on MIDI supported score notation software. This is currently a proof of concept unfinished project - at the moment, trill suggestions are given by training a model using the velocities given in MIDI data as a positional marker - which is an arduous and painstaking process as you have to create your own training dataset marking the position of trills in a scorewriter, e.g. Musescore, Sibelius, or a DAW, e.g. Logic, Ableton.

As it stands, the output suggests trills, but also completely changes your MIDI input, SO TAKE NOTE.

Installation

  • Download the repository 'CC/' using

  • cd to 'CC/' and activate virtual environment

  • Install required libraries/packages using pip install -r requirements.txt in shell

  • Check to make sure the following package is installed: https://github.com/craffel/pretty-midi

Input

MIDI Primer

For generation of trills from a primer MIDI input, you will need to provide a MIDI data file, that can be inputted in main.py. A collection of random MIDI files can be found in the CC/midi_primer directory, which can fufill this purpose.

Training Dataset

If you would like to train the model using your own dataset of midi files, these files need to be pre-pre-processed, as in, all the velocities in the MIDI data need to be set to 80 (comes up as 0 in Musescore) for the X input, and 80 for 'non-trills' and 127 for trills in the Y label input.

These MIDI files should then be uploaded to 'data/' and running preprocess_data.py will create a pickle file
containing all the training data to upload into the model.

Generation of MIDI using Pre-trained model

If you are using the pre-trained model to generate trill suggestions, upload a MIDI file to main.py, and you should be able to generate a MIDI output containing the trill suggestions marked by velcity values of 127 (as opposed to 'non-trills' - which have a velocity value of 80) which can be shown when uploaded to a scorewriter like Musescore.

Training

The model is best trained using GPUs with CUDA.

To train the model on your own dataset, please pre-process your data in the preprocess_data.py script. Training takes place in model.py and various hyperparameters can be adjusted.

Output of the model can be obtained by running the main.py script. This is only possible if there is a trained model available called my_trained_model.pt in the CC directory.

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.