I want to create an LSTM model(using Keras) that will be trained in music, but I am having a difficult time in vectorizing the midi input. I tried using the 'Mido' library in python from where I was able to extract the data in the following format:
note_on channel=0 note=72 velocity=50 time=0
note_on channel=0 note=38 velocity=50 time=0.1171875
note_off channel=0 note=80 velocity=0 time=0.1171875
note_off channel=0 note=41 velocity=0 time=0
I am converting it into an array
[note_number, velocity, time]
where velocity denotes velocity and whether it's note_on\note_off. Now the problem is how do I feed the time here, I mean the time is in ticks(i guess). How do I convert these ticks to seconds, and as I will feed this array to a Sequential model how will I again convert the time to ticks from the output??