https://github.com/derekxkwan/socketmusic-server
server for my socketmusic project
https://github.com/derekxkwan/socketmusic-server
clojurescript shadow-cljs socketmusic
Last synced: 2 months ago
JSON representation
server for my socketmusic project
- Host: GitHub
- URL: https://github.com/derekxkwan/socketmusic-server
- Owner: derekxkwan
- License: gpl-3.0
- Created: 2018-11-21T18:34:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T12:02:07.000Z (about 6 years ago)
- Last Synced: 2025-01-18T04:14:00.421Z (4 months ago)
- Topics: clojurescript, shadow-cljs, socketmusic
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# socketmusic-server v0.01
server for the socketmusic series of projects (such as [socketMusic:wireless](https://derekxkwan.com/musicart/socketMusic.html))## about
abstracting out the server from my previous socketmusic:wireless project and moving to a new build system of **ClojureScript** compiled by **shadow-cljs** to run on **node.js**- to install shadow-cljs: `npm install -g shadow-cljs`
## npm dependencies
- `express`
- `socket.io`
- `node-osc`## usage
- hosted osc server is at port `33333`
- outgoing osc messages are on port `11111`
- website is hosted on port `3000`
- the root directory of the hosted website is passed as the **first arg**
- defaults to `default-page/` folder
- running the app: `node socketmusic.js [webpage dir]`## osc-messages
format for osc messages sent to the osc server
- `/debug [args]` prints the args to the console
- `/client-list` sends out base64 client list on osc output port on address `/client-list`
- `/num-clients` sends the number of clients on osc output port on address `/num-clients`
- `/ws/all [event-name] [opt. args]` broadcasts named event with args bundled in array format to all clients
- `/ws/client-idx [client-idx] [event-name] [opt. args]` - trigger named event with args bundled in array format to client at given index of client-list
- `/ws/client [client] [event-name] [opt. args]` - trigger named event with args bundled in array format to specified (in base64) client
- `/ws/rand-client [event-name] [opt. args]` - trigger named event with args bundled in array format to random client## build
- compile: `shadow-cljs compile app`
- watch: `shadow-cljs watch app`
- build: `shadow-cljs build app`
-
## license
gpl v3