Performance_RNN

365 views
Skip to first unread message

Alvaro Lopez

unread,
Nov 24, 2017, 3:36:10 PM11/24/17
to Magenta Discuss
Congratulations to all people working on this, it is becoming a very interesting research! 

My question:

How can I export the output to a midi file folder (similar to the basic melody generator "--output_dir=/tmp/melody_rnn/generated"), taking as a base the Performance_RNN.ipynb code?

The jupyter notebook runs apparently fine, generates the view but sometimes the fluidsynth doesn't work. Anyway, the midi file is more important for me.

If anyone can help me I'd be grateful.  Cheers! 

Ian Simon

unread,
Nov 25, 2017, 10:05:00 PM11/25/17
to Alvaro Lopez, Magenta Discuss
Hi Alvaro, you should be able to call mm.sequence_proto_to_midi_file(sequence, "/path/to/output.mid") at the bottom of the notebook.  Then you can do what you like with the MIDI file.

-Ian

--
Magenta project: magenta.tensorflow.org
To post to this group, send email to magenta...@tensorflow.org
To unsubscribe from this group, send email to magenta-discu...@tensorflow.org
---
You received this message because you are subscribed to the Google Groups "Magenta Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discu...@tensorflow.org.

Alvaro Lopez

unread,
Jan 22, 2018, 4:41:52 PM1/22/18
to Magenta Discuss, allwarspr...@gmail.com
Thank you Ian,

Things are working well. 
I wanted to know more about the model, especially basic principles as for example: how are the events generated? is it a classification or a regression problem? I also wanted to ask you about possibilities of modification besides 'temperature'. Is there a paper coming out or any document that discloses in deep the model structure?
Thank you so much!

Alvaro

Ian Simon

unread,
Jan 22, 2018, 4:58:25 PM1/22/18
to Alvaro Lopez, Magenta Discuss
Hi Alvaro, the model itself is not too special, just a multilayer LSTM trained to predict the next event in a musical sequence.  The more interesting part is the performance representation, which is a sequence of events from a fixed-size vocabulary consisting of:

-note-on events for all 128 MIDI pitches
-note-off events for all 128 MIDI pitches
-time-shift events at increments of 10 ms up to 1 second
-velocity-change events for 32 velocity levels

Some of the model configurations allow control parameters besides temperature; you can try our online demo that lets you play with some of those controls here: https://deeplearnjs.org/demos/performance_rnn

-Ian
Message has been deleted

Will Zhong

unread,
Jul 18, 2018, 6:39:36 AM7/18/18
to Magenta Discuss
I use Jupyter Notebook as well. And I get same issue with Fluidsynth when I call 
"mm.play_sequence(sequence_prediction, mm.midi_synth.fluidsynth)"

it returns error as below. Have you resolve this?  
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-39-78a35549567a> in <module>()
----> 1 mm.play_sequence(sequence_prediction, mm.midi_synth.fluidsynth)

/home/will/anaconda2/envs/magenta/lib/python2.7/site-packages/magenta/music/notebook_utils.pyc in play_sequence(sequence, synth, sample_rate, colab_ephemeral, **synth_args)
     97     **synth_args: Additional keyword arguments to pass to the synth function.
     98   """
---> 99   array_of_floats = synth(sequence, sample_rate=sample_rate, **synth_args)
    100 
    101   try:

/home/will/anaconda2/envs/magenta/lib/python2.7/site-packages/magenta/music/midi_synth.pyc in fluidsynth(sequence, sample_rate, sf2_path)
     54   """
     55   midi = midi_io.sequence_proto_to_pretty_midi(sequence)
---> 56   return midi.fluidsynth(fs=sample_rate, sf2_path=sf2_path)

/home/will/anaconda2/envs/magenta/lib/python2.7/site-packages/pretty_midi/pretty_midi.pyc in fluidsynth(self, fs, sf2_path)
    916         # Get synthesized waveform for each instrument
    917         waveforms = [i.fluidsynth(fs=fs,
--> 918                                   sf2_path=sf2_path) for i in self.instruments]
    919         # Allocate output waveform, with #sample = max length of all waveforms
    920         synthesized = np.zeros(np.max([w.shape[0] for w in waveforms]))

/home/will/anaconda2/envs/magenta/lib/python2.7/site-packages/pretty_midi/instrument.pyc in fluidsynth(self, fs, sf2_path)
    414 
    415         if not _HAS_FLUIDSYNTH:
--> 416             raise ImportError("fluidsynth() was called but pyfluidsynth "
    417                               "is not installed.")
    418 

ImportError: fluidsynth() was called but pyfluidsynth is not installed.



在 2017年11月25日星期六 UTC+8上午4:36:10,Alvaro Lopez写道:
Reply all
Reply to author
Forward
0 new messages