Tie notes - How can we implement this with smplr? #83
-
Let's say an app wants to play a series of notes (pitch, duration) using an instrument in smplr. Plain and simple. It works. What if we have a series of notes but there are some tie notes. e.g. Here we don't want to play two different C4 the first one 0.5 and the second one 1 but we want to continue the C4,0.5 note and extend it by another 1s. Of course we can simply pass it as C4,1.5. This is possible to do in my parser but the logic will be convoluted as I have to do look ahead and remove notes from future measures and bring them to the current measure. It will be ugly. Another idea - is to cancel the previous note and reschedule another C4 with 1.5s duration with smplr. Is there a way to cancel a scheduled note and reschedule it? Is there a more straight forward approach to achieve tied notes? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
There's no way to cancel and reschedule notes, so I'd say that look ahead and remove notes is the simplest option I can think of. |
Beta Was this translation helpful? Give feedback.
Hi @danigb and @drscottlobo thanks for your input/ideas with my quest here. I was able to figure out a solution to highlight my measures as they are being played. For now since no other method is known I am using the look ahead notes from current and future measures for tied notes and bring the duration from them to current note but I am scheduling callbacks for each measure as I am scheduling the playback notes by computing how long each measure should take. If there are no lags etc. in playing I think this should work fine. I did some quick testing and it seems to be working fine.