[Csnd] Csound websocket increasingly slow
Date | 2018-04-08 17:31 |
From | Richard |
Subject | [Csnd] Csound websocket increasingly slow |
I'm trying the csound websocket example (http://www.csounds.com/manual/html/websocket.html)
with p5js. 3 simple sliders for R,G,B control. Only the Red slider
is used to connect to Csound. printk2 kinput
gets slower each time I move the slider, as if something is
filling a buffer or so. Could not send the files. Try to paste them in the mail. Here is sketch.js:
<!DOCTYPE html>
Richard |
Date | 2018-04-08 18:17 |
From | zappfinger |
Subject | Re: [Csnd] Csound websocket increasingly slow |
BTW, more or less the same behaviour with the original csd and html file from the example. After a few changes to the slider it stops updating the csd... -- Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2018-04-12 18:02 |
From | Edward Costello |
Subject | Re: [Csnd] Csound websocket increasingly slow |
I built Csound with libwebsocket 1.0.2o_1 and I’m not seeing any issues. I’ve tested with Chrome 65 on macOS 10.13.3. What system are you using? Ed > On 8 Apr 2018, at 18:17, zappfinger |
Date | 2018-04-12 18:59 |
From | Richard |
Subject | Re: [Csnd] Csound websocket increasingly slow |
In retrospect, your example csd and html file seems to work. I
only have a problem with the attached example in p5js. <script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
I thought maybe it was a flaw in my code (sending too much data), so I also tried sending only when the slider value changes, but the result is the same. Richard On 12/04/18 19:02, Edward Costello
wrote:
I built Csound with libwebsocket 1.0.2o_1 and I’m not seeing any issues. I’ve tested with Chrome 65 on macOS 10.13.3. What system are you using? EdOn 8 Apr 2018, at 18:17, zappfinger <zappfinger@GMAIL.COM> wrote: BTW, more or less the same behaviour with the original csd and html file from the example. After a few changes to the slider it stops updating the csd... -- Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2018-04-12 19:05 |
From | Edward Costello |
Subject | Re: [Csnd] Csound websocket increasingly slow |
Do you need to use socket.io? Would it be possible to test just using the native javascript Websocket object like in the manual example? Might help isolate the problem. Ed
|
Date | 2018-04-12 20:54 |
From | Richard |
Subject | Re: [Csnd] Csound websocket increasingly slow |
I would have to give that a try. On 12/04/18 20:05, Edward Costello
wrote:
Do you need to use socket.io? Would it be possible to test just using the native javascript Websocket object like in the manual example? Might help isolate the problem. |
Date | 2018-04-15 10:58 |
From | Richard |
Subject | Re: [Csnd] Csound websocket increasingly slow |
Sorry for the confusion, but I WAS using websocket already in my
code. The problem is solved when I only send the changes, see the
comments in the code below. One thing I do not understand: the second argument in creating a websocket is reserved for the protocol, but in your websocket.html example it is used for the channel, how can this work? var websocketIn = new WebSocket("ws://127.0.0.1:8888", "klfo");
Here is my code that works (sketch.js):
On 12/04/18 20:05, Edward Costello
wrote:
Do you need to use socket.io? Would it be possible to test just using the native javascript Websocket object like in the manual example? Might help isolate the problem. |
Date | 2018-04-16 10:57 |
From | Edward Costello |
Subject | Re: [Csnd] Csound websocket increasingly slow |
I think I’m making a different protocol for each variable which in retrospect might be the problem. How is it with just one variable? Ed
|
Date | 2018-04-21 08:26 |
From | Richard |
Subject | Re: [Csnd] Csound websocket increasingly slow |
I was just using one variable, but as I said the problem is gone when I only send data when the slider changes. It goes wrong when I send (the same) data too fast. BTW, I tried it with 2 variables now, works fine. In my javascript I use 2 connections like this: var connOut = new WebSocket("ws://127.0.0.1:8888", "kinput"); Then, in order not to overflow the data, I have to use the following: function draw() { BTW2, the websocket example is a bit confusing, since the syntax is: xout1[, xout2, xout3, ..., xoutN] websocket iport, xin1[, xin2, xin3, ..., xinN]
But in the example csd you use: kinput websocket iport, klfo
printk2 kinput
kinput is actually an output? On 16/04/18 11:57, Edward Costello
wrote:
I think I’m making a different protocol for each variable which in retrospect might be the problem. How is it with just one variable? |
Date | 2018-04-21 11:54 |
From | Michael Gogins |
Subject | Re: [Csnd] Csound websocket increasingly slow |
Yes. On Sat, Apr 21, 2018, 03:26 Richard <zappfinger@gmail.com> wrote:
|
Date | 2018-04-21 12:39 |
From | Richard |
Subject | Re: [Csnd] Csound websocket increasingly slow |
I know, it was more a rhetorical question... ;-) BTW, for anyone who's interested: I created a vertical slider
from p5js horizontal slider by rotating and translating it. function Vslider(x,y, txt, min,max,deft){ You can use it like this in setup(): // create sliders var vslids = []; Richard On 21/04/18 12:54, Michael Gogins
wrote:
|