SOTCD Generative Audio/Visual Streaming Architecture
Vision
A 24/7 generative audio-visual stream that produces rave-quality electronic music across multiple genres, driven by real-world data signals (solar activity, seismic events, time of day). The stream should feel like tuning into a cosmic radio station broadcasting from another dimension.
Genre Palette
The system must fluently generate and crossfade between:
| Genre | BPM Range | Character | Signal Trigger |
|---|---|---|---|
| Ambient/Space | 0-80 | Drones, pads, cosmic textures | Signal < 0.2 (calm) |
| Deep House | 118-125 | Warm, soulful, 4-on-floor | Signal 0.2-0.4 |
| Acid House | 120-130 | 303 squelch, 808/909 | Signal 0.4-0.6 |
| Techno | 130-145 | Driving, industrial, hypnotic | Signal 0.6-0.75 |
| Jungle/DnB | 160-180 | Breakbeats, amen chops, bass | Signal 0.75-0.9 |
| Hardtek/Gabber | 150-200+ | Chaos mode, distortion, madness | Signal > 0.9 |
Crossfade logic: Genre transitions happen over 2-8 bars, not instant cuts. The system should feel like a continuous journey.
Hardware
Primary Streaming Box (3050 Ti)
| Component | Spec | Purpose |
|---|---|---|
| GPU | NVIDIA 3050 Ti | Real-time shader visuals |
| CPU | Sufficient for SuperCollider | Audio synthesis |
| RAM | 16GB+ | Headroom for multiple processes |
| Storage | SSD | Sample libraries if needed |
| Network | Stable, low-latency | 24/7 streaming uptime |
| OS | Ubuntu 22.04 LTS | Stability, driver support |
Software Stack
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SOTCD STREAMING BOX โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SIGNAL ORCHESTRATOR โ โ
โ โ (Node.js + OSC) โ โ
โ โ โ โ
โ โ โข Receives fuzzy signal from shdwnet.org (0.0 - 1.0) โ โ
โ โ โข Calculates derived values (BPM, genre, intensity) โ โ
โ โ โข Broadcasts OSC to all engines โ โ
โ โ โข Handles time-of-day modulation โ โ
โ โ โข Watchdog/health monitoring โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ OSC :57120 โ OSC :57121 โ
โ โผ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SUPERCOLLIDER โ โ VISUAL ENGINE โ โ
โ โ (sclang + scsynth) โ โ (Hydra / ShaderToy โ โ
โ โ โ โ / Processing) โ โ
โ โ โข Synth definitions โ โ โ โ
โ โ โข Pattern sequencingโ โ โข GPU shaders โ โ
โ โ โข Real-time DSP โ โ โข Audio-reactive โ โ
โ โ โข Genre modules โ โ โข Geometry/fractals โ โ
โ โ โ โ โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โ โ Audio โ Video โ
โ โผ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ JACK / Pulse โ โ X11 / Framebuffer โ โ
โ โ Audio Server โ โ (1920x1080@30fps) โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ FFMPEG โโ
โ โ โโ
โ โ โข H.264 video encoding (NVENC GPU-accelerated) โโ
โ โ โข AAC audio encoding โโ
โ โ โข RTMP output to multiple destinations โโ
โ โ โข Proper keyframe intervals (2s) โโ
โ โ โข Consistent bitrate (6000kbps video, 320kbps audio) โโ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ โ
โ โผ โผ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ TWITCH โ โ YOUTUBE โ โ
โ โ RTMP โ โ RTMP โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Audio Engine: SuperCollider
Why SuperCollider
- Battle-tested: Used by professionals for 20+ years
- Headless native: No browser, no GUI required
- Real-time: Sample-accurate timing
- OSC control: Every parameter controllable externally
- Patterns: Built-in sequencing system (Pbind, Pdef)
- Extensible: sc3-plugins for more synthesis options
Synth Modules Required
// Module structure - each genre has its own SynthDefs and Patterns
SOTCD_Synths/
โโโ drums/
โ โโโ kick_808.scd // Classic 808 kick
โ โโโ kick_909.scd // Punchy 909 kick
โ โโโ kick_jungle.scd // Pitched, layered jungle kick
โ โโโ snare_808.scd
โ โโโ snare_909.scd
โ โโโ snare_jungle.scd // Breakbeat snares
โ โโโ hihat_808.scd
โ โโโ hihat_909.scd
โ โโโ amen_chopper.scd // Amen break slicer
โ โโโ percussion.scd // Congas, claps, etc.
โ
โโโ bass/
โ โโโ tb303.scd // Acid bassline (resonant filter)
โ โโโ reese.scd // Detuned saw bass (jungle/dnb)
โ โโโ sub.scd // Pure sub bass
โ โโโ fm_bass.scd // FM bass (techno)
โ โโโ hoover.scd // Classic rave hoover
โ
โโโ leads/
โ โโโ supersaw.scd // Detuned saw stack
โ โโโ acid_lead.scd // 303-style lead
โ โโโ fm_bell.scd // FM bells
โ โโโ pluck.scd // Karplus-Strong plucks
โ โโโ pad.scd // Warm pads
โ
โโโ atmosphere/
โ โโโ space_drone.scd // Evolving drones
โ โโโ noise_sweep.scd // Filtered noise risers
โ โโโ cosmic_pad.scd // Spacey reverbed pads
โ โโโ granular.scd // Granular textures
โ โโโ field_recording.scd // Processed samples
โ
โโโ fx/
โ โโโ reverb.scd // Lush reverb
โ โโโ delay.scd // Tempo-synced delay
โ โโโ distortion.scd // Waveshaping
โ โโโ filter.scd // Resonant filter sweeps
โ โโโ sidechain.scd // Pumping compressor
โ
โโโ patterns/
โโโ four_on_floor.scd // House/techno patterns
โโโ breakbeat.scd // Jungle/dnb patterns
โโโ ambient.scd // Sparse, evolving patterns
โโโ chaos.scd // Glitchy, unpredictableOSC Control Interface
SuperCollider listens on port 57120 for these messages:
| OSC Address | Type | Range | Description |
|---|---|---|---|
/signal | float | 0.0-1.0 | Master intensity signal |
/bpm | float | 60-200 | Tempo |
/genre | int | 0-5 | Genre selector |
/filter | float | 0.0-1.0 | Global filter cutoff |
/chaos | float | 0.0-1.0 | Randomization amount |
/drop | trigger | - | Trigger breakdown/drop |
/kill | trigger | - | Mute/fade out |
Pattern Sequencing
// Example: Signal-reactive acid pattern
Pdef(\acid, Pbind(
\instrument, \tb303,
\dur, Prand([0.25, 0.5, 0.125], inf),
\note, Prand([0, 3, 5, 7, 10, 12], inf) + Pfunc({ ~transpose }),
\cutoff, Pfunc({ ~signal.linexp(0, 1, 200, 8000) }),
\resonance, Pfunc({ ~signal.linlin(0.3, 0.8, 0.1, 0.9) }),
\accent, Prand([0, 0, 0, 1], inf),
\slide, Prand([0, 0, 1], inf),
\amp, 0.3
));Visual Engine Options
Option 1: Hydra (Recommended for Speed)
Pros:
- Designed for live visuals
- Easy to learn, powerful results
- Audio-reactive via external FFT
- Runs in browser BUT only for visuals (no WebAudio issues)
Setup:
# Run Hydra in headless Chrome
chromium --headless --disable-gpu --remote-debugging-port=9222 \
--window-size=1920,1080 "https://hydra.ojack.xyz"FFT Audio Analysis:
- Separate process analyzes audio
- Sends OSC to Hydra with bass/mid/high levels
- Hydra visuals react to frequency bands
Option 2: Processing + Shaders
Pros:
- More control over rendering
- Can export directly to video
- Java-based, very stable
Cons:
- More setup required
- Slower iteration
Option 3: Pure FFmpeg Filters
Pros:
- No additional software
- Extremely stable
- Low resource usage
Cons:
- Limited visual complexity
- Harder to make audio-reactive
# Example: Audio-reactive visualization with ffmpeg
ffmpeg -i audio.wav \
-filter_complex "[0:a]showfreqs=s=1920x1080:mode=line:fscale=log" \
-c:v libx264 output.mp4Recommended: Hydra + FFT Bridge
โโโโโโโโโโโโโโโ Audio โโโโโโโโโโโโโโโ OSC โโโโโโโโโโโโโโโ
โ SuperColliderโโโโโโโโโโโโโถโ FFT โโโโโโโโโโโถโ Hydra โ
โ โ โ Analyzer โ โ (Browser) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
Signal Orchestrator
Node.js service that bridges everything:
// orchestrator.js - pseudocode structure
const osc = require('osc');
const fetch = require('node-fetch');
class SignalOrchestrator {
constructor() {
this.signal = 0.5; // Current fuzzy signal
this.bpm = 120; // Current BPM
this.genre = 'house'; // Current genre
this.scPort = 57120; // SuperCollider OSC port
this.visualPort = 57121; // Visual engine OSC port
}
// Fetch signal from shdwnet.org every 30s
async pollSignal() {
const res = await fetch('https://shdwnet.org/api/signal');
const data = await res.json();
this.updateSignal(data.value);
}
// Calculate derived values from raw signal
updateSignal(value) {
this.signal = value;
// Map signal to BPM (smooth transition)
this.bpm = this.mapSignalToBPM(value);
// Map signal to genre
this.genre = this.mapSignalToGenre(value);
// Broadcast to all engines
this.broadcast();
}
mapSignalToBPM(signal) {
// Ambient: 60-80
// House: 118-130
// Techno: 130-145
// Jungle: 160-180
const bpmCurve = [
[0.0, 70],
[0.2, 80],
[0.3, 120],
[0.5, 128],
[0.7, 140],
[0.85, 170],
[1.0, 190]
];
return this.interpolate(signal, bpmCurve);
}
mapSignalToGenre(signal) {
if (signal < 0.2) return 'ambient';
if (signal < 0.4) return 'deep_house';
if (signal < 0.6) return 'acid_house';
if (signal < 0.75) return 'techno';
if (signal < 0.9) return 'jungle';
return 'gabber';
}
broadcast() {
// Send to SuperCollider
this.sendOSC(this.scPort, '/signal', this.signal);
this.sendOSC(this.scPort, '/bpm', this.bpm);
this.sendOSC(this.scPort, '/genre', this.genre);
// Send to visual engine
this.sendOSC(this.visualPort, '/intensity', this.signal);
this.sendOSC(this.visualPort, '/bpm', this.bpm);
}
}FFmpeg Streaming Configuration
Proper Twitch/YouTube Settings
#!/bin/bash
# stream.sh - Production streaming config
TWITCH_KEY="live_xxxxxxxx"
YOUTUBE_KEY="xxxx-xxxx-xxxx-xxxx"
TWITCH_URL="rtmp://live.twitch.tv/app"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
# Capture audio from PulseAudio
AUDIO_INPUT="-f pulse -i default"
# Capture video from X11 display
VIDEO_INPUT="-f x11grab -video_size 1920x1080 -framerate 30 -i :99"
# Encoding settings (GPU-accelerated)
VIDEO_ENCODE="-c:v h264_nvenc -preset fast -b:v 6000k -maxrate 6000k -bufsize 12000k -g 60"
AUDIO_ENCODE="-c:a aac -b:a 320k -ar 48000"
# Stream to both platforms
ffmpeg $AUDIO_INPUT $VIDEO_INPUT \
$VIDEO_ENCODE $AUDIO_ENCODE \
-f tee -map 0:a -map 1:v \
"[f=flv]${TWITCH_URL}/${TWITCH_KEY}|[f=flv]${YOUTUBE_URL}/${YOUTUBE_KEY}"Key Settings for Stability
| Setting | Value | Why |
|---|---|---|
| Keyframe interval | 2s (-g 60 at 30fps) | Twitch requirement |
| Bitrate mode | CBR | Consistent stream |
| Audio sample rate | 48000 Hz | Standard for streaming |
| Resolution | 1920x1080 | Full HD |
| Framerate | 30fps | Stable, lower CPU |
Reliability & Monitoring
Watchdog Service
# /etc/systemd/system/sotcd-watchdog.service
[Unit]
Description=SOTCD Stream Watchdog
After=network.target
[Service]
Type=simple
ExecStart=/opt/sotcd/watchdog.sh
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetHealth Checks
// watchdog.js
const checks = {
supercollider: () => checkProcess('sclang'),
ffmpeg: () => checkProcess('ffmpeg'),
twitch: () => checkRTMPConnection(TWITCH_URL),
youtube: () => checkRTMPConnection(YOUTUBE_URL),
signal: () => checkAPIResponse('https://shdwnet.org/api/signal')
};
// If any check fails, restart the relevant service
// Log to /var/log/sotcd/watchdog.log
// Send alert via webhook if repeated failuresDirectory Structure
/opt/sotcd/
โโโ orchestrator/
โ โโโ index.js
โ โโโ package.json
โ โโโ config.json
โ
โโโ supercollider/
โ โโโ main.scd # Main startup file
โ โโโ synths/ # SynthDef files
โ โโโ patterns/ # Pattern definitions
โ โโโ osc_handlers.scd # OSC message routing
โ
โโโ visuals/
โ โโโ hydra/
โ โ โโโ sketches/ # Hydra visual sketches
โ โ โโโ osc_bridge.js # FFT โ OSC bridge
โ โโโ ffmpeg_filters/ # Backup visual filters
โ
โโโ streaming/
โ โโโ stream.sh # Main stream launcher
โ โโโ .env # Stream keys
โ โโโ ffmpeg_presets/ # Encoding presets
โ
โโโ monitoring/
โ โโโ watchdog.sh
โ โโโ health_check.js
โ โโโ logs/
โ
โโโ data/
โโโ samples/ # Optional: audio samples
โโโ state.json # Persistent state
Implementation Roadmap
Phase 1: Foundation (Week 1)
- Set up 3050 Ti box with Ubuntu 22.04
- Install SuperCollider + JACK
- Create basic 808 kick + hi-hat SynthDefs
- Test OSC control
- Basic FFmpeg stream test (solid color + audio)
Phase 2: Audio Engine (Week 2)
- Complete drum machine SynthDefs (808, 909, jungle)
- TB-303 acid bass SynthDef
- Pattern sequencing system
- Genre switching logic
- Signal โ BPM/intensity mapping
Phase 3: Visual Engine (Week 3)
- Set up Hydra in headless mode
- FFT audio analysis bridge
- Create 5-10 visual presets per genre
- Visual โ audio sync
Phase 4: Integration (Week 4)
- Signal Orchestrator service
- FFmpeg multi-destination streaming
- Watchdog/monitoring
- 24-hour test run
- Debug and stabilize
Phase 5: Polish (Week 5+)
- More synth variety
- More visual variety
- Smooth genre transitions
- Special event triggers (solar flare = chaos mode)
- YouTube/Twitch chat integration?
Required Software
# Ubuntu 22.04 base
sudo apt update && sudo apt install -y \
supercollider sc3-plugins \
jackd2 pulseaudio-module-jack qjackctl \
ffmpeg \
chromium-browser \
nodejs npm \
nvidia-driver-535 nvidia-cuda-toolkit \
xvfb fluxbox \
build-essential git
# Node.js OSC library
npm install osc node-fetch
# SuperCollider plugins
# (sc3-plugins should cover most needs)Live Input Pipeline (Guitar/External Audio)
When Shadow joins the transmission, the system becomes a duet between human and machine.
Hardware
| Component | Recommendation | Notes |
|---|---|---|
| Audio Interface | Focusrite Scarlett Solo/2i2, PreSonus AudioBox | USB class-compliant, Linux-friendly |
| Guitar | Any | Electric preferred for processing |
| DAW (optional) | PreSonus Studio One | For pre-recording/loops if desired |
Signal Flow
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ Guitar โโโโโโถโ Audio Interface โโโโโโถโ JACK Audio โ
โ โ โ (USB) โ โ (capture ports) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SUPERCOLLIDER โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Input Analyzer โ โ FX Chain โ โ Pattern โ โ
โ โ โ โ โ โ Influence โ โ
โ โ โข Pitch detect โ โ โข Reverb โ โ โ โ
โ โ โข Amplitude โโโโโถโ โข Delay โ โ โข Note โ bass โ โ
โ โ โข Onset detect โ โ โข Granular โ โ โข Amp โ drums โ โ
โ โ โข FFT bins โ โ โข Distortion โ โ โข Pitch โ lead โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โ โข Filter โ โโโโโโโโโโโโโโโโโโโ โ
โ โ โ โข Pitch shift โ โ
โ โ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ
โ โผ โผ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ โ OSC out โ โ โ Mix bus โ โ
โ โ (to Hydra) โ โ (with synths) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SuperCollider Live Input Module
// live_input.scd
// Audio input from JACK
SynthDef(\liveGuitar, {
arg in=0, out=0,
reverbMix=0.3, delayTime=0.25, delayFeedback=0.4,
distAmt=0, filterFreq=2000, pitchShift=1.0;
var sig, pitch, amp, hasFreq;
// Capture input
sig = SoundIn.ar(in);
// Analyze for pattern influence
# pitch, hasFreq = Pitch.kr(sig);
amp = Amplitude.kr(sig);
// Send analysis to OSC (for patterns + visuals)
SendReply.kr(Impulse.kr(30), '/guitar/pitch', pitch);
SendReply.kr(Impulse.kr(30), '/guitar/amp', amp);
// FX Chain
sig = (sig * (1 + (distAmt * 10))).tanh; // Distortion
sig = LPF.ar(sig, filterFreq); // Filter
sig = PitchShift.ar(sig, 0.2, pitchShift); // Pitch shift
sig = sig + (DelayC.ar(sig, 2, delayTime) * delayFeedback); // Delay
sig = FreeVerb.ar(sig, reverbMix, 0.8, 0.5); // Reverb
Out.ar(out, sig ! 2);
}).add;
// Pattern that follows guitar pitch
Pdef(\guitarFollow, Pbind(
\instrument, \sub,
\dur, 0.5,
\note, Pfunc({ (~guitarPitch / 55).log2 * 12 }).round(1) - 24,
\amp, Pfunc({ ~guitarAmp.linlin(0, 0.5, 0.1, 0.4) }),
\gate, Pfunc({ ~guitarAmp > 0.05 })
));Modes of Operation
| Mode | Description | When to Use |
|---|---|---|
| Ghost | Guitar is processed but generative music continues independently | Background jam |
| Duet | Patterns respond to guitar (bass follows, drums react) | Active collab |
| Takeover | Guitar becomes the lead, synths play supporting role | Shred mode |
| Ambient | Guitar triggers granular clouds, stretched textures | Space out |
Linux Audio Interface Notes
Most USB interfaces work with JACK on Linux. Recommended class-compliant options:
- Focusrite Scarlett Solo (~$100) - Solid, well-supported
- PreSonus AudioBox USB 96 (~$100) - You know PreSonus already
- Behringer UMC22 (~$50) - Budget option, works fine
- Audient EVO 4 (~$130) - Great preamps
# Test interface detection
cat /proc/asound/cards
# Start JACK with interface
jackd -d alsa -d hw:USB -r 48000 -p 256 -n 2The Cosmic Radio Station
When complete, SOTCD will be a living, breathing transmission that:
- Responds to the cosmos - Solar flares trigger chaos, calm space weather brings ambient drones
- Never repeats - Generative patterns ensure infinite variety
- Feels intentional - Despite being algorithmic, it has musical taste and structure
- Runs forever - 24/7 reliability with automatic recovery
- Looks as good as it sounds - Visuals that enhance the cosmic ritual
โThe frequency made audible. The portal, ever open.โ
๐ ฮฆ ๐