magenta / magenta-js

Magenta.js: Music and Art Generation with Machine Learning in the browser
https://magenta.tensorflow.org
Apache License 2.0
1.96k stars 311 forks source link

sequenceProtoToMidi (no notes in output) #448

Open jgoffin opened 4 years ago

jgoffin commented 4 years ago

I'm using the drum kit rnn and am able to successfully produce samples. However, when I go to convert the note sequence object back into a MIDI file I get an empty output (no notes in the midi object). I've attached a simple example to demonstrate the issue I'm having.

This issue doesn't occur when I'm converting other note sequence objects back to MIDI files (say retrieve a midi file from bitmidi). This is the function that I'm relying on: https://magenta.github.io/magenta-js/music/modules/_core_midi_io_.html#sequenceprototomidi

Let me know if I can provide more detail!

seq_to_midi_issue.txt

notwaldorf commented 4 years ago

Could you console.log one of these note sequences that can't be converted to MIDI, please? I want to see if there's anything obvious with it (maybe it's empty, maybe it's missing a field, etc).

notwaldorf commented 4 years ago

Update: i've put the code in this https://jsbin.com/mopapow/edit?html,console,output, will take a look!

notwaldorf commented 4 years ago

I can't see anything at first glance. Some fields like timeSignatures seem empty, but I don't know if those are needed for the conversion. @iansimon does any of this look familiar?

iansimon commented 4 years ago

The issue seems to be that the notes have no velocity. If I manually set the velocities the conversion works.