Keep groups, comments and silent music in view for the agent (#429)
A live test of the music areas built a pattern, a song and a composition that stayed silent: no instrument at first, and later notes outside the C4 to B4 range of a new Notes node. The agent got no hint of either. The same test showed that new nodes left groups behind, that a comment could end up under other nodes, and that an end node like Output stayed left of the devices put in front of it. - get_asset lists under silent what of a pattern, song or composition is not heard. That is a missing instrument, an instrument that sounds no note, or notes outside what its Notes nodes take in, in a song after the transpose. - soundingNotes moves from the pattern tab to src/core/instrument/compile.ts. The tab and the agent use the same rule. - When new nodes go between two that have no room, everything from the fed node on moves right together. This holds for Arrange with a selection too, so no link runs backwards. - A new node linked to a node in a group joins that group, and the group grows in the same undo step. A group that would take in a foreign node stays as it is. - Arrange takes groups and comments along: a group whose nodes all moved the same keeps its size, otherwise it is fitted anew. The rules live in the new src/editor/graph/annotationFollow.ts. - add_comment and fit_group put a comment below its nodes when a node or a group title is in the way above. lint_graph counts covered comments as coveredNotes. - add_notes, get_asset, lint_graph and the relay instructions name the default range and how to mend a covered comment. Tests: - graph-follow (new, 12), agent-edit, agent-music (11) and the other agent, graph, pattern and relay tests green - 10 deliberate breakages, each one red in its own test - e2e 71: 25/25 - Gate: CHECK EXIT 0, 324 files, 5002 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
10f5e3ba8f
commit
19902a9f02
16 files changed
+923
-119
No files matched your search
@@ -1,10 +1,5 @@
|
||||
import { SetAssetPropertyCommand } from '../../core/commands/assetCommands';
|
||||
import {
|
||||
instrumentBuildFor,
|
||||
instrumentSourcesOf,
|
||||
namedNotes,
|
||||
playedNotes,
|
||||
} from '../../core/instrument/compile';
|
||||
import { instrumentSourcesOf, namedNotes, soundingNotes } from '../../core/instrument/compile';
|
||||
import { ghostNotes, placeOf } from '../../core/music/ghosts';
|
||||
import {
|
||||
GRID_OPTIONS,
|
||||
@@ -263,11 +258,8 @@ export class PatternEditor extends AssetTabEditor<PatternAsset, PianoRoll> {
|
||||
? findAssetOf(this.state.project, patternInstrument(asset.props), 'instrument')
|
||||
: undefined;
|
||||
if (instrument) {
|
||||
const sources = instrumentSourcesOf(this.state.project);
|
||||
const sounding = [...playedNotes(instrument.graph)].filter(
|
||||
(note) => instrumentBuildFor(instrument, note, sources).layers.length > 0,
|
||||
);
|
||||
this.canvas.setInstrument(new Set(sounding), namedNotes(instrument.graph));
|
||||
const sounding = soundingNotes(instrument, instrumentSourcesOf(this.state.project));
|
||||
this.canvas.setInstrument(sounding, namedNotes(instrument.graph));
|
||||
} else this.canvas.setInstrument(new Set(), new Map());
|
||||
this.syncGhosts(asset);
|
||||
this.bakeButton.sync();
|
||||
|
||||
Reference in new issue
Block a user