P1d: manual face cuts and trim in the quarry

This commit is contained in:
Emil
2026-11-01 01:51:47 +03:00
parent 88663a384e
commit 346035e869
17 changed files with 534 additions and 41 deletions
+11
View File
@@ -84,6 +84,14 @@ try {
if (!assigned) throw new Error('redo did not restore the face');
await client.command(23, { type: 'set_pattern_step', row: 0, step: 0, velocity: 96 });
await client.command(24, { type: 'set_tempo', bpm: 132 });
const sortedFaces = [...core.faces].sort((a, b) => a.index - b.index);
const boundaries = sortedFaces.map((face) => face.start_sec);
boundaries.push(sortedFaces[sortedFaces.length - 1].end_sec);
const beforeCut = boundaries[8];
boundaries[8] += 0.02;
await client.command(25, { type: 'set_core_faces', core: core.id, boundaries });
const cutEdge = client.snapshot.cores[0].faces[7].end_sec;
if (Math.abs(cutEdge - boundaries[8]) > 0.002) throw new Error('manual face did not apply');
client.ws.close();
await new Promise((resolve) => { child.once('exit', resolve); child.kill('SIGTERM'); });
@@ -96,6 +104,8 @@ try {
if (!restored.face || restored.face.face !== assigned.face) throw new Error('pattern face did not survive');
if (restored.velocities[0] !== 96) throw new Error('step did not survive');
if (second.transport.bpm !== 132) throw new Error('tempo did not survive');
const loadedEdge = second.cores[0].faces[7].end_sec;
if (Math.abs(loadedEdge - cutEdge) > 0.002) throw new Error('manual face did not survive');
if (second.project_name !== first.project_name) throw new Error('project name changed');
console.log(JSON.stringify({
project: second.project_name,
@@ -105,6 +115,7 @@ try {
face: restored.face,
step: restored.velocities[0],
bpm: second.transport.bpm,
cut: { before: beforeCut, after: loadedEdge },
journal: second.journal_len,
db: existsSync(join(project, 'project.db'))
}, null, 2));