-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added feature MinMeasureToDrawIndex
#528
Added feature MinMeasureToDrawIndex
#528
Conversation
Awesome work! I personally have no preference on how to handle the error. In the skybottom calculator I simple switched min and max if min > max but now you could argue if that is error tolerant programming or confusing 😂 Maybe @matt-uib has any preferences? Other then that: let's get it merged |
Awesome! I had tried to implement selecting a first and last measure to render, but i always had errors in functions that tried to access measures out of the range. You fixed two of them. During testing i actually found a few more of these issues and fixed them. So i'll merge this PR to a feature branch and fix it up for merging to develop. By the way, minMeasureToDrawIndex should be drawFromMeasureNumber - 1, because measure 1 has index 0. @praisethemoon btw, is your nickname a Dark Souls/Bloodborne reference? Love it. |
Oh and when the minimum measure to draw is greater than the max measure length, i just set it to max length - 1 and give a debug warning on console. otherwise we have 0 measures to draw and get the error you mentioned. |
I'll make a new release as well after this is merged, because we've collected a few nice improvements again. |
@bneumann @sschmidTU I am glad you've found this PR useful! @sschmidTU You got me 😅 I am a huge fan of Miyazaki's works I have done a couple more tests and I have found two issues related to Cursors and Min/Max measure which I plan to fix although, i am very new to OSMD and TypeScript, so ideas are more than welcome ❤️ . Here are the issues I've found:
What is the best way to approach these two issues? |
Ah, yes, i haven't tested the cursor with this yet, makes sense that it needs adjustments. ps: I'm a huge fan of Miyazaki's works as well 😄 |
I will keep trying to fix it as well, it would help me learn the architecture and internal design of the library. Meanwhile, you should try Sekiro 🎮 😆 |
this will close #482 by the way, we'll make a lot of people happy by implementing this feature ;) and yes, i'm dying to play Sekiro, just didn't get to it yet :) |
my fixes (see above) are pushed to the branch feat/drawFromMeasureNumber, |
for testing, you can decommentate the lines in index.js.selectSampleOnChange(), which will draw a random range of measures each time a new sample is loaded. |
@praisethemoon by the way, for quick (and/or random) chatting, there's also gitter ;) |
Thanks for tips and the invitation! Will try your suggestions :) |
@praisethemoon I finally got around to merging in your work to develop with my fixes, sorry for the delay! release will be out soon as well. see #482 |
Hello,
I have added a new feature I personally wanted, allowing to render a particular interval of measures. Now,
MaxMeasureToDrawIndex
is already implemented. I simply wanted to add its oppositeMinMeasureToDrawIndex
.There is one thing that I want to ask you, how should I handle the case where
MinMeasureToDrawIndex > MaxMeasureToDrawIndex
? Currently, an exceptionTypeError: this.graphicalMusicSheet.MusicPages[0] is undefined
is thrown automatically. Other than that, here is a screenshot of the feature in action.