Hi!
What's the status of handling repeats when stepping through the song with cursor.next()? It feels like the expected behavior would be that it handles occurring repeat signs correctly, but I believe that's not the case right now (now it ignores and steps through repeat signs)?
Yes, there's no code for handling repeats for the cursor right now.
The desired behaviour would be that it handles repeats correctly, like they would be performed.
It would be nice to have an option to ignore repeats, as audio playback will use the cursor position and commonly offers the option to skip repeats.
For me, this would be rather low priority at the moment, because there are probably not many people using the cursor seriously.
For you i guess this would be high priority at the moment, because you're working on Playback.
This will definitely be implemented at some point, so I could see about giving it more priority.
@sschmidTU No hurry, I agree that it should probably be quite low priority right now. I just wanted to make sure that it is the intention to handle repeats with the cursor in the future. And I agree about the need to have an option for ignoring them as well.
@jimutt yes we plan to implement a playback plugin which also will generate the currently missing Repetition objects that are needed for letting the cursor react on repetition signs.
But to keep up the project we actually plan to provide the plugins for a license fee and the handling of repetitions is planned to be part of the playback plugin.
But maybe we can work together on the playback, as you already started with it? We have here also already a lot prepared on the playback engine.
@matt-uib Okay! Well that depends if my playback progress would be of any help to you. Then I could probably, at the very least, make my source available as I keep expanding it (everything is pure JS at the moment for increased prototyping speed and as I would have had to use _any_ everywhere in order to access the private properties). I've got a live demo up and running here: https://heuristic-williams-b11ca6.netlify.com/ (probably works best in chrome)
I haven't expanded any functionality of OSMD itself though, I've only been working with what's already available. But of course I've been using some of the private properties of the objects though. So for example the progress indicator can be dragged to change the cursor position but I haven't looked into things like supporting click events on the score to set the cursor position.
Right now the major issue is the playback scheduler which is only using the extremely unreliable setTimeout(). So if you for example scroll the page while it's playing you'll most likely find that it will affect the playback speed. And sometimes the bad timing completely messes up the playback. I plan to fix that by keeping track of the time with the AudioContext and use it together with setInterval though. But I wanted to get some very basic functionality up and running first.
@jimutt thanks for posting - cool your player demo! Would be great to video chat with you about it. Please contact me on m.[email protected] for arranging a call. That would be great!
Is there any update here? I don't want to reinvent the wheel.
cursor.next() should jump to the right position. I've seen there are some repetition information in the current measure object included. Can we use this information?
Hi!
After abandoning my audio playback experiments for some time I picked it up again a while ago (https://github.com/jimutt/osmd-audio-player) to make some improvements.
I've experimented some with adding experimental barline repeat support in a branch of my personal OSMD fork. I'm supporting barline repeats & endings at the moment. (video demo: https://twitter.com/jimutt/status/1256223916751798276) But some aspects of the existing repetition related classes are still a bit unclear to me, so it's possibly quite far from an idiomatic implementation.
Would you be interested in looking into the changes I've made @sschmidTU, @matt-uib or should I keep fiddling in my fork and let you focus on other areas? 馃槃
I'm experimenting with OSMD for a project where I'd like to make the cursor move automatically through the piece, highlight the note that should be played as long as it should take. I don't think such a feature exists at the moment? It seems not too hard to build an automode for simple scores on top of something like osmd.cursor.NotesUnderCursor()[0].length.realValue and calling cursor.next() but naturally if the feature exists or you add it, it will probably be a more robust implementation - particularly given repeats and codas and such.
Most helpful comment
Hi!
After abandoning my audio playback experiments for some time I picked it up again a while ago (https://github.com/jimutt/osmd-audio-player) to make some improvements.
I've experimented some with adding experimental barline repeat support in a branch of my personal OSMD fork. I'm supporting barline repeats & endings at the moment. (video demo: https://twitter.com/jimutt/status/1256223916751798276) But some aspects of the existing repetition related classes are still a bit unclear to me, so it's possibly quite far from an idiomatic implementation.
Would you be interested in looking into the changes I've made @sschmidTU, @matt-uib or should I keep fiddling in my fork and let you focus on other areas? 馃槃