Open rillig opened 6 years ago
One thing about the knobs is that they aren't parsed from the source code, but rather there is detection code on the "knobs" object. IIRC, if a knob isn't accessed in every call of your script, it will behave strangely. So you have to make sure to do that.
As far as I understand the code, the knobs have to be used at least once every 1.5 seconds to stay on the screen. The keyword is lower_usage
.
I added some debugging code (console.log in the events) and found out that a knob is displayed when its knobUsages
is larger than 0.25. When it is actually accessed, its usage is increased by a bit. When it is not used for a time of 100 ms, its usage gets decremented.
Now the thing is that a knob can always be around the magic value 0.25 and then the screen gets nervous. Whether a knob is active or not should work more like a Schmitt trigger, which provides more stability.
An alternative were to change the rule set:
knobUsage[key] = 2
.I tried this, but the above program still creates lots of noise, and even when I put a return 0
in the first line to get immediate silence, the noise still continues for minutes. I didn't wait until it would finally stop. The knobUsage
decreased a little bit, by about 0.1 every five minutes. That was totally unexpected.
yup that code stinks a bit ;). you are very welcome to improve / rewrite it.
however, i am not a big fan of displaying knobs immediately, as this would spawn many knobs during the writing of long knob names.
the last error you described sounds like the noise would never stop, because one of the roules for roll back kicked in.
Describe the bug When I paste the following code, it produces an ugly noise and shows the expected knobs on the right side. After waiting for a few seconds, maybe hovering over the knobs, they disappear and are replaced by the "Tip: add knobs" message. They start to flicker, quickly switching between the "Tip" message and the knobs. At this point, it is not possible to use the knobs.
Expected behavior The knobs are generated, even though the knob names cannot be parsed from the source code. Using the knobs it is possible to control the phase shift and volume of each of the harmonics. Since the knobs don't change effectively, the right half of the screen should not be repainted.
Environment (please complete the following information):
Additional context