grimmdude / MidiPlayerJS

♬ MIDI parser & player engine for browser or Node. As a parser converts MIDI events into JSON. Works well with single or multitrack MIDI files.
https://grimmdude.com/MidiPlayerJS/
MIT License
357 stars 52 forks source link

How to find out the length on a note #94

Closed urobot2011 closed 1 year ago

urobot2011 commented 1 year ago

How to find out the length on a note? Is there a way to find out the length of a note in 'new MidiPlayer.Player(function)'? I tried to solve the problem with MIDI.js. But I ran into a more serious problem. Is there a way to find out the length of a note?

Justiniscoding commented 1 year ago

To see the length of a note, you use the tick value of the note on and off events. For example, the tick value for the note on event could be 100, and the value could be 200 for the note off event, which means that the note plays for 100 milliseconds (note off tick - note on tick)

urobot2011 commented 1 year ago

Thank you