Comments (6)
yes! there is already websockets as well as webrtc, its just a matter of deciding on an api.
i have sent code via websockets here: https://github.com/ojack/hydra-sync
could you explain a little more how you would imagine using it?
from hydra.
Since 2018, I added websocket support on all my forks of Hydra and it works fine.
from hydra.
it could be running other browsers on the network without having the need to stream with webrtc as fragment shaders and uniforms are sent as text, very lightweight on the bandwidth.
But I got another plan which is to feed my own VJ software with these fragment shaders and uniforms in a standalone visualizer app made with Cinder.
from hydra.
There is a function pb.broadcast() to send text via websockets, pb.sendToPeer() to send text via webrtc to a specific peer, or pb.sendToAll() to send to all connections via webrtc.... but they are only used internally right now. I need to look it over to make it a bit more usable.
from hydra.
great! at this point I have to check your code before talking without knowing ;-)
from hydra.
sorry for bumping an old thread but I just tested websocket to pass parameters. example app on processing:
import websockets.*;
WebsocketServer ws;
void setup(){
size(600,200);
ws= new WebsocketServer(this,8025,"/");
frameRate(10);
}
void draw(){
ws.sendMessage("0,"+map(mouseX,0,width,0,1));
}
void webSocketServerEvent(String msg){
println(msg);
}
then running this on hydra console:
const socket = new WebSocket('ws://localhost:8025/');
// Connection opened
socket.addEventListener('open', function (event) {
socket.send('Hello Server!');
});
var dd=Array(128).fill(0.5)
socket.addEventListener('message', function (event) {
let [index, val] = event.data.split(",");
//console.log(index, val)
dd[index] = parseFloat(val);
});
and for example
osc(30,0.01,()=>dd[0]).out()
Should I go ahead and add a page in the doc folder? Of course the "API" can be improved by using stringified JSON, for example.
from hydra.
Related Issues (20)
- Link to interactive docs broken HOT 1
- p5 fails to init after reload
- dev branch double space triggers period
- set initStream quality
- a.onBeat() not working? HOT 1
- Add yourself to the contribution list 💓 HOT 28
- exclude dist folder from dev branch HOT 7
- landing modal suggestions
- Dynamic canvas to pass into hydra-synth HOT 1
- WebRTC Deprecated? HOT 1
- WebRTC issue on local server
- Hydra three.js integration needs updating (+workaround)
- Hide code via urlParameter doesn't work anymore HOT 5
- needed to --ignore-engines to build
- Show documentation from within editor
- Make it easier to use local videos from within hydra editor
- Icons not visible if .brightness is set to 1
- simplify readme HOT 5
- add .github repo for the "landing" page on GH
- Use extensión libraries "inside a web page" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hydra.