Use with React? #70
-
I'm trying to incorporate this into a React app, but I'm having trouble with the module resolution. Keep getting errors that modules like gram, zlib, fs can't be resolved. When I run a simple node app I don't get this problem. Any idea what I'm messing up? Thanks for any suggestions.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hey @keeper2597, Unfortunately, ableton-js doesn't work in the browser since it uses UDP to communicate with the Python plugin in Live. You'd need to create a server in Node that communicates with Live using ableton-js and offers an HTTP or WebSocket API that your React app can use. This is how I do it in AbleSet as well :) |
Beta Was this translation helpful? Give feedback.
-
Understood - I just found the issue raised a year ago that points to socketio as a good solution. I'm looking in that direction now. Thanks for your great work! |
Beta Was this translation helpful? Give feedback.
-
Hey @leolabs & @keeper2597 As mentioned in my above comment, I have managed to build a TCP Websocket server inside the Remote script and run it using threading.Thread, and I've sent some compressed data back and forth from a React application without needing to run a separate NodeJS Server. Seems to be a viable option at the moment and is working quite well. The code I've written is for my own project, but I will try and incorporate it into this project code and open a PR for review. |
Beta Was this translation helpful? Give feedback.
-
@leolabs & @keeper2597 draft PR created here |
Beta Was this translation helpful? Give feedback.
Hey @keeper2597,
Unfortunately, ableton-js doesn't work in the browser since it uses UDP to communicate with the Python plugin in Live. You'd need to create a server in Node that communicates with Live using ableton-js and offers an HTTP or WebSocket API that your React app can use. This is how I do it in AbleSet as well :)