โ† f_ notebook ยท ideas/vsynth_lfo_expansion.md

Expanding the Vsynth LFO (Live LFO and Slink as references) โ€‹

Started 2026-11-23. Status: ๐ŸŸก f_lfo specced 2026-11-23 (.specify/f_lfo/spec.md, Draft, not clarified); nothing built.

Provenance and licensing, read this first. The Vsynth side is from reading vs_lfo.maxpat and vs_lfo_sin.genjit / vs_lfo_trig.genjit in the installed Vsynth package (offline, Claude, 2026-11-23). Slink was opened once on 2026-11-23 (offline, Claude) to learn what it does; the Ableton Live LFO section is from general knowledge, not checked against the device. Items marked (inferred) are worked out, not observed.

Slink is a commercial, proprietary product (Ableton pack by Hypnus Records with Chaos Culture, sold at USD 79). The Hypnus store terms (hypnusrecords.com/policies, section 1, read in full 2026-11-23) grant a license "to use" products bought from their own store with no restrictions, but section 3 leaves ownership to general IP law, and they do not say whether a pack bought through Ableton is covered. A right to use is not clearly a right to copy or derive. So: ideas only, nothing copied. This note records behavior at the level of "what it lets you do", in our own words. No code, no expressions, no control names, ranges, UI layout, labels or help text from Slink go into f_ modules, docs or this repo. Anything built from this note is designed from the idea, from our own vs_lfo and Vsynth patterns, and not by looking at Slink's internals again. The extracted files were deleted from the scratch folder. Before building anything inspired by it, Matt may want to read the actual license (the pack or the Hypnus Records site).

What vs_lfo is today โ€‹

  • CPU-side. A jit.gl.pix computes the shape from a time param; output is a 1x1 float32 texture sent to the modulated module's inlet (the "mod texture" convention, see named_mod_textures.md, f_util_mod_texture.md).
  • Controls: waveform menu (6 shapes, menu order Sine, Triangle, Sawtooth, Ramp, Pulse, S&H; the sixth is sample and hold of noise), freq dial with an x1 / x10 range toggle (0-1 or 0-10 Hz (inferred from the scale 0. 1. 0. 10. boxes)), pw numbox, enable.
  • Clocked from r draw through a speedlim, with vs_canvasLFO as the global enable.
  • Shape math is a phase fract(time * freq) fed through a per-shape formula. pw only matters for pulse and trig.

What it does not have: sync to anything, phase offset, depth, offset, smoothing, retrigger, bipolar, random shapes, or a display. Everything else in this note is about those gaps.

Live's LFO (M4L): a waveform display with a shape menu (sine, triangle, saw up and down, square, random, plus a noise-like shape); rate in Hz or tempo-synced note values, plus a free/sync toggle; phase offset; "jitter" (random deviation on the cycle); depth/amount and offset as separate controls so the output range is a window you place; a "hold" or retrigger option; and the map section, where one LFO drives several mapped parameters, each with its own min/max.

Slink (behavior only, described at idea level). Not a single-output LFO but a multi-channel modulator, with these ideas:

  • A field, not a wave. Its channels are different points on one evolving pattern, so they move in related but non-identical ways, like a wave travelling across the channel set. The pattern's character is adjustable and the same settings can be started from different positions.
  • Shaping the field, with a few macro controls (a response-curve bend, an invert/ attenuate control, a manual position offset that other signals can drive, and smoothing).
  • Rate as Hz or tempo-synced loop length, running either direction, with a freeze.
  • A few small LFOs whose targets are the shaping controls, not the destination parameter. That is the idea worth noting: modulating the generator, not the output.
  • Per-channel mapping with its own range, offset and invert, and a second target.
  • Sample and hold on chosen channels, clocked or triggered, with up and down slew.

The main idea: an LFO can be a field of related values, with an LFO layer on the shape rather than only on the destination.

The common thread, from Live's device (memory) and Slink (read): these devices treat an LFO as a source plus a shaper plus a router, not just an oscillator. vs_lfo is only the oscillator.

Expansion ideas โ€‹

Grouped by how much they change the module. Each has a rough cost and a gate question.

A. Cheap, same architecture (extra params on the existing gen) โ€‹

  1. Depth and offset instead of a fixed 0-1 output. Output = offset + depth * shape, clamped. Makes the LFO a window you place, which is how Live's device reads. Needs two dials; no structural change.
  2. Phase offset. A phase param added into fract(). Also the basis for item 12.
  3. Bipolar toggle. The WFG family already has vs_wfg_bipolar; mirror that so a texture can swing around zero for displacement-style consumers. Open question: what do the f_ modules expect from a mod texture, 0-1 or -1..1? Needs checking in named_mod_textures.md.
  4. More shapes. Triangle-with-skew (use pw as skew), exponential/log saw, stepped (quantized phase, N steps), and a smooth-random shape. Each is a one-line change in a new vs_lfo_<shape>.genjit in the existing swappable-gen pattern.
  5. Invert and rectify, a switch each. Cheap, and rectify gives the "folded" shapes people use LFOs for.

B. Timing and sync โ€‹

  1. Rate in beats. Free-Hz versus synced note values (1/16 to 8 bars), taken from vs_ntime or the transport. Needs a decision on what the Vsynth clock actually is; vs_newTime normalizes time, and I have not read how it relates to a transport.
  2. Retrigger on a bang (trig_res is already a global in the vocabulary doc). Gives one-shot and restart behavior; a "one-shot" mode turns the LFO into a decaying envelope shape, which is also the entry to an envelope module.
  3. Rate modulation (an FM input, as vs_wfg_3 has) so one LFO can modulate another's speed. Uses the same vs_inState inlet pattern.
  4. Jitter. Random per-cycle deviation of phase or rate, seeded, with a smoothing control. The thing that stops a free LFO sounding mechanical. The seed question matters: a seed makes the motion repeatable across saves (no repeat is a gate for patches that get recalled).
  1. Slew / smoothing stage after the shape: separate rise and fall times. On a square wave it gives trapezoid and glide; on a random shape it gives the drift behavior. The existing vs_bline smoothing could be reused or it may be too blunt (it is a single time constant (inferred, not read)).
  2. Sample-and-hold and step-random shapes with a rate-independent "glide" amount, so the same shape covers S&H, glide, and smooth random with one control. This is the Slink idea as I understand it.
  3. Quantize output to N levels. Stair-steps any shape; useful for modulating discrete-item parameters.

D. Routing (closest to Live's map section) โ€‹

  1. Multi-output with per-output depth and offset. One LFO, N outlets, each scaled and offset independently. Fits the "one source, several destinations" use without stacking LFOs. Cost: Vsynth modules have one texture outlet by convention, so this is a new archetype and needs an ADR-level decision.
  2. Phase-spread outputs, N outlets at evenly spaced phase offsets (quadrature, 3-phase, 8-phase). Natural for visual work: a spread of related motions with one rate.
  3. Compound LFO. Two shapes mixed or multiplied, with the mix as a dial, so a slow sine can shape a fast pulse. Overlaps with the existing WFG FM/PM; check whether chaining two vs_lfos through a modulation inlet already gives this before building it.
  1. N-value output texture. One LFO outputs an Nx1 float texture (N = 4, 8 or 16), each pixel one channel of an evolving field. A consumer samples the pixel it wants; nothing in the carrier has to change since it is still a float texture. This answers item 13's single-outlet problem without a new archetype (inferred: needs a check that consumers can sample a chosen pixel, see named_mod_textures.md). Also usable per-pixel as a spatial wave if the texture is wider.
  2. Shape-modulating LFOs. Small LFOs that drive the main LFO's own shaping controls (offset, depth, response curve), not the destination. Needs a modulation inlet on those three params, same pattern as vs_wfg_3's FM inlet (item 8).
  3. Response curve (a power curve either side of the midpoint, a common technique) available on any shape. In the f_lfo spec as curve. Cheap; could join section A.
  4. Per-channel sample and hold with freeze flags, clocked from Hz or the beat, with separate up and down slew. Extends items 11 and 10; the per-channel freeze only makes sense once item 18 exists.

E. Display and feedback โ€‹

  1. Waveform display with a moving playhead (a jsui, as in Live's device). The module is currently blind: you read the dial and guess. The m4l_ui_design.md note already argues one hero element, and this is the obvious one. A moved jsui is the kind of thing overrides handles (see build/spec.md).
  2. Output meter or value readout, so a mapped destination can be debugged.

The scalar stream is a key use (Matt, 2026-11-23) โ€‹

vs_lfo has two outlets: the 1x1 texture, and a float stream used as a driving scalar for other parameters. Read from vs_lfo.maxpat (offline, Claude, 2026-11-23): the stream comes from reading the 1x1 texture back to the CPU (jit.matrix 1 float32 1 1 into jit.spill) after the GPU pix has computed it, so the number is produced on the GPU and fetched once per draw. (Inferred, not run: that costs a readback each frame and the value is a frame behind the texture.) The pix itself is fed only a time value computed on the CPU (p new_time, from r vs_ntime), so the shape math could run on the CPU directly.

Consequences for any expansion:

  • Scalar first, texture second. For an LFO whose main job is driving scalars, computing on the CPU and making the 1x1 texture from the number (not the reverse) avoids the readback, keeps full float precision, and lets stateful features (slew, sample and hold, jitter, retrigger, freeze) exist at all, since the CPU can keep state and a pix cannot.
  • A field of N values is a Max list, not necessarily an Nx1 texture. Items 14 and 18 can output a list (or N outlets) of floats for scalar use, with a texture only where a per-pixel consumer needs one. This may remove the carrier question.

Overlap with the WFG family โ€‹

Read from vs_wfg_3.maxpat and vs_wfg3.genjit (offline, Claude, 2026-11-23):

  • Texture-only: two outlets (texture, inverted texture), no scalar outlet.
  • The gen computes phase from the position of each pixel (norm, dim, with rotation and freq), plus time, phase, FM and PM from input textures and a PWM input, bias and bm, and a shape morph; a second gen (vs_wfg3_pow) swaps the curve. The WFG dials include speed, angle, phase, pm, fm, bias, shape and a sync lock/invert.
  • Dimensions (Matt, 2026-11-23, from knowing the patch; corrects my earlier inference): a WFG takes its dimensions from the global render context, not from a per-module setting. An Nx1 WFG would therefore need a separate way to send it its own dim. Per the installed jit.gl.pix reference page (read 2026-11-23), @adapt 1 (default) makes the output match the input dims, and with @adapt 0 the output uses @dim (default 256 256). So the likely mechanism is an @adapt 0 @dim N 1 variant of the pix; not tried, and whether the gen's dim/norm and the vs_inState fallback behave with that is unchecked.
  • Already covered there, so not new for an LFO: phase offset, FM, PM, shape morph, pulse-width style control, bipolar (vs_wfg_bipolar). Not covered: depth and offset, jitter, slew, sample and hold, retrigger, freeze, a display, and any scalar output.

Direction (Matt, 2026-11-23, in chat): reaching for a WFG to make a multi-value field is counterintuitive when the goal is scalars; you want the scalar first, and that is the LFO. So the field generator (items 14, 18-19) is planned on the LFO side as multi-scalar output, not as an Nx1 WFG. The WFG overlap stays relevant only for shared shape code and conventions. The CPU-first and list-output points above are a recommendation, not yet Matt's decision.

Decided 2026-11-23 (Matt): a separate texture-to-scalar reader module (.specify/f_util_scalar/spec.md) makes any WFG at spatial frequency 0 a scalar source; f_lfo stays CPU-first because its display needs the waveform over a whole cycle. The shaping math will exist in both the WFG gen and f_lfo; test them against each other.

Dividing line (proposed): functions of position and time with no memory belong to the WFG family; anything needing state, or a scalar output, belongs to the LFO side.

Questions this raises โ€‹

  • Where does this live: extend vs_lfo, or a new f_ module? vs_lfo belongs to the Vsynth package, not this repo (the f_ modules are built from definition.py). An expansion would be a new f_lfo-style module that reuses the gen pattern, not an edit to the Vsynth original. Needs Matt's call.
  • Is a 1x1 texture the right carrier for all of this? Multi-output, display and retrigger all work better as control-rate values than as textures. See the m4l_ui_design.md row 6 recommendation (use M4L LFOs for control values, keep mod textures for per-pixel modulation only). That recommendation may make most of section B to D redundant inside Live; the case for building them is for people using Vsynth outside Live.
  • Overlap with f_util_mod_texture.md and named_mod_textures.md. Tagged mod textures change how an LFO would be routed; anything in section D should be looked at against that design before it is specced.

Suggested first slice (a recommendation, not a decision) โ€‹

Items 1, 2, 4 (triangle-skew and stepped only), 20 and 16. That gives depth, offset, phase, two more useful shapes and a display with no new architecture; it is the minimum that makes the module read like Live's. Sync (6) and the slew stage (10) are the next pair if it holds up.