· 2 minute read

Small bugfixes

Today I am focusing on some bugfixes and cleaning up the code a bit. There were a few bugs I tracked on github that I wanted to solve.

First of all when you drag an object - while keeping the trigger pressed - and hover over a stem, it would mute/unmute the first one. This was easily solved because the state of the controller is stored in the controller object itself. I can just access contoller.selected and check if an object is currently being dragged. (If so, it would be present in .select). See this commit for details.

Then there was the issue of dual controllers reintroducing a previously fixed bug. The volume of stems would change on each frame again instead of once per trigger press. This was solved by moving a global variable to the local controller context. This way each controller has their own variablea and they don't clash anymore.

There's also a few other bugs I've fixed, but I found those during development of new features or refactoring so I didn't bother making an issue for them since they were immediately solved.

I've learned to try and limit where data is stored and try and keep everything as local as possible to where it's needed. Moving global variables to the controller context for example.