you like generative art? me too. here's some cool shit
"OPTIMIZE LATER"
The nextgenart projects support multiple connection methods to receive OSC (Open Sound Control) messages for real-time parameter control.
- WebSocket - Bidirectional, lower latency (original)
- Server-Sent Events (SSE) - One-way streaming, more reliable (new)
- Hybrid Client - Auto-fallback from WebSocket to SSE (recommended)
import { RelayClient } from './lib/RelayClient'
const relay = new RelayClient(
import.meta.env.VITE_SOCKET_URL || 'https://relay.elijahlucian.ca'
)
relay.on('connect', () => {
console.log('Connected via:', relay.getMode())
})
relay.on('osc', (data) => {
console.log('OSC:', data.address, data.args)
})- WebSocket:
wss://relay.elijahlucian.ca/ws - SSE Stream:
https://relay.elijahlucian.ca/state/stream - State Snapshot:
https://relay.elijahlucian.ca/state
OSC Source → Relay Service (UDP:57121) → WebSocket/SSE → nextgenart → dankstore → URL params
- Multiple connection methods with automatic fallback
- State snapshot on connection (SSE mode)
- Value caching for latest OSC data
- Lower latency WebSocket with SSE reliability
- Automatic reconnection (3s interval)
- No external dependencies (uses browser APIs)
- Automatic URL parameter sync via dankstore
/sketchy-3d/src/lib/RelayClient.ts- Hybrid client (recommended)/sketchy-3d/src/lib/RelaySocket.ts- WebSocket-only client/sketchy-3d/src/lib/RelaySSE.ts- SSE-only client/sketchy-3d/RELAY_SSE.md- SSE integration guide/sketchy-3d/RELAY_CONNECTION.md- WebSocket connection details/sketchy-3d/OSC_DANKSTORE_INTEGRATION.md- OSC message handling and parameter mapping
- Uses native browser APIs, NOT Socket.IO
- RelayClient provides unified interface regardless of connection method
- Environment variable
VITE_SOCKET_URLcontrols endpoint - All OSC parameters automatically sync to URL via dankstore
- Supports generic
/param/{name}pattern for any registered parameter - SSE mode provides state caching and initial snapshot
- demo
- []
- automated deployments based on branch name
- add config / dockerfile file pointing to latest iteration of this project.