abcjs
abcjs copied to clipboard
The progress bar is out of sync when using metronome and needs to wait for the drumIntro to start.
Thank you once again for fixing the drumIntro, the audio is working perfectly now, and it's waiting for the clicks (#883)
However, the player progress bar is out of sync, and so is the cursor (if used).
What is the best approach to sync these, please?
I've found here (#772) that we can delay the cursor, but how do we delay the progressbar?
I assume that we need to update the clock? Or wait for the clicks to start the clock.
Eg: https://codesandbox.io/s/abcjs-drum-midi-circle-notes-on-beat-uztfco?file=/src/index.js (progresbar is not waiting for the intro to finish, and the progressbar finishes before the audio)
There is at least one bug in the progress (used in both the cursor and the player). One is that there appears to be a rounding error where it can get one off. The other I haven't tracked down but is mysterious.
However, what I see on your page is different. I think it is an initialization problem and I'll research it later today.
The first thing I notice is that you're rendering twice - when you use the editor it renders automatically, then you are calling renderAbc below that. You should be able to send the audio parameters to the editor and let it do everything.
Oh, sorry, that example was not simple to see the issue. I should've shared this one: https://codesandbox.io/s/abcjs-drumintro-bugs-3834qg?file=/src/index.js If you play, you can hear the metronome, while the progress bar starts to run, even is not ready for. We need some how update the clock.
In the example above, am I still rendering twice? If so, could you please break down where am I rendering twice, and how can I avoid that?
I just want to render the player, the notation, and have
That's a good example. You're not rendering twice there. I don't have time to look at it right now, but I will by the end of the week. I'm guessing that there is a way to rearrange the way you are doing the parameters, but the API is clearly confusing here. I will hopefully be able to improve it.
@paulrosen Any updates on this? Still seems to be a problem in latest version (6.2.2)... If you can point me in the right direction I can maybe take a look at it. But would be nice to have a approx. starting point (y)
That will take some debugging. The first thing I'd do is put a breakpoint at create_synth.js after
self.flattened = options.visualObj.setUpAudio(params);
and be sure that looks right. I think it will.
Then look at how create_synth_control.js setProgress() is being called. I bet it is something in synth-controller.js