Skip to content

Proposal: clip envelopes remembered across restarts, and easier to edit - #77

Open
marcin-koziol wants to merge 3 commits into
BurningTreeC:mainfrom
marcin-koziol:remember-clip-envelopes
Open

marcin-koziol wants to merge 3 commits into
BurningTreeC:mainfrom
marcin-koziol:remember-clip-envelopes

Conversation

@marcin-koziol

@marcin-koziol marcin-koziol commented Nov 13, 2026 •

Copy link
Copy Markdown

Proposal. UX changes to clip envelope editing, for discussion: happy to adjust or drop any part.

Why

  • Not remembered: the lane chosen in Edit → Clip Envelopes was forgotten on every restart, so it had to be shown again after reopening a project.
  • Adding a point bent the line: a new point took the click's height, so a click one pixel off the line changed its shape. On an envelope with no points yet, the whole line jumped to the click.
  • Points jumped when grabbed: a dragged point went to the pointer, so a point grabbed slightly off its centre jumped.
  • Hard to tell the two actions apart: the cursor was the same crosshair over the line and over a point, nothing showed which point a press would take, and point values were not shown anywhere.
  • Points on the edges were hard to grab: the first and last points sit on the clip's edges, where the trim zone (and the fade handles) took the press.
  • No way to move a segment: there was no way to grab the line between two points and move it up or down.

What

  • Remembered: Preferences::clip_envelope holds the lane shown. It is applied at start-up and saved whenever it changes, the same way as the global lanes and Snap to Objects. Older preference files read as hidden.
  • Adding keeps the line:
    • A click on the line adds a point at the value the line has there (clip_envelope::value_at, or the neutral value when there are no points).
    • The point only moves once dragged past the threshold.
    • Adding a point and dragging it in one gesture is still one undo step.
  • Relative drags: a point moves by how far the pointer travels on the lane's scale, not to where the pointer is. Shift, Ctrl and Alt work as before.
  • Two zones: ClipZone::Envelope, on the line, shows a plus (a new Cursor::Add, cell in GTK). ClipZone::EnvelopePoint(i), on a point, shows a move cross.
  • Lit point: the point under the pointer, or the one being dragged, is drawn larger and ringed, with its value next to it (e.g. "−4.5 dB", "L 30").
  • Tooltip:
    • over a point: its value, its time, and what drag, double-click and right-click do;
    • over the line: that a click adds a point without moving the line.
  • Docs: the description in docs/ARCHITECTURE.md is updated.
  • Points before edges: a point under the pointer now wins over the clip's trim edges and fade handles. A little above or below the point, the edge still trims.
  • Segment drag: the line near a segment (within 4 px) is a zone of its own, ClipZone::EnvelopeSegment, with an up-and-down cursor.
    • A drag moves the points on either side of it together, by how far the pointer travels. Between the clip's edge and the nearest point it moves that one point. The points keep their times, Ctrl gives fine control, and the whole drag is one undo step.
    • A click without a drag still adds a point there.
    • Hovering a segment lights both of its points, with their values, and the tooltip says what a drag does. A take's lane behaves the same way.

Tests

  • Updated: the existing arranger test now expects a click below the line to put the point on the line, and the following drag to move it relatively.
  • New adding_keeps_the_line_and_the_point_under_the_pointer_is_lit checks that:
    • a point added between two others is interpolated onto the line;
    • the zone and cursor are right over a point and over the line;
    • the hovered point is drawn larger with its value label;
    • the tooltip names the value;
    • a point grabbed 3 px off its centre moves by the drag distance.
  • New the_clip_envelope_shown_round_trips (preferences).
  • New points_on_the_clips_edges_win_over_trimming checks that over the first and last points the press takes the point, and a little away from them it trims.
  • New the_line_between_two_points_is_dragged_and_clicked checks:
    • the segment zone and its cursor;
    • that both points light up on hover;
    • a drag moves both points, keeps their times and is one undo step;
    • a click without a drag adds a point on the line.
  • Upstream's take-lane test (a_take_lane_edits_its_takes_envelope_while_one_is_shown, from Discussion: clip edits (pitch, warp, …) are lost when a clip is folded into takes, and takes can't be pitch-edited #67) now also checks the cursors and the lit point in a take's lane.
  • All 102 faderframe-view-arranger tests pass and the workspace builds. clippy -D warnings on arranger, UI and canvas is clean, and so is fmt --check.

🤖 Generated with Claude Code

…e line

The lane shown (Edit → Clip Envelopes) was lost on every restart; it is
now kept in the preferences (Preferences::clip_envelope), as the global
lanes and Snap to Objects are.

Editing was fiddly, on a clip's body and a take's lane alike:
- A click added the point at the click's height, so a pixel off the line
  bent it (and an empty envelope jumped there). The point now goes on the
  line, at the value it has there (value_at, neutral without points), and
  moves only once dragged past the threshold.
- A dragged point went to the pointer, so one grabbed off its centre
  jumped; it now moves by how far the pointer goes on the lane's scale.
- The pointer was the same crosshair everywhere. A clip's body now has
  two zones, ClipZone::Envelope (a plus, the new Cursor::Add) and
  ClipZone::EnvelopePoint(i) (a move cross); a take's lane shows the same.
- The point a press would take is drawn larger and ringed with its value
  beside it (hovered or dragged), and the tooltip gives its value, time
  and what pressing it does (envelope_target finds the clip or take).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcin-koziol
marcin-koziol force-pushed the remember-clip-envelopes branch from a3edfa6 to a5f38c3 Compare November 14, 2026 08:47
outi and others added 2 commits November 14, 2026 10:59
The first and last points sit on the clip's edges, where the trim zone
(and the fade handles) took the press, so they could hardly be grabbed.
A point under the pointer now comes first; a little above or below it
the edge still trims.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The line near a segment (within 4 px) is a zone of its own,
ClipZone::EnvelopeSegment, with an up-and-down pointer: a drag moves the
points on either side of it together by how far the pointer went (one at
the clip's ends; their times stay; Ctrl fine; one undo step), and a click
without a drag adds a point there as before. Hovering it lights both
points with their values, and the tooltip says what a drag does; a
take's lane works the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants