Search code examples
tensorflowmagenta

How to restrict the melody_rnn output scope to a given list of pitches?


I'm using magenta and tensorflow to generate some music via the pre-trained models from melody_rnn.

As I understand, at the moment the output generated sequence can have notes between a range of MIDI pitches.

Now, let's say I only want to output sequences that only uses MIDI notes between 50 and 60, for example, or only MIDI notes that belongs to a list that I would define.

Is there a way to do this, and if yes, how ?

Thanks !


Solution

  • Probably the easiest way to try this out is to copy one of the default configs referenced in melody_rnn_model.py and make your own config. Just modify the min_note and max_note values.

    Note that you'll need to redo the create dataset and training steps before you can try out your new model.