Edit a Filter in its node and resize EQ and Filter nodes (#385)
A Filter sounds like one band of the Parametric EQ, but it keeps what the EQ cannot: linked numbers, the all-pass and +-40 dB. So it stays a node of its own and gets the EQ's editor with itself as the one band. The editors also stop running out of their room: what does not fit is left out instead of being cut. - The curve of the EQ is now BandCurve with a host the EQ and the Filter both fill. CurvePanel holds what their panels share. - FilterPanel shows the Filter as one band. A drag of its handle sets frequency and gain as one undo step. A number fed by a link is greyed out and the drag leaves it alone. - A double-click on the Filter's title opens the same in a tab of its own. Delete there does nothing, the node stays. - The Filter is tapped like the EQ, so its node and its tab draw the spectrum of what passes it. A tap is two gain nodes per voice, the analysers are made only while someone listens. - EqFace and FilterFace are one CurveFace now, given the panel. - EQ and Filter nodes have a corner to resize them, drawn like the floating window's. The size is saved on the node as `size`, each drag is one undo step, the least is 240 x 120. - In the node the help line is gone. The row of numbers comes in only once the curve keeps 120 px of height. A group of the row that does not fit is not drawn, the one on the right first. - A frequency or dB label that would run into the one before it is left out. - The all-pass is drawn flat. The curve's maths takes every shape a Filter has. Found on the way: - The instrument presets set nodes 240 apart. A Filter with its editor is about 700 wide and covered the Bitcrusher, so a Filter now takes four columns. Tests: - Unit: 8 new (filter band, resize command and save, fitting rules), stage lists with a Filter now hold its taps - e2e 34 (atx): ALL PASSED, 130 checks (4 new) - Gate (atx): CHECK EXIT 0, 284 files, 4367 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
17f47f6956
commit
c087993000
26 files changed
+1514
-656
No files matched your search
@@ -371,7 +371,11 @@ export class GraphCanvas extends Widget {
|
||||
const asset = this.asset();
|
||||
if (!asset) return;
|
||||
this.annotationLayer.sync(asset.graph);
|
||||
for (const node of asset.graph.nodes) this.views.get(node.id)?.position.set(node.x, node.y);
|
||||
for (const node of asset.graph.nodes) {
|
||||
const view = this.views.get(node.id);
|
||||
view?.position.set(node.x, node.y);
|
||||
view?.refit();
|
||||
}
|
||||
this.redraw();
|
||||
}
|
||||
|
||||
@@ -539,14 +543,17 @@ export class GraphCanvas extends Widget {
|
||||
return this.views.get(nodeId)?.face ?? null;
|
||||
}
|
||||
|
||||
/** A node's box on screen and the keys of its ports, for the check scripts. */
|
||||
nodeScreen(nodeId: string): { rect: Rect; inputs: string[]; outputs: string[] } | null {
|
||||
/** A node's box on screen, the keys of its ports and the corner it is resized by (#385), for the check scripts. */
|
||||
nodeScreen(
|
||||
nodeId: string,
|
||||
): { rect: Rect; inputs: string[]; outputs: string[]; corner: { x: number; y: number } | null } | null {
|
||||
const view = this.views.get(nodeId);
|
||||
if (!view) return null;
|
||||
return {
|
||||
rect: globalRect(view, view.w, view.h),
|
||||
inputs: view.def.inputs.map((p) => p.key),
|
||||
outputs: view.def.outputs.map((p) => p.key),
|
||||
corner: view.cornerGlobal(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -697,6 +704,12 @@ export class GraphCanvas extends Widget {
|
||||
this.wiring.startDrag({ nodeId: view.node.id, port: hit.port.key, isOutput: hit.isOutput }, e.global);
|
||||
return;
|
||||
}
|
||||
if (view.cornerAt(local.x, local.y)) {
|
||||
this.state.select(nodeSelection(this.assetId, [view.node.id]));
|
||||
this.nodeLayer.addChild(view); // raise
|
||||
this.drags.grabCorner(view, e.global);
|
||||
return;
|
||||
}
|
||||
// Like the hierarchy's chevron: it folds, and leaves the selection alone.
|
||||
if (view.chevronAt(local.x, local.y)) {
|
||||
this.state.execute(new CollapseNodesCommand(this.assetId, [view.node.id], !view.collapsed));
|
||||
@@ -843,7 +856,7 @@ export class GraphCanvas extends Widget {
|
||||
return;
|
||||
}
|
||||
this.panning = null;
|
||||
if (this.drags.releaseBox()) {
|
||||
if (this.drags.releaseCorner() || this.drags.releaseBox()) {
|
||||
this.redraw();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user