Add callback to watch for notes ending in a schedule? #14
Closed
drscottlobo
started this conversation in
Ideas
Replies: 3 comments 1 reply
-
Yes, sure! I'll add that soon |
Beta Was this translation helpful? Give feedback.
0 replies
-
Awesome!! Thank you!_______________Scott Wolf, DMAOxnard College - Professor of MusicOn May 17, 2023, at 12:35 AM, danigb ***@***.***> wrote:
Yes, sure! I'll add that soon
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Implemented. Read here: https://github.com/danigb/smplr#onended-event |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Danigb, thanks for your work on this! I'm excited to try it out!
Would it be possible to add some sort of listener for the end of a note in a schedule? Maybe a callback onEnd? I'm writing some simple score playback and I want to color a note in my score while it's playing, then have it return to black once it's completed. Currently just running a separate clock (WAAclock) and running a separate schedule there to track the note durations, at the same time as the soundfont plays its schedule, so not ideal.
Would something like this be possible?
`
const now = context.currentTime;
["C4", "E4", "G4", "C5"].forEach((note, i) => {
piano.start({ note, time: now + i, duration: 0.5, onEnd: callbackFunction });
});
`
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions