camera
cameraInput · sources · schema v1Webcam input (LOCAL ONLY). Live <video> -> WebGL2 texture; gain / mirror / on params. The captured stream is local to your browser tab and is NOT sent to other rack-mates — collaborators see a presence badge ("user X has CAMERA active") via Y-awareness, not the video itself. Multiplayer streaming (WebRTC + SFU) is deferred to a future phase. Spec: .myrobots/plans/module-camera-input.md.
the faceplate
2 inputs · 1 outputs · 4 params
inputs
| id | cable | what it does |
|---|---|---|
gain | cv | CV input that modulates the Gain control (linear scale, paramTarget=gain). Patch an LFO or envelope here to pulse the camera's RGB brightness; combines with the on-card Gain fader. control voltage (CV); modulates gain (additive offset — ±1 CV sweeps the full range, centered on the knob) |
mirror | gate | Gate input that drives the Mirror toggle. It is level-sensitive (edge: gate): the image is horizontally flipped while the level is held high (above 0.5) and un-flipped while low, so an LFO/clock/gate flips the mirror in time. With nothing patched, the on-card Mirror button owns the state. gate / trigger; modulates mirror (summed directly (the destination DSP scales it)); gate — acts while the level is high (reacts to both edges) |
outputs
| id | cable | what it does |
|---|---|---|
out | video | Video output carrying the live camera frame: aspect-fitted, optionally mirrored, gain-multiplied RGB. Patch into any downstream video module. RGB video stream |
params
| id | label | range | default | curve |
|---|---|---|---|---|
gain | Gain | 0..2 | — | linear |
enabled | On | 0..1 | — | discrete |
mirror | Mirror | 0..1 | — | discrete |
fillMode | Fill | 0..1 | — | discrete |
controls
| control | what it does |
|---|---|
| On | On (discrete 0/1, default 1 = on). The card's Pause/Resume button: off (Pause) stops the camera track to release the hardware and renders the idle navy pattern; on (Resume) re-requests the stream. |
| Fill | Fill (discrete 0/1, default 1 = fill). Aspect-fit mode set by the card's Fit toggle: 1 = Fill/cover-crop (fills the canvas, crops the off-axis, no bars), 0 = Letterbox/contain (fits the whole frame with black bars). Neither ever distorts the source aspect; when the source already matches the output aspect the card shows a non-interactive Native badge instead. |
| Gain | Gain (linear, 0 to 2, default 1). RGB multiplier applied to the camera frame in the shader (src.rgb * gain, unclamped): 0 = black, 1 = unity, 2 = doubled (bright/clipped) RGB. CV-modulatable via the gain input. |
| Mirror | Mirror (discrete 0/1, default 1 = on). Horizontally flips the frame for a selfie mirror (shader thresholds uMirror at 0.5). Settable from the on-card Mirror button or held high by the mirror gate input. The param is shared across collaborators. |
source
camera-input.ts on GitHub.