Giter VIP home page Giter VIP logo

pno-ai's People

Contributors

chathasphere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pno-ai's Issues

MIDI Controller support

Wouldn't it be cool if you could play something on a MIDI controller and use it to seed the generator?

Fix "split_sequences" method

Seems to struggle with the edge case of extra long notes.

Check out this line:

new_length = note.end - sample_start

seems problematic if new_length is greater than 30 seconds.

A few things I had to do to get this working.

Hi. I was curious in trying your Music Transformer implementation, but I had to make some small changes to get it working.
Perhaps others may find some use from this information, and you might have insight.

First, in "train.py" line 147, there is a previously undeclared variable mask, which I believe should be x_mask.

Second, "generate.py" expects a "model.yaml" file that is not generated by "run.py": this was bypassed by directly setting the MusicTransformer model the same as in "run.py", and directly setting model_path to one of the checkpoints saved by "run.py"

Third, in "helpers.py", changed the line:
input_tensor = torch.LongTensor(input_sequence).unsqueeze(0)
into
model.cuda() input_tensor = torch.cuda.LongTensor(input_sequence).unsqueeze(0)
To fix an issue of mismatch between CPU and CUDA that arose in transformer.forward()

And lastly, because I was running this locally, I decreased batch size in run.py to fit my GPU.

Thanks.

Finish Preprocess Pipeline

Successfully extracted note sequences w/ pedal action.
According to research , the next steps should be:

  • Stretch music in time by: 0.95, 0.975, 1, 1.025, 1.05 (4x as many samples)
  • Split MIDIs into 30-second clips
  • Quantize samples (what exactly does this entail...sample rate of 125 Hz?
  • Transpose all samples by all intervals up to a major third (9x as many samples)
  • Simplify dynamics (midi velocity) to 32 bins

Access saved models

Currently I dump a dictionary of parameters in the generate.py file. This could be more elegantly solved as a .yaml file.

Data Encoding

Given the preprocessed data, convert these MIDI snippets to "Event Sequences."

Under the Time-shift representation, 413 events are possible:

  • 128 note on events (each corresponding to a MIDI pitch)
  • 128 note off events
  • 125 time shift events (move time step forward by 8ms up to 1 second)
  • 32 velocity events (change velocity applied to all subsequent events until another change)

A one-hot encoding turns each event into a 413-dimensional vector. A sequence of these is fed into a Neural Network.

Decode generated event sequences

Adapt the Sequence Encoder class to generate Note sequences from poorly-behaved, generated event sequences. For instance, set "note off" automatically if no note off event is provided for a pitch.

documentation

Docstrings for modules, plus an updated README/ Wiki. Links to a clean Colab notebook could be useful for teaching how to train a model.

Generate Midis

  • Use softmax sampling w/ temperature / topk to generate sequences
  • Decode numeric sequence into event sequence
  • Decode event sequence as MIDI object
  • Write out MIDIs

Web deployment

Embed a trained model in a flask application, generate MIDI sequences on the fly

Pretrained model?

Hi, would it be possible to provide a link to a pre-trained model? Thanks!

Optimize preprocessing pipeline

Consider using numpy arrays instead of a list of notes?

Will likely lead to efficiency gains in transposing/stretching samples.

no such file: saved_models/model.yaml

After running run.py and generate.py, it gave me the result that ‘no such file: saved_models/model.yaml’
I am doing research on the google magenta project (optimize the music transformer), your codes are valuable and useful for my research, so please help me to solve this problem.

Decode Event Sequences

Have the ability to convert encoded event sequences back into pretty_midi Note sequences and write them out to a MIDI file.

This will be useful both for checking the fidelity of the encoding process as well as being able to listen to the model's eventual output!

Validate Padding

There should not be an appreciable difference in training results with padded (sub-max length) sequences thrown in...this will require validating that the padding masks work as expected.

Write Training Logs

Useful to have a record of how training went, plus logs are more responsive to an instance shutting off

Pre-trained model?

Hi,

Is there a way to access the weights to obtain a pre-trained model? I can't train it on my machine but would still like to do fine-tuning.
The 'saved-model' folder seems to be empty...

Model Checkpointing

Perhaps necessary if training on Colab. Save a model to gdrive every epoch.

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.