midi-rnn
midi-rnn copied to clipboard
How is note duration encoded
I noticed that you only save pitch in the input encoding, but the generated output has notes of different duration. How is this decided?
Hi Dorien,
This approach quantizes time into coarse timestep intervals and outputs either one note playing class or all notes off for each time step. In this way, duration isn't actually encoded in the output, but rather, the duration a note is played for can be derived from the output. If a note is predicted to be on for four timestamps in a row, rather than outputing four note on events, this implementation will output one note on event, and then leave the note playing for three more timesteps before resting the note. To see how this works technically, see this function.
Here is a gif that might help in understanding this encoding, as well as a blog post I wrote. Its been a while since I've read this code, but let me know if you have anymore questions.
So there's no difference between a long note 2 bars and two notes of the same pitch of 1 bar each?