triode

Common Creative Recipes

In the Playground, select a preset and change its sliders. Some controls take effect while the cue plays. The editor marks changes that need Run.

PresetStarting point
Textured BoxAdjust Frequency, Spin X or Spin Y while the cube keeps rotating. Run the scene cue after editing the oscillator code.
Points TrailRun the point field after changing Grid. Raise Trail to keep longer traces while the field keeps playing.
Points WavesSet Wave speed to zero to pause. Edit a sine coefficient and run the scene cue from the same phase and view. Running after a Grid side change starts the new grid at zero phase.
Torus PulseChange the spin and pulse as the torus moves. Run after changing its geometry.
Scene Texture BridgeRender a point texture to o1 and sample it with a mipmapped material on a sphere in o2.
Terrain DisplacementPaint the plane in o1 and sculpt its height in o2. Replace either cue while the scene in o0 keeps playing.
Repeat PlaneEdit the bytes, repeat count, and filter in o1, then mix the tile with an oscillator on the plane in o0.
Squares SkyUse separate X and Y textures to place 500 squares, then change how fast the field scrolls.
Scrolling Dots StormUse a random Y texture and a noise signal on X, then scroll the dot field.
Stack and CircleEnlarge the stacked box, then change Stack to Circle and set a radius. Run the scene cue after each edit.
Bounded NoiseChange the bounds or time offsets to move 500 colored boxes through noise.
Instanced ColumnsSet Height rule to City and run the scene cue. Edit the height rule to change which towers rise.
Dynamic InstancingAdjust Rotation Speed while the same Suzanne geometry plays. Run the scene cue after changing Visible instances.
AfterimageChange Damping while the trail plays. Edit the four channel thresholds in the decay cue.
Render to TextureChange the smaller torus's relative phase in o1. The backdrop and spheres in o2 keep using the live source.
Geometry ColorsEdit one height-to-color ramp and run the scene cue.
Morph TargetsBlend Spherify and Twist independently on the same mesh. Set both to zero to return to the box.
Dashed LinesChange the second value in curveDash or boxDash to edit the gap, then run the scene cue.
Spline ExtrusionChoose the open pipe or closed knot and run after changing the path, tube sides, or camera mode. Toggle Look ahead as you ride.
Dynamic WaterClick the preview, move with WASD or the arrows, and drag to turn. Edit wave and run the scene cue from the new view.
Draw RangeChange Link distance and the connection limit while the particles move. Set Link distance to zero to clear the links.

In Repeat Plane, flipY: false keeps the supplied byte order. The first row starts at texture v = 0. Switch filter from "nearest" to "linear" to blend neighboring texels. wrap: "repeat" tiles beyond the texture bounds.

Squares Sky and Scrolling Dots Storm clamp their coordinate textures at the edges and sample the nearest byte. Terrain Displacement samples both published buffers with linear filtering and clamped edges. It flips the mesh's V coordinate for both buffers so paint and relief line up.

Terrain Displacement starts with the painted band. Select Original dots and run the color cue to use the 500 × 500 source pattern. The default height cue uses staticTexture: true so Terrain can cache its shadow. Publish a time-varying height cue with .out(o2) to update the shadow as it plays. Instanced Columns starts with Shaded landscape. Select City and run the scene cue to work on the original two-noise rule.

For an embedded signal-only patch, use the non-global runtime.

const triode = await Triode.create({ makeGlobal: false, detectAudio: false });
const H = triode.synth;
H.osc(5).out(H.o0);
H.render(H.o0);

Audition the Line Loop Thread position signal

  1. Open Line Loop Thread and let the trail build up.
  2. Change only the final line from render(o2); to render(o1);. With the caret on that line, press Alt+Enter to view the position signal.
  3. Change the line back to render(o2); and press Alt+Enter again. The loop kept drawing in o0 and the trail continued to accumulate and fade in o2 while you viewed o1. Switch back promptly to see earlier strokes fade alongside new ones.

Layer the Textured Box over yellow noise

Replace the Textured Box cue with this version and run the full buffer. Frequency and both spin controls target the transparent scene in o1. The Hydra cue layers that scene over yellow noise in o0.

const box = React.createRef();
const spinX = liveParam("spinX", o1);
const spinY = liveParam("spinY", o1);
renderScene(
  <>
    <mesh ref={box}>
      <boxGeometry />
      <TriodeMaterial signal={osc(liveParam("frequency", o1), params.sync, params.offset)
        .rotateDeg(noise(params.noiseScale).mult(45))} />
    </mesh>
    <Spin target={box} x={() => spinX() * 60} y={() => spinY() * 60} />
  </>,
  o1,
  { cameraPosition: [2, 2, 3], clearAlpha: 0, controls: true },
);

solid(1, 1, 0).mult(noise()).layer(src(o1)).out(o0);
render(o0);

Source docs/recipes/common-recipes.md