All Projects → RandomStudio → osc-simulator

RandomStudio / osc-simulator

Licence: MIT license
A utility to test Open Sound Control sending and receiving from the browser

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to osc-simulator

Sonic Pi Tool
🎻 Controlling Sonic Pi from the command line
Stars: ✭ 133 (+478.26%)
Mutual labels:  osc, creative-coding
Score
ossia score, an interactive sequencer for the intermedia arts.
Stars: ✭ 808 (+3413.04%)
Mutual labels:  osc, creative-coding
framework
A creative coding library.
Stars: ✭ 35 (+52.17%)
Mutual labels:  osc, creative-coding
Libossia
A modern C++, cross-environment distributed object model for creative coding and interaction scoring
Stars: ✭ 133 (+478.26%)
Mutual labels:  osc, creative-coding
isomorphic-relay-app
Example isomorphic React-Relay-(Modern / Classic)-Router app and helper lib that connects to Artsy's GraphQL service
Stars: ✭ 13 (-43.48%)
Mutual labels:  relay
hxProcessing
Use Processing in Haxe's Java target
Stars: ✭ 19 (-17.39%)
Mutual labels:  creative-coding
itdagene-webapp
Next-gen itdagene webapp
Stars: ✭ 15 (-34.78%)
Mutual labels:  relay
periqles
React form library for Relay and Apollo
Stars: ✭ 124 (+439.13%)
Mutual labels:  relay
SketchSynth
A drawable OSC control panel
Stars: ✭ 46 (+100%)
Mutual labels:  osc
recoded
Re-coded by the School for Poetic Computation—crowdsourced recreations of early digital works using new tools
Stars: ✭ 57 (+147.83%)
Mutual labels:  creative-coding
manyworlds
A scifi-inspired study of signed distanced functions and noise fields in WebGL
Stars: ✭ 24 (+4.35%)
Mutual labels:  creative-coding
react-native-relay
🚀 demo React Native app using React Navigation and Relay with mutations and subscriptions
Stars: ✭ 20 (-13.04%)
Mutual labels:  relay
relay-nextjs
⚡️ Relay Hooks integration for Next.js apps
Stars: ✭ 171 (+643.48%)
Mutual labels:  relay
processing.py-book
Resources for "Learn Python Visually – Creative Coding in Processing.py" from No Starch Press
Stars: ✭ 50 (+117.39%)
Mutual labels:  creative-coding
babel-plugin-flow-relay-query
Babel plugin which converts Flow types into Relay fragments
Stars: ✭ 38 (+65.22%)
Mutual labels:  relay
mediapipe-osc
MediaPipe examples which stream their detections over OSC.
Stars: ✭ 26 (+13.04%)
Mutual labels:  osc
tidal-looper
Different looper variants for SuperDirt to provide live sampling in TidalCycles.
Stars: ✭ 55 (+139.13%)
Mutual labels:  osc
dummyhttp
Super simple HTTP server that replies a fixed body with a fixed response code
Stars: ✭ 25 (+8.7%)
Mutual labels:  dummy
gestalt
Creative coding playground - Color, Note, Code
Stars: ✭ 16 (-30.43%)
Mutual labels:  creative-coding
safe-relay-service
Relay Tx Service for Gnosis Safe
Stars: ✭ 48 (+108.7%)
Mutual labels:  relay

OSC Simulator

How many times have I just needed to test my OSC setup is working properly? So. Many. Times.

Here is an easy utility to test receiving and sending of OSC messages from a browser interface.

Screen Recording

Installation

You need to have Node (tested with Node v8.9.0 LTS) installed on your system.

After cloning, cd to the osc-simulator folder and run

npm install

Basic usage

Build and launch

Launch the server, build and open the browser interface in one step:

npm run dev

A faster "static build" option will be coming soon.

Test receiving messages

By default, the OSC Simulator server will listen on port 12345 and is bound to ip 0.0.0.0.

So point your OSC client or application to send to the IP address of the machine that OSC Simulator is running on (or just 127.0.0.1) and you should see incoming OSC messages logged nicely:

  • incoming OSC messages are logged by the Node server in the terminal
  • OSC messages are shown in the browser interface, too, under the heading "Received OSC @ 127.0.0.1:12345"

Test sending messages

For now, you have two options:

  • Send to the address "/dummy" with a single string argument ("frombrowser")
  • Send to a custom address with a single custom string argument

In either case, you can send to the default (the OSC Simulator server itself!) @ 127.0.0.1:12345 or enter the destination IP address and port for your OSC client application.

Configuration

This project uses the excellent configuration manager for Node, rc. That means you have a number of options for overriding the default settings.

For example, you can override from the command line:

node server/server.js --sending.ip=192.168.1.170

Or create your own .osc-simulatorrc file in the root of the project and use JSON to override the properties you want (these get merged into the defaults, so just specify the things you want to change):

  {
    "sending": {
      "ip": "192.168.1.170",
      "port": 12345
    },
    "receiving": {
      "port": 12346
    }
  }

Using a file is nice because you get to persist your settings. Command line arguments will always take precedence, though.

Logging

Logging on the server side is provided by the venerable Winston.

Logging high frequency messages

To debug fast-moving streams of OSC data, it can be helpful to write everything to disk so you can search, etc.

OSC Simulator allows you to optionally log to file (in addition to the console) by setting --logging.toFile=true on the command line or overriding elsewhere (as described above).

You can also disable the "received" message list on the front end (useful if you're expected a lot of high-frequency incoming messages) by setting --logging.frontEndMessages=false

CLI and Standalone Mode

CLI usage

Launch the node server manually:

node server/server.js

If you pass no extra arguments, the server sets a default destination+port (127.0.0.1:12345) and listens on the default 0.0.0.0:12345. In other words, you will be sending OSC messages from the server to itself. And these will be visible in the browser UI if you have it open.

Now you can type commands in the terminal, followed by return, in the following form:

{address} [args]

... which means send to the {address}, with optional [args] (separate with spaces), e.g. /test one two three

Standalone Mode

It can be very useful to run the server as simple OSC client and/or server, either to initiate OSC commands to a remote application or to simply log any incoming OSC messages... without relaying these to the browser UI.

To do this, just launch in standalone mode:

node server/server.js --standalone true

...or, equivalently:

npm run standalone

Even better, you can specify any or all of the destination/server IP and port settings. For example:

node server/server.js --standalone true --receiving.port 5555 --sending.port 12345 --sending.ip 192.168.1.99

...which is the same as:

npm run standalone -- --receiving.port 5555 --sending.port 12345 --sending.ip 192.168.1.99

This means you can even launch the system with a basic setup (npm run dev) and then start a second instance of server.js in standalone mode to test relaying OSC messages to another server instance from the browser.

How it works

Browsers are not allowed to send or receive UDP packets. But Node servers can. This OSC Simulator uses a websocket (typically on port 5000) to act as a relay between the "frontend" in the browser and the "backend" Node server.

Messages initiated from the browser:

  1. Websocket message sent to Node server
  2. Node server relays the message via OSC

And the other way around. Incoming OSC messages:

  1. Received by the Node server, if it's listening on the correct port
  2. Node server relays messages via a Websocket message to the browser UI

Roadmap

Some ideas for improvements:

  • Allow arbitrary adding, removing and re-ordering of arguments (of configurable types) through a simple interface
  • Allow saving/loading of preset messages (with their argument types and ordering)
  • Serve pre-built frontend via Express rather than compiling every time
  • Dockerise for easy portability
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].