-
Notifications
You must be signed in to change notification settings - Fork 130
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
Sockets changing Nexus #146
Comments
Hi Luis, this is freezing because it creates an infinite loop or socket emissions.any time you set the value of a dial, the 'change' function is called. So the sequence of events in your situation is: You change a dial Their needs to be a built-in solution to this kind of loop. I believe there is already. I'll look at the code and get back to you. |
Thank you for quick answer, as always. |
Luis, can you give me a complete list of the types of interface components you are using in this setup? You mentioned sliders and knobs -- anything else? Basically, I don't see an easy general solution, and this was unfortunately an oversight of the version 2 API I created. I think it will take some extra development to resolve, which I can't do at the moment. But if you let me know the types of interfaces you are using, I can send you patch functions which will get the job done for your project at the moment. |
Thank you very much for the quick answer Taylor. |
In both cases (slider and dial) you can use the following code to set the value without causing the slider/dial to trigger its 'change' function. dial1._value.update(v);
dial1.render(); However, since this causes the dial/slider to update without triggering its 'change' function, that means it will also not execute any web audio code you have in its 'change' function. So you will need to manually duplicate your web audio code here in the socket listener. It's not great -- again, this is a temp fix to keep your project rolling. dial1._value.update(v);
dial1.render();
// web audio code goes here
polySynth.volume.value = v I will keep thinking about a more elegant solution for this. |
Thank you again taylorbf, always accurate. |
Hello and good day!
I am posting this issue because I am instantiating a received socket to change the GUI value and I'm getting problems.
Almost all the time I receive a socket that wants to change a slider or a knob from other person (like as I'm changing mine, I change all others) the software freezes. But if I instantiate it to just control tonejs audio there is no problem, only when I want to change the nexus uis
I am doing it like this
(values is an array of vars for each widget)
socket.on('uiSocketSynthVolume', function(data) {
if (isStreaming == true) {
if (data.y == "synthVolume") {
//polySynth.volume.value = data.x;
values[0] = data.x;
if (UI.synthvolume.value != values[0]) {
UI.synthvolume.value = values[0];
}
} else {
console.log("");
}
}
});
And a socket.on all the other users to when they change it
Best, Luis
The text was updated successfully, but these errors were encountered: