8000 feat(fx): ADSR envelopes, hardware panel encoders, paused-mode preview by johannboehme · Pull Request #9 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

feat(fx): ADSR envelopes, hardware panel encoders, paused-mode preview< 8000 /span> - #9

Merged
johannboehme merged 1 commit into
mainfrom
claude/elated-bartik-7fe883
May 1, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/elated-bartik-7fe883

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

Builds out the P-FX system into a TE-inspired hardware-pad
instrument with per-effect ADSR envelopes, a CRT-style screen that
toggles between parameter read-out and an envelope editor, and a
paused-mode "audition" workflow that lets you dial in effects on
the live frame before committing anything to the timeline.

  • ADSR per effect — each P-FX kind now has an envelope that's
    baked into every recorded capsule. Release-tail extends outS
    past the snapped grid moment so the fade plays out properly when
    you let go of a pad.
  • Hardware panel screen with two modes — two skeuomorphic
    plastic buttons left of the green CRT switch it between PARAMS
    (live encoder read-out) and ENV (four draggable phosphor knots
    shaping attack/decay/sustain/release on an OP-1-style cubic
    Bezier curve).
  • Live indicator on the curve — a glow ball rides the bezier
    while a pad is held and through the release tail, with a fast
    cross-sustain sweep + comet-trail on release.
  • Per-kind wetness — each effect dims itself intelligently via
    applyWetness (intensity for overlays, displacement magnitude
    for zoom/rgb, mix for echo, warp for tape) instead of a generic
    alpha-blend that would ghost displacement effects.
  • Audition mode (paused) — pad click latches a live preview on
    the rendered frame. Drag encoders or ADSR knots and watch the
    result without writing to the timeline. Click again or hit play
    to drop it.
  • X clear gesture (paused) — hold X for 3 s to wipe the
    program strip; mode-aware (cuts / fx / both). Same red sweep bar
    as holding the lane with a finger. Playback X stays the erase
    head, unchanged.
  • TE-style bipolar mapping — flipped bipolarPeriodS so
    extremes are fastest, near-OFF is slowest. Affects every bipolar
    param (zoom rate, echo trail, wear drift, tape bend).

Test plan

  • npm run test — unit suite (604 tests, including new
    envelope.test.ts and updated build-descriptor / store tests)
  • Open editor, expand FX panel
    • Pad press while paused → live preview latches; click again
      → unlatches; clicking another pad swaps
    • Turning encoders during preview / playback updates the
      rendered frame in real-time, no re-trigger
    • "E" hardware button → switch to envelope editor; drag the
      four knots, see the curve shape change
    • Hold a pad during playback → fx renders; release →
      envelope's release tail fades the effect out
    • Indicator ball follows the bezier through attack/decay,
      sits at sustain knee while held, sweeps to release-end on
      release
  • X while paused, in different program-strip modes → red
    sweep bar covers correct lane(s); release before 3 s
    cancels; full hold clears the right thing
  • Rate encoder on Zoom: rotating from OFF outward goes
    slow → fast (TE convention); pulse rhythm visible during
    both sustain and release
  • Existing capsules without an envelope field still render
    bit-identically (INSTANT_ENVELOPE fallback)

🤖 Generated with Claude Code

Each P-FX kind now ships an ADSR envelope on top of its two encoder
parameters, edited via a CRT-style screen on the FX hardware panel.
The screen has two modes — PARAMS (live encoder read-out) and ENV
(four draggable phosphor knots that shape attack/decay/sustain/
release) — switched via two skeuomorphic plastic buttons left of
the screen. Curve is OP-1-style cubic Beziers; a leading-edge
indicator with comet-trail rides the path while a pad is held and
during the release tail, with a fast cross-sustain sweep on
release.

Each effect knows how to dim itself intelligently via
`applyWetness` (intensity scales for vignette/wear/uv, displacement
magnitude for zoom/rgb, mix for echo, warp for tape) instead of a
generic alpha-blend that ghosts displacement effects.

Pad behaviour is now mode-aware:

  - Playing → pad press records a punch-in capsule with the kind's
    current envelope baked in. Release-tail extends `outS` past the
    snapped grid moment so the fade plays out instead of cutting.
  - Paused → pad click LATCHES a live preview on the rendered
    frame. The user can then drag encoders or ADSR knots and watch
    the result without writing anything to the timeline. Click
    again or hit play to drop the latch.

`X` gains a paused-mode behaviour to match the pointer-driven
hold-to-clear gesture: hold X for 3 s while paused to wipe the
program strip, mode-aware (cuts / fx / both). Same red sweep bar
as holding the lane with a finger. Playback X stays the erase head.

Also flips the bipolar encoder mapping into TE-style "extreme =
fast, near OFF = slowest" — affects every bipolar param (zoom rate,
echo trail, wear drift, tape bend).
@johannboehme
johannboehme merged commit 7a7b236 into main May 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0