AI-ON / Few-Shot-Music-Generation

160 stars 32 forks source link

Fix `detokenize` bugs #11

Closed sagelywizard closed 6 years ago

sagelywizard commented 6 years ago

Prior to this PR, there were two bugs in the MIDI detokenizer:

  1. the default velocity would be set to an invalid bin, which would break if the velocity had not been set prior to the first note being played
  2. the detokenize method would crash when detokenizing a NOTE_OFF event when the note wasn't active.

The first issues is solved by setting the default velocity to a valid bin. The second issue is solved by first checking if the note is already active before trying to create the note.