Skip to content
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

Involuntary Deselection of notes while using macros Softlocks NBS #107

Closed
yifo123 opened this issue Jan 5, 2020 · 2 comments
Closed

Involuntary Deselection of notes while using macros Softlocks NBS #107

yifo123 opened this issue Jan 5, 2020 · 2 comments
Labels
C: Bug Something isn't working S: Resolved in next release This bugfix or suggestion has been applied to the code

Comments

@yifo123
Copy link

yifo123 commented Jan 5, 2020

Description
Since NBS was coded with GameMaker, I think it's appropriate to call this a "Softlock" lol, like video game speedrunner slang. This one is really really annoying actually.

My Theory and findings behind this (Sorry, no tl;dr without abstracting important points)
When I have notes selected (when you drag across the screen to highlight), (I have counted with a timer lmao) after consistent 1 minute intervals something happens that deselects everything that is selected, the 1 minute intervals begin as soon as an nbs file is loaded, or a new file is created.
It doesn't matter when you select the notes or how many notes are selected or if you deselect them or not, when something (I assume is) within the code (that I definitely have no knowledge of) increments and hits this one minute mark, everything is deselected, no matter if you are moving the notes, changing them, or even if noteblock studio is running in the background, they will deselect.

And no that's not the worst part, when you are using the macros, (eg: stereo), when the popup window is open for you to do your scrolling and box checking, if the notes are deselected, the popup becomes blank and uh, I like to say it's softlocked, because Noteblock studio is definitely still running and it doesn't freeze or go white, but it stops responding, it doesn't say it, but it's definitely softlocked, no key/mouse/ANY inputs can be registered, you can sometimes still drag around the window and close it and I've only been able to change the panning for channels (which the sensitivity still needs fixing at this moment in time lol) but that's about it, it's not responding, but it's still running, unlike if it were to freeze, or crash.

Softlocking doesn't do anything to my nbs files except I can't save the work I haven't saved if it does softlock and inputs for closing NBS in a normal fashion fail too. I can restart NBS just fine and just reload from where I last saved.

The only thing I can correlate so far between notes being deselected is when I ctrl+s, or just save the nbs file, which always deslects the notes, but I have checked already if this is a problem with autosaving, I have repeated the test with autosave off, autosave on and tried both autosaving every 10 minutes and every 1 minute. But the outcome is the same and the timing of the deselecting is consistent.
So I think it might be something to do with an internal timer in the code, because on the bottom gui (below the piano if you have piano shown), there is a display for when the next autosave will happen, something tells me there must be something incrementing up to one minute in the code which tells the display for the "__ until autosave" to know when to decrease by one minute, or something like that.
That might be what is causing a constant deselect every minute, and remember this happens with autosave off too.

The issue must be within NBS itself because if you click away from the NBS window and allow it to run in the background, the time it takes for the notes to deselect is slower, so I assume when there is lower processing priority for NBS so the increments lag. (Which could be another problem for autosaving being inconsistent, if you have the time to try turning down the priority of NBS and testing if "5 Minutes until next autosave" REALLY IS "5 Minutes" or not).
I've spent a while and I can't be bothered to check anything else, I don't think I have the knowledge to help with coding myself yet (in a non-rude way to say that, this is not my job to fix, don't want it to sound rude either), so this is the most I can get involved for now.
I am fairly confident that this isn't something incrementing in my computer, because as I mentioned, when NBS runs in the background as opposed to being the currently running window, the one minute timing is less consistent.

To Reproduce
Steps to reproduce the behavior:

Note: if you're mouse button is still clicked down as you highlight notes, they won't be deselected, because I think they can only be "truly selected" once the mouse click released, (justified by the marco options appearing)

  1. Just select a bunch of notes and wait, don't do anything, do anything, it doesn't matter, it should deselect at some point.

If it doesn't deselect, then uh, idk, it's probably just me, I want to know if anyone else is getting this problem, or you could tick the autosave option on, and see if that does anything, because I remember immediately after I got the new update I had turned on autosave.

If it does, then... if you wanna softlock your nbs just:

  1. Select a bunch on notes, and click on one of the macros to open up the popup to change whatever.
  2. wait
  3. if the notes deselect, the macro editing popup should turn blank (except for the name of the macro), and/or the entire nbs will become unresponsive to basically all inputs.

If you want to check for my one minute interval theory:

  1. Select a bunch of notes and GET READY with a stopwatch/timer of somesort.
  2. When the notes deselect, start the stopwatch. (This should simulate the 1 minute cycle).
  3. Reselect any notes immediately after you start the stopwatch.
  4. When the stopwatch reaches a minute, the notes which you have selected should deselect.
  5. Repeat the test but this time reselecting the notes at any time close to when the stopwatch is about to reach 1 minute, if my tests are repeatable, then the notes will deselect at 1 minute, despite you reselecting the notes later/earlier than your first test.

Expected behavior
I don't want to compose with anxiety while using macros. Notes shouldn't be deselecting when I don't want it to, I have repeated this test while not pressing anything on the keyboard either (or moving the mouse, ect...), I can definitely say that this is involuntary.

Screenshots
This should be what it looks like.
softlock on noteblock studio

Additional context
This is where I may not be able to be helped, as I do have the correct noteblock studio update, and I don't know if it's happening to anyone else because if it has been, then it probably would've been reported already, so I'm not sure if this glitch is just with me or if it's the same everywhere, I will check on another computer at some point, to figure out if it is my computer's fault or it's just nbs in general.

I have reinstalled NBS and the problem still persists.

but also I did get a crash report a few days prior to me reinstalling it, but I forgot to save it oof, however since the problem is still happening I don't think it's to do with the crash, as after the crash, I just reopened NBS again and it didn't crash.

@yifo123 yifo123 added the C: Bug Something isn't working label Jan 5, 2020
@Bentroen
Copy link
Member

Bentroen commented Jan 5, 2020

when something (I assume is) within the code (that I definitely have no knowledge of) increments and hits this one minute mark, everything is deselected, no matter if you are moving the notes, changing them, or even if noteblock studio is running in the background, they will deselect.

You got the one-minute part absolutely right. This is the auto-recovery mechanic kicking in. It is a different thing from the auto-save you can configure in preferences (it always happens whether or not you have auto-save on). It saves the song to a temp file once every minute to prevent losing your work due to crashes (how ironic, right? :P). The saving is supposed to happen in the background and be imperceptible to the user, but I seem to have forgotten to make it NOT clear the selection upon saving a backup.

About the soflock itself, it happens because there's a rule in the code to cancel the macro if you have no note blocks selected. This rule, however, closes the window after the box and title were already drawn, which doesn't draw the rest of the window and prevents you from clicking out of it. I guess if you click the macro button at the exact moment the auto-save occurs, the note blocks will be deselected and you'll be locked in the macro window.

I already have an idea of how I can fix these issues and I'll work on a patch as soon as possible. For now, if this ever happens to you again, please force-close Note Block Studio using the Task Manager (when it asks if you want to save your song, don't click anything, just wait and it'll close a few seconds later). As soon as you open it again, it should give you the option to recover your song.

Thanks for your patience and for reporting the issue :)

@yifo123
Copy link
Author

yifo123 commented Jan 5, 2020

woohoo

Bentroen added a commit that referenced this issue Jan 5, 2020
If the selection was cleared between clicking a macro and its window opening, the window and title would be drawn, but not the rest, leaving you locked in it.
Fixes part of #107
@Bentroen Bentroen added the S: Resolved in next release This bugfix or suggestion has been applied to the code label Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Bug Something isn't working S: Resolved in next release This bugfix or suggestion has been applied to the code
Projects
None yet
Development

No branches or pull requests

2 participants