Question

I currently attend CalArts as a Music Technology major. I've currently thought up an idea that I'd like to take a stab at, though it's become a bit more complex as I've gotten into it. I know there are easier ways to do this, but I want to do this to say I could. The idea is that I might use a premade node chat server or maybe write one myself, and link it into ChucK (a programming language developed at princeton). The idea is that when buttons are pressed or return is hit, it'll send a signal to ChucK and tell it to play a sound (via the "Sndbuf" function).

My issue is that ChucK is based on C/C++ and Node is Javascript based. I'm not sure how I could get the two languages to communicate. I know ChucK has the ability to listen on ports for web server requests but I'm not a TCP/IP expert.

I'm aware some of this might not exist and that I might need to write a lot of it on my own. "It" being anything from a framework to a server. Any advise on how to make them communicate with each other would be much appreciated.

Was it helpful?

Solution

I know ChucK has the ability to listen on ports for web server requests but I'm not a TCP/IP expert.

eh? ChucK natively supports OSC and MIDI, but I've never seen any example of ChucK exposing a raw TCP socket. Even if there is a way to do it, and I'm simply not aware of it, you don't want to try to parse messages by hand with ChucK; ChucK's powers of string manipulation are... weak, to put it bluntly. Most likely what you want to do is have your application layer translate websocket requests into OSC, because it is much easier to manipulate the incoming user requests with JavaScript than ChucK.

there's an OSC library for node here: https://github.com/termie/node-osc

there's an example of receiving OSC in ChucK here: http://chuck.cs.princeton.edu/doc/examples/osc/r.ck

the ChucK mailing list is here, and is typically your best bet for ChucK inquiries: https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

OTHER TIPS

you could use a pipe? ... chuck supports standard IO .... pipe a message into a node socket listener with node.

chuck some.ck | node accept_message_input.js

so trigger a message which is then pushed back to the client via node

now the reverse... http://chuck.cs.princeton.edu/doc/program/otfp.html (look for --remote option) have node backtick (`) to node --remote

http://chuck.cs.princeton.edu/doc/program/otfp.html

I'm glad I found someone seeking chuck and node integration ... lets do this!!! https://github.com/copremesis

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top