P2a: eight-bar arrangement with four editable sections
This commit is contained in:
@@ -84,6 +84,9 @@ 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 });
|
||||
await client.command(28, { type: 'select_section', index: 1 });
|
||||
await client.command(29, { type: 'set_pattern_step', row: 0, step: 0, velocity: 0 });
|
||||
await client.command(30, { type: 'copy_section', from: 0, to: 2 });
|
||||
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);
|
||||
@@ -98,7 +101,7 @@ try {
|
||||
await start();
|
||||
client = await connect();
|
||||
const second = client.snapshot;
|
||||
const restored = second.pattern.rows[0];
|
||||
const restored = second.arrangement[0].rows[0];
|
||||
if (second.cores.length !== 1) throw new Error('core did not survive the restart');
|
||||
if (second.cores[0].name !== 'clicks-01') throw new Error('core name changed');
|
||||
if (!restored.face || restored.face.face !== assigned.face) throw new Error('pattern face did not survive');
|
||||
@@ -107,6 +110,11 @@ try {
|
||||
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');
|
||||
if (second.arrangement.length !== 4) throw new Error('arrangement did not survive');
|
||||
if (second.active_section !== 1) throw new Error('active section did not survive');
|
||||
if (second.arrangement[1].rows[0].velocities[0] !== 0) throw new Error('section B edit did not survive');
|
||||
if (JSON.stringify(second.arrangement[2]) !== JSON.stringify(second.arrangement[0]))
|
||||
throw new Error('copied section did not survive');
|
||||
if (!second.can_undo) throw new Error('undo history did not survive');
|
||||
await client.command(26, { type: 'undo' });
|
||||
const undoneEdge = client.snapshot.cores[0].faces[7].end_sec;
|
||||
@@ -124,6 +132,7 @@ try {
|
||||
step: restored.velocities[0],
|
||||
bpm: second.transport.bpm,
|
||||
cut: { before: beforeCut, after: loadedEdge },
|
||||
sections: { count: second.arrangement.length, active: second.active_section, bNotes: second.arrangement[1].rows[0].velocities[0] },
|
||||
history: { restored: second.can_undo, undone: undoneEdge, redone: redoneEdge },
|
||||
journal: second.journal_len,
|
||||
db: existsSync(join(project, 'project.db'))
|
||||
|
||||
Reference in New Issue
Block a user