display graphics
Date | 2015-08-19 09:53 |
From | Anders Genell |
Subject | display graphics |
Attachments | None None |
Dear list!
I was browsing the manual and found Suppress graphics, use PostScript displays instead. Suppress graphics, use ASCII displays instead. which made me wonder if there is a way of displaying graphics using something other than ASCII or PostScript? Ideally I would love to have a simple fltk-panel where e.g. fft-curves, f-table contents and linseg/expseg shapes could be displayed and updated continuously. Is there such a thing, or would it be worth filing a feature request :-)? Regards, Anders |
Date | 2015-08-19 10:14 |
From | Ed Costello |
Subject | Re: display graphics |
Attachments | None None |
If you are familiar with HTML5 there are new websocket opcodes (in git but not release yet) that will send any type (Arrays or variables) of any size to the browser. This allows you to do an FFT, find the magnitudes and render them in a canvas giving you a serviceable spectrogram. This also works in real time for dynamically updating the spectrogram. Ed On Wed, 19 Aug 2015 at 10:55 Anders Genell <anders.genell@gmail.com> wrote:
-- Edward Costello
|
Date | 2015-08-19 10:33 |
From | Anders Genell |
Subject | Re: display graphics |
Attachments | None None |
Oh, thanks Ed! I'm not THAT knowledgeable about HTML5, but I might use this as an opportunity to Ed-ify (ok, sorry, I will refrain from horrible puns now...). Regards, Anders On Wed, Aug 19, 2015 at 11:14 AM, Ed Costello <phasereset@gmail.com> wrote:
|
Date | 2015-08-19 10:51 |
From | Ed Costello |
Subject | Re: display graphics |
Attachments | None None |
Lol :), cool if you need any help let me know, there is a manual entry in the manual git repo here in xml, but it should be pretty readable https://github.com/csound/manual/blob/44a2526a7d2d5dba1a551c164a62747ebae97662/opcodes/websocket.xml, there is also an example html file here: with accompanying csd file here I also find that using this opcode it can be a good idea to make a script that refreshes the web page you are using and call it when csound starts, this can be accomplished using the system opcode. Cheers Ed On Wed, 19 Aug 2015 at 11:35 Anders Genell <anders.genell@gmail.com> wrote:
-- Edward Costello
|
Date | 2015-08-19 10:51 |
From | Tarmo Johannes |
Subject | Re: display graphics |
Attachments | None None |
Websocket opcodes - great news! What are they? I would be happy to test. 19.08.2015 12:15 kirjutas kuupäeval "Ed Costello" <phasereset@gmail.com>:
|
Date | 2015-08-19 11:22 |
From | jpff |
Subject | Re: display graphics |
Graphins in FLTK was standard and s still available with the "correct" option which I have never remembered. \Personaly I liked FLTK grphs ------------------------------------------------------------------------------ _______________________________________________ Csound-users mailing list Csound-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-users Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2015-08-19 11:33 |
From | Tarmo Johannes |
Subject | Re: display graphics |
Hi thanks, I pulled the freshest git (develop branch), I get cmake notifications - WEBSOCKETS_H-NOTFOUND websockets_library-NOTFOUND What library does it depend on? I am on linux, opensuse 13.2 tarmo On Wednesday 19 August 2015 09:51:24 Ed Costello wrote: > Lol :), cool if you need any help let me know, there is a manual entry in > the manual git repo here in xml, but it should be pretty readable > > https://github.com/csound/manual/blob/44a2526a7d2d5dba1a551c164a62747ebae976 > 62/opcodes/websocket.xml , > > there is also an example html file here: > > https://github.com/csound/manual/blob/13b6b2fe57c0dcc4f979b54f1c4509548ba9ae > cd/examples/websocket.html > > > with accompanying csd file here > > https://github.com/csound/manual/blob/13b6b2fe57c0dcc4f979b54f1c4509548ba9ae > cd/examples/websocket.csd > > I also find that using this opcode it can be a good idea to make a script > that refreshes the web page you are using and call it when csound starts, > this can be accomplished using the system opcode. > Cheers > Ed > > On Wed, 19 Aug 2015 at 11:35 Anders Genell |
Date | 2015-08-19 11:38 |
From | Ed Costello |
Subject | Re: display graphics |
Attachments | None None |
Websockets allow you to send data pretty fast from other programs to the browser, which can then be read via Javascript. Yeah it depends on libwebsockets https://libwebsockets.org/trac/libwebsockets , I think thats available for Linux. Ed On Wed, 19 Aug 2015 at 12:24 Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote:
-- Edward Costello
|
Date | 2015-08-19 11:44 |
From | jpff |
Subject | Re: display graphics |
I could not find websockets packaged for OpenSuSE when I looked. But I am on 13.1 On Wed, 19 Aug 2015, Tarmo Johannes wrote: > Hi thanks, > > I pulled the freshest git (develop branch), I get cmake notifications - > WEBSOCKETS_H-NOTFOUND > websockets_library-NOTFOUND > > What library does it depend on? I am on linux, opensuse 13.2 > > tarmo > > On Wednesday 19 August 2015 09:51:24 Ed Costello wrote: >> Lol :), cool if you need any help let me know, there is a manual entry in >> the manual git repo here in xml, but it should be pretty readable >> >> https://github.com/csound/manual/blob/44a2526a7d2d5dba1a551c164a62747ebae976 >> 62/opcodes/websocket.xml , >> >> there is also an example html file here: >> >> https://github.com/csound/manual/blob/13b6b2fe57c0dcc4f979b54f1c4509548ba9ae >> cd/examples/websocket.html >> >> >> with accompanying csd file here >> >> https://github.com/csound/manual/blob/13b6b2fe57c0dcc4f979b54f1c4509548ba9ae >> cd/examples/websocket.csd >> >> I also find that using this opcode it can be a good idea to make a script >> that refreshes the web page you are using and call it when csound starts, >> this can be accomplished using the system opcode. >> Cheers >> Ed >> >> On Wed, 19 Aug 2015 at 11:35 Anders Genell |
Date | 2015-08-19 11:51 |
From | Ed Costello |
Subject | Re: display graphics |
Attachments | None None |
There seems to be a libwebsockets-devel which might work? Ed On Wed, 19 Aug 2015 at 12:45 jpff <jpff@codemist.co.uk> wrote: I could not find websockets packaged for OpenSuSE when I looked. But I am -- Edward Costello
|
Date | 2015-08-19 12:07 |
From | Anders Genell |
Subject | Re: display graphics |
Attachments | None None |
Ah, yes, I just tried flag --displays and that did indeed give me a window with a graph of the contents in an f-table. Thanks John!! Would it be possible to have dispfft chosen as default view upon play? Is there by the way a fftdisp variant which allows for logarithmic (dB) levels/amplitudes as well as logarithmic frequency axis? Maybe that's something for my HTML5 excursions... Regards Anders On Wed, Aug 19, 2015 at 12:22 PM, jpff <jpff@codemist.co.uk> wrote: Graphins in FLTK was standard and s still available with the "correct" |
Date | 2015-08-19 13:03 |
From | Anders Genell |
Subject | Re: display graphics |
Attachments | None None |
I just pulled and built and I have libwebsocketIO.so in /usr/local/lib/csound/plugins64-6.0 (I'm on ubuntu 14.04), but it seems csound does not find the plugin: $csound websocket.csd error: syntax error, unexpected T_IDENT (token "websocket") from file websocket.csd (1) line 16: >>> kinput websocket <<< Unexpected untyped word kinput when expecting a variable Parsing failed due to invalid input! Stopping on parser failure cannot compile orchestra end of score. overall amps: 0.0 overall samples out of range: 0 1 errors in performance Elapsed time at end of performance: real: 0.003s, CPU: 0.003s I guess I missed something obvious... Regards, Anders On Wed, Aug 19, 2015 at 1:07 PM, Anders Genell <anders.genell@gmail.com> wrote:
|
Date | 2015-08-19 13:10 |
From | Anders Genell |
Subject | Re: display graphics |
Attachments | None None |
...when I try csound -z I get "WARNING: could not open library '/usr/local/lib/csound/plugins64-6.0/libwebsocketIO.so' (/usr/local/lib/csound/plugins64-6.0/libwebsocketIO.so: undefined symbol: libwebsocket_cancel_service)" Any thoughts? Regards, Anders On Wed, Aug 19, 2015 at 2:03 PM, Anders Genell <anders.genell@gmail.com> wrote:
|
Date | 2015-08-19 13:29 |
From | Tarmo Johannes |
Subject | websockets opcodes // was: display graphocs |
Attachments | None None |
Hi,
I built libwebsockets from source (see https://libwebsockets.org/trac/libwebsockets ) - it depends on openSSL and its devel packages. It went flawlessly,
After that the csound websocket opcode was built fine and the example wesocket.html / websocket.csd worked as expected. Indeed, I needed to reload the webpage after csound was started (Perhaps there could be just a Connect button on that page? )
But if did not load the html page, I got a myriad of messages to the console from csound:
websocket: variable klfo data not sent,buffer overrrun - perhpas you can have a look?
But otherwise - exciting! I try to test it with different solutions - so far I have always written a host in C++ that handles the websocket traffic and I try to see, if I can abandon it with the websocket opcode.
Thanks again, it is a very welcome new feature!
tarmo
On Wednesday 19 August 2015 10:51:46 Ed Costello wrote: > There seems to be a libwebsockets-devel which might work? > http://download.opensuse.org/pub/opensuse/repositories/home:/mlin7442:/hackw > eek11/openSUSE_13.2/x86_64/libwebsockets-devel-1.4-1.1.x86_64.rpm.mirrorlist > Ed > > On Wed, 19 Aug 2015 at 12:45 jpff <jpff@codemist.co.uk> wrote: > > I could not find websockets packaged for OpenSuSE when I looked. But I am > > on 13.1 > > > > On Wed, 19 Aug 2015, Tarmo Johannes wrote: > > > Hi thanks, > > > > > > I pulled the freshest git (develop branch), I get cmake notifications - > > > WEBSOCKETS_H-NOTFOUND > > > websockets_library-NOTFOUND > > > > > > What library does it depend on? I am on linux, opensuse 13.2 > > > > > > tarmo > > > > > > On Wednesday 19 August 2015 09:51:24 Ed Costello wrote: > > >> Lol :), cool if you need any help let me know, there is a manual entry > > > > in > > > > >> the manual git repo here in xml, but it should be pretty readable > > > > https://github.com/csound/manual/blob/44a2526a7d2d5dba1a551c164a62747ebae9 > > 76> > > >> 62/opcodes/websocket.xml , > > > > >> there is also an example html file here: > > https://github.com/csound/manual/blob/13b6b2fe57c0dcc4f979b54f1c4509548ba9 > > ae> > > >> cd/examples/websocket.html > > >> > > >> > > >> with accompanying csd file here > > > > https://github.com/csound/manual/blob/13b6b2fe57c0dcc4f979b54f1c4509548ba9 > > ae> > > >> cd/examples/websocket.csd > > >> > > >> I also find that using this opcode it can be a good idea to make a > > > > script > > > > >> that refreshes the web page you are using and call it when csound > > > > starts, > > > > >> this can be accomplished using the system opcode. > > >> Cheers > > >> Ed > > >> > > >> On Wed, 19 Aug 2015 at 11:35 Anders Genell <anders.genell@gmail.com> > > > > wrote: > > >>> Oh, thanks Ed! > > >>> I'm not THAT knowledgeable about HTML5, but I might use this as an > > >>> opportunity to Ed-ify (ok, sorry, I will refrain from horrible puns > > >>> now...). > > >>> > > >>> Regards, > > >>> Anders > > >>> > > >>> > > >>> > > >>> On Wed, Aug 19, 2015 at 11:14 AM, Ed Costello <phasereset@gmail.com> > > >>> > > >>> wrote: > > >>>> If you are familiar with HTML5 there are new websocket opcodes (in > > >>>> git > > >>>> but not release yet) that will send any type (Arrays or variables) of > > > > any > > > > >>>> size to the browser. This allows you to do an FFT, find the > > >>>> magnitudes > > >>>> and > > >>>> render them in a canvas giving you a serviceable spectrogram. This > > > > also > > > > >>>> works in real time for dynamically updating the spectrogram. > > >>>> Ed > > >>>> > > >>>> On Wed, 19 Aug 2015 at 10:55 Anders Genell <anders.genell@gmail.com> > > >>>> > > >>>> wrote: > > >>>>> Dear list! > > >>>>> > > >>>>> I was browsing the manual and found > > >>>>> -G, --postscriptdisplay > > >>>>> > > >>>>> Suppress graphics, use PostScript displays instead. > > >>>>> -g, --asciidisplay > > >>>>> > > >>>>> Suppress graphics, use ASCII displays instead. > > >>>>> which made me wonder if there is a way of displaying graphics using > > >>>>> something other than ASCII or PostScript? > > >>>>> Ideally I would love to have a simple fltk-panel where e.g. > > > > fft-curves, > > > > >>>>> f-table contents and linseg/expseg shapes could be displayed and > > > > updated > > > > >>>>> continuously. > > >>>>> Is there such a thing, or would it be worth filing a feature request > > >>>>> > > >>>>> :-)? > > >>>>> > > >>>>> Regards, > > >>>>> Anders > > > > ------------------------------------------------------------------------ > > > > >>>>> ------ _______________________________________________ > > >>>>> Csound-users mailing list > > >>>>> Csound-users@lists.sourceforge.net > > >>>>> https://lists.sourceforge.net/lists/listinfo/csound-users > > >>>>> Send bugs reports to > > >>>>> > > >>>>> https://github.com/csound/csound/issues > > >>>>> > > >>>>> Discussions of bugs and features can be posted here > > >>>> > > >>>> -- > > >>>> Edward Costello > > > > ------------------------------------------------------------------------- > > > > >>>> ----- > > >>>> > > >>>> _______________________________________________ > > >>>> Csound-users mailing list > > >>>> Csound-users@lists.sourceforge.net > > >>>> https://lists.sourceforge.net/lists/listinfo/csound-users > > >>>> Send bugs reports to > > >>>> > > >>>> https://github.com/csound/csound/issues > > >>>> > > >>>> Discussions of bugs and features can be posted here > > > > -------------------------------------------------------------------------- > > > > >>> ---- _______________________________________________ > > >>> Csound-users mailing list > > >>> Csound-users@lists.sourceforge.net > > >>> https://lists.sourceforge.net/lists/listinfo/csound-users > > >>> Send bugs reports to > > >>> > > >>> https://github.com/csound/csound/issues > > >>> > > >>> Discussions of bugs and features can be posted here > > > > -------------------------------------------------------------------------- > > ----> > > > _______________________________________________ > > > Csound-users mailing list > > > Csound-users@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/csound-users > > > Send bugs reports to > > > > > > https://github.com/csound/csound/issues > > > > > > Discussions of bugs and features can be posted here > > > > -------------------------------------------------------------------------- > > ---- _______________________________________________ > > Csound-users mailing list > > Csound-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/csound-users > > Send bugs reports to > > > > https://github.com/csound/csound/issues > > > > Discussions of bugs and features can be posted here
|
Date | 2015-08-19 13:44 |
From | Anders Genell |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
As my recent question was concerning websockets as well, I'll repost it int your thread, Tarmo. I hope you won't mind? ---------------------- I just pulled from git and built and I have libwebsocketIO.so in /usr/local/lib/csound/plugins64-6.0 (I'm on ubuntu 14.04), but it seems csound does not find the plugin: $csound websocket.csd error: syntax error, unexpected T_IDENT (token "websocket") from file websocket.csd (1) line 16: >>> kinput websocket <<< Unexpected untyped word kinput when expecting a variable Parsing failed due to invalid input! Stopping on parser failure cannot compile orchestra end of score. overall amps: 0.0 overall samples out of range: 0 1 errors in performance Elapsed time at end of performance: real: 0.003s, CPU: 0.003s I guess I missed something obvious... ... and when I try csound -z I get "WARNING: could not open library '/usr/local/lib/csound/plugins64-6.0/libwebsocketIO.so' (/usr/local/lib/csound/plugins64-6.0/libwebsocketIO.so: undefined symbol: libwebsocket_cancel_service)" Any thoughts? Regards, Anders On Wed, Aug 19, 2015 at 2:29 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote:
|
Date | 2015-08-19 14:03 |
From | Ed Costello |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
Hey, Tarmo, what is happening there i think is that Csound is sending the klfo messages to the browser before the socket has connected, this will cause a buffer overrun because the values are not being read out of the buffer on the browser side. What I do is use the system opcodes outside of an instrument to call a script that refreshes my web page before the instruments can run. Anders, I'm not sure what could be going wrong but perhaps libwebsocketIO has not linked to libwebsockets correctly, can you do a pastebin/gist of the build output from CMake? Ed On Wed, 19 Aug 2015 at 14:45 Anders Genell <anders.genell@gmail.com> wrote:
-- Edward Costello
|
Date | 2015-08-19 14:06 |
From | Ed Costello |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
Also what version of libwebsockets are you using? Perhaps the websocket opcode is using a function from a newer/older version of the library. Ed On Wed, 19 Aug 2015 at 15:03 Ed Costello <phasereset@gmail.com> wrote:
-- Edward Costello
|
Date | 2015-08-19 14:26 |
From | Ed Costello |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
Looks like libwebsocket_cancel_service was added to the library with this commit https://www.openhub.net/p/libwebsockets/commits/346545359, does your version predate that? Ed On Wed, 19 Aug 2015 at 15:06 Ed Costello <phasereset@gmail.com> wrote:
-- Edward Costello
|
Date | 2015-08-19 14:39 |
From | Anders Genell |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
Got it working!! I Ubuntu 14.04 seems to install libwebsockets 1.2.2 from repositories, whereas when the latest release is 1.4. After building libwebsockets from source and putting a soft link in /usr/lib/x86_64-linux-gnu/ where cmake looks for it, I got it all splendidly! Thank you Ed (and Tarmo for indirectly prompting me to build libwebsockets from source)! Now for some exploration... Regards, Anders On Wed, Aug 19, 2015 at 3:06 PM, Ed Costello <phasereset@gmail.com> wrote:
|
Date | 2015-08-19 15:36 |
From | Anders Genell |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
It seems the earliest release of libwebsockets that could include libwebsocket_cancel_service is 1.3, comitted 13 months ago. Maybe there could be a specific dependency stated for cmake? Regards, Anders On Wed, Aug 19, 2015 at 3:26 PM, Ed Costello <phasereset@gmail.com> wrote:
|
Date | 2015-08-19 15:53 |
From | jpff |
Subject | Re: websockets opcodes // was: display graphocs |
If it is necessary to refresh before the opcodes work then it should be part of the init phase, possibly with a global variable to ensure it happns just once? On Wed, 19 Aug 2015, Ed Costello wrote: > Hey, > Tarmo, what is happening there i think is that Csound is sending the klfo > messages to the browser before the socket has connected, this will cause a > buffer overrun because the values are not being read out of the buffer on the > browser side. What I do is use the system opcodes outside of an instrument to > call a script that refreshes my web page before the instruments can run. > Anders, I'm not sure what could be going wrong but perhaps libwebsocketIO has > not linked to libwebsockets correctly, can you do a pastebin/gist of the build > output from CMake? > Ed > ------------------------------------------------------------------------------ _______________________________________________ Csound-users mailing list Csound-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-users Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2015-08-19 16:03 |
From | Ed Costello |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
In order to get the page to refresh just once I run a script that I call using the system opcode outside any instruments, just before instrument 1, this works fine for me, its just a bit tricky writing scripts that do such things, at least on the Mac, maybe it's easier on Linux. On Wed, 19 Aug 2015 at 16:54 jpff <jpff@codemist.co.uk> wrote: If it is necessary to refresh before the opcodes work then it should be -- Edward Costello
|
Date | 2015-08-19 16:36 |
From | Anders Genell |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
Just to report back: and you websockets example, Ed: and mashed them together as a proof of concept: It's... ALIVE!!!.... Now I just need to make it plot the output of the fft in an orderly fasion. How do one handle arrays through websockets? Regards, Anders On Wed, Aug 19, 2015 at 5:03 PM, Ed Costello <phasereset@gmail.com> wrote:
|
Date | 2015-08-19 16:49 |
From | Ed Costello |
Subject | Re: websockets opcodes // was: display graphocs |
Attachments | None None |
Everything is received as a Float64Array in the browser, k-vars are just Float64Arrays with 1 value, a-vars are arrays with ksmps values. All arrays though are 1 dimensional so a 2d k-array that is 2 * 5 will be recieved in the browser as a Float64Array with 10 values. Ed On Wed, 19 Aug 2015 at 17:38 Anders Genell <anders.genell@gmail.com> wrote:
-- Edward Costello
|