[Csnd] Csound p5.js example
| Date | 2018-04-05 16:46 |
| From | Steven Yi |
| Subject | [Csnd] Csound p5.js example |
Hi All,
Chatting with Rory about Csound and p5.js, I was inspired to put
together a simple example to share as a kind of template:
Online: https://kunstmusik.github.io/csound-p5js/
Source: https://github.com/kunstmusik/csound-p5js
The project uses Web Csound (6.10) and a p5.js sketch for Glowing Orbs
(based on code from an intro programming class I am teaching). The
Csound code is using my livecode.orc for the instruments, and is
driven by a Runner instrument that is using temporal recursion to
generate the events:
https://github.com/kunstmusik/csound-p5js/blob/master/csound-p5js.js#L11-L28
I've put in some comments in places that I hope explain the parts. If
there's any questions, please feel free to ask.
Thanks and enjoy!
steven
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-05 18:13 |
| From | Rory Walsh |
| Subject | Re: [Csnd] Csound p5.js example |
Thanks for again this Seven. Works fine here in my phone. I just wonder how tight we can sync GUI events to audio events? Like mouse clicks for example. Is the latency tolerable? On Thu 5 Apr 2018, 16:47 Steven Yi, <stevenyi@gmail.com> wrote: Hi All, |
| Date | 2018-04-05 19:29 |
| From | Steven Yi |
| Subject | Re: [Csnd] Csound p5.js example |
Latency seems fine to me for basic fire and forget. I did another example here: Online: http://www.kunstmusik.com/csmouse Source: http://www.kunstmusik.com/csmouse.zip It uses just embedded csound code in csound-p5js.js (modified Sub3 going to global mixer with reverbsc, some amplitude tracking to adjust filter cutoff). p5.js code modified to just show fading circle where touched/mousePressed. On desktop the performance is good. On Android, I've found chrome to be not very good for touch latency, but very good with Firefox. (Same goes for http://instruments.kunstmusik.com and Android) I've found p5.js's mousePressed gets double events when touch events happen though (both on Surface Pro 4 Win 10 and on Android). On Thu, Apr 5, 2018 at 1:13 PM, Rory Walsh |
| Date | 2018-04-05 20:29 |
| From | Rory Walsh |
| Subject | Re: [Csnd] Csound p5.js example |
Great Steven. I modified your example to create a simple random note/ball generator. Everything syncs up fine in my initial tests. Thanks for this. It's a really nice template to have. On 5 April 2018 at 19:29, Steven Yi <stevenyi@gmail.com> wrote: Latency seems fine to me for basic fire and forget. I did another example here: |
| Date | 2018-04-06 21:49 |
| From | Guillermo Senna |
| Subject | Re: [Csnd] Csound p5.js example |
This is great! Does this mean that we could also use p5.js inside CsoundQt now that there is HTML5 support? On 05/04/18 16:29, Rory Walsh wrote: > Great Steven. I modified your example to create a simple random note/ball > generator. Everything syncs up fine in my initial tests. Thanks for this. > It's a really nice template to have. > > On 5 April 2018 at 19:29, Steven Yi |
| Date | 2018-04-06 21:53 |
| From | Tarmo Johannes |
| Subject | Re: [Csnd] Csound p5.js example |
Hi!
On reede, 6. aprill 2018 23:49.23 EEST you wrote:
> This is great! Does this mean that we could also use p5.js inside
> CsoundQt now that there is HTML5 support?
Yes, I think so - would you care to give a try?
Also all possible javascript libraries that are out there.
greetings,
tarmo
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-06 22:21 |
| From | Michael Gogins |
| Subject | Re: [Csnd] Csound p5.js example |
Yes. On Fri, Apr 6, 2018, 4:49 PM Guillermo Senna <gsenna@gmail.com> wrote: This is great! Does this mean that we could also use p5.js inside |
| Date | 2018-04-07 01:24 |
| From | Guillermo Senna |
| Subject | Re: [Csnd] Csound p5.js example |
| Attachments | csmouse_csoundQt.zip |
I adapted Rory's csmouse. BTW, is this the correct syntax for mixing and |
| Date | 2018-04-07 01:33 |
| From | Guillermo Senna |
| Subject | Re: [Csnd] Csound p5.js example |
Sorry, I meant Steven's csmouse! On 06/04/18 21:24, Guillermo Senna wrote: > I adapted Rory's csmouse. BTW, is this the correct syntax for mixing > and |
| Date | 2018-04-07 08:35 |
| From | Richard |
| Subject | Re: [Csnd] Csound p5.js example |
This is very exciting! The simplicity of Processing with the power of
Csound...
Richard
On 05/04/18 17:46, Steven Yi wrote:
> Hi All,
>
> Chatting with Rory about Csound and p5.js, I was inspired to put
> together a simple example to share as a kind of template:
>
> Online: https://kunstmusik.github.io/csound-p5js/
> Source: https://github.com/kunstmusik/csound-p5js
>
> The project uses Web Csound (6.10) and a p5.js sketch for Glowing Orbs
> (based on code from an intro programming class I am teaching). The
> Csound code is using my livecode.orc for the instruments, and is
> driven by a Runner instrument that is using temporal recursion to
> generate the events:
>
> https://github.com/kunstmusik/csound-p5js/blob/master/csound-p5js.js#L11-L28
>
>
> I've put in some comments in places that I hope explain the parts. If
> there's any questions, please feel free to ask.
>
> Thanks and enjoy!
> steven
>
> 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
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-07 20:47 |
| From | Richard |
| Subject | Re: [Csnd] Csound p5.js example |
|
How would the interface to a local running csound be made? Websockets? Richard On 06/04/18 23:21, Michael Gogins
wrote:
|
| Date | 2018-04-07 20:50 |
| From | joachim heintz |
| Subject | Re: [Csnd] Csound p5.js example |
thanks guillermo! wonderful! joachim On 07/04/18 02:24, Guillermo Senna wrote: > I adapted Rory's csmouse. BTW, is this the correct syntax for mixing > and |
| Date | 2018-04-07 21:45 |
| From | Michael Gogins |
| Subject | Re: [Csnd] Csound p5.js example |
With WebAssembly, Csound and p5.js run in the same thread, in the Web browser. Csound is controlled by the csound API just as in C, C++, Python, etc. On Apr 7, 2018 16:47, "Richard" <zappfinger@gmail.com> wrote:
|
| Date | 2018-04-07 21:59 |
| From | Richard |
| Subject | Re: [Csnd] Csound p5.js example |
|
Yes, but what if not using webassembly? Is it possible to trigger
and control Csound running locally on the computer? On 07/04/18 22:45, Michael Gogins
wrote:
|
| Date | 2018-04-07 22:02 |
| From | Michael Gogins |
| Subject | Re: [Csnd] Csound p5.js example |
Yes, using websockets as you said before. On Sat, Apr 7, 2018, 17:59 Richard <zappfinger@gmail.com> wrote:
|
| Date | 2018-04-07 22:26 |
| From | Guillermo Senna |
| Subject | Re: [Csnd] Csound p5.js example |
Could a minimal equivalent of csound.exe, but written in Qt (with QtWebChannel and some Csound API calls exposed in javascript) be useful? I mean no editor or extra stuff, just an html viewer. On 07/04/18 18:02, Michael Gogins wrote: > Yes, using websockets as you said before. > > On Sat, Apr 7, 2018, 17:59 Richard |
| Date | 2018-04-07 22:59 |
| From | Tarmo Johannes |
| Subject | Re: [Csnd] Csound p5.js example |
Michael has CsoundHtml5 viewer in the csound-extended repo based on Qt. This has simple editor but probably very close to what you have in mind. Works very well. Greetings, Tarmo 08.04.2018 0:26 kirjutas kuupäeval "Guillermo Senna" <gsenna@gmail.com>: Could a minimal equivalent of csound.exe, but written in Qt (with |
| Date | 2018-04-07 23:53 |
| From | Guillermo Senna |
| Subject | Re: [Csnd] Csound p5.js example |
Yes, something like that! But it might be even simpler (i.e., à la INScore). Just drag-and-drop the csd files in order to share our works with regular, non-technical musicians. The only thing I would consider is an Audio Setup button. And maybe even distribute a static compilation, if that doesn't mean breaking any license. Obviously, WebAssembly could be that thing. But it doesn't perform as well as native Csound yet and I imagine trying to use GEN01 in wasm might be at least cumbersome, among other things. Cheers. On 07/04/18 18:59, Tarmo Johannes wrote: > Michael has CsoundHtml5 viewer in the csound-extended repo based on Qt. > This has simple editor but probably very close to what you have in mind. > Works very well. > Greetings, > Tarmo > > 08.04.2018 0:26 kirjutas kuupäeval "Guillermo Senna" |
| Date | 2018-04-08 07:41 |
| From | Tarmo Johannes |
| Subject | Re: [Csnd] Csound p5.js example |
Hi, Drag and drop Csd player is quite good idea. I really dont have any spear time now but I will keep it in mind and perhaps will do one day. Tarmo P, 8. aprill 2018 01:53 Guillermo Senna <gsenna@gmail.com> kirjutas: Yes, something like that! But it might be even simpler (i.e., à la |