Closed tjvg91 closed 4 years ago
Hi @tjvg91,
I don't think so currently, it does seem like something that would be useful though. Right now you just have to watch for Note on
and corresponding Note off
events for a given note.
So how do I know how long a certain soundfont will play the event?
Any updates about this?
Hi @tjvg91,
The player currently fires on/off events which you can use for duration. I will take a look at adding a duration
attribute to the events as soon as I have some time. PRs always welcome!
-Garrett
Duration could be pretty handy, especially if it accounts for "Note on" events with velocity of 0
I'm not sure about including duration in Note on
events. It sorta goes against the streaming event behavior of the library. I think it would require a fair amount of refactoring to implement this type of lookahead functionality.
I'm gonna table for now, I think programs that use this should be able to use the Note off
events (and Note on
events with velocity 0
) to determine how long a note should sound.
-Garrett
Is there any way to get the event duration? Using webaudiofont for the sounds but can't pass a duration to it.