Skip to content
Websocket communication for Pure Data.
HTML Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
LICENSE
README.md
index.html
screencast.gif
server
websocket-server-help.pd
websocket-server.pd

README.md

Communicate between Pure Data & web browser over a websocket.

Screencast GIF of Pure Data talking to a web browser over a websocket.

Build browser based user interfaces for Pure Data DSP patches.

tl;dr

  • Load up websocket-server-help.pd in Pd.
  • Load up index.html in your browser.

What

Some things you could do with this:

  • Send messages from a web-app to Pd patches and visa versa.
  • Control a headless Raspberry Pi running Pd with a web-app on another machine.
  • Control a libpd patch running on a tablet or phone with a web-app in the devices's browser.

Use

To build a web-app that talks to Pd instantiate the websocket-server in your patch:

[websocket-server 9001]

Then connect from the browser:

var ws = new WebSocket("ws://localhost:9001/");
w.onmessage = console.log
w.send(["hello", 42, "beep"]);

See the websocket-server-help.pd patch for more information.

Acknowledgement

Based on the excellent Websocket-Server-in-a-Patch by Nicolas Lhommet.

You can’t perform that action at this time.