You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the duration of the midi clip is derived from the end of the last note, which works if the last note ends at the end of the clip. But if the last note does NOT end at the end of the clip, for example, if it ends early, then the duration of the midi clip will be incorrect:
Here is something I found in regards to midi files:
FF 2F 00 End of Track
This event is not optional. It is included so that an exact ending point may be specified for the track, so that an exact length is defined, which is necessary for tracks which are looped or concatenated.
I have no idea how to parse a midi file, but with a midi file where the last note stops before the end of the clip the duration is correct. Here is an example:
The midi file is 4 measures long, and it should come out as an 8 for the duration, but the duration is calculated based on the ending of the last note, rather than the clip length, so the duration that tone js midi ends up with is 7.5, which is incorrect:
so, I do not know how to figure out the end of the clip, although FF 2F 00 might be it? but the current approach is incorrect with any midi file where the last note does not extend to the end of the clip.
Thank you!
The text was updated successfully, but these errors were encountered:
Right now the duration of the midi clip is derived from the end of the last note, which works if the last note ends at the end of the clip. But if the last note does NOT end at the end of the clip, for example, if it ends early, then the duration of the midi clip will be incorrect:
Here is something I found in regards to midi files:
FF 2F 00 End of Track
This event is not optional. It is included so that an exact ending point may be specified for the track, so that an exact length is defined, which is necessary for tracks which are looped or concatenated.
I have no idea how to parse a midi file, but with a midi file where the last note stops before the end of the clip the duration is correct. Here is an example:
The midi file is 4 measures long, and it should come out as an 8 for the duration, but the duration is calculated based on the ending of the last note, rather than the clip length, so the duration that tone js midi ends up with is 7.5, which is incorrect:
so, I do not know how to figure out the end of the clip, although FF 2F 00 might be it? but the current approach is incorrect with any midi file where the last note does not extend to the end of the clip.
Thank you!
The text was updated successfully, but these errors were encountered: