synchronize
Align lines, loops, and vibes to a master rhythm with phase control for coordinated creative workflows in the LLV Helix Framework.
Instructions
Synchronize lines, loops, and vibes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elements | Yes | Elements to synchronize (names of lines/loops/vibes) | |
| master_rhythm | No | Master rhythm to sync to | |
| phase_offset | No | Phase offset in degrees |
Implementation Reference
- index.js:222-244 (registration)Registration of the 'synchronize' tool in the ListToolsRequestSchema response, including name, description, and detailed input schema.name: 'synchronize', description: 'Synchronize lines, loops, and vibes', inputSchema: { type: 'object', properties: { elements: { type: 'array', items: { type: 'string' }, description: 'Elements to synchronize (names of lines/loops/vibes)', }, master_rhythm: { type: 'string', description: 'Master rhythm to sync to', }, phase_offset: { type: 'number', minimum: 0, maximum: 360, description: 'Phase offset in degrees', }, }, required: ['elements'], },
- index.js:345-346 (registration)Dispatch registration in the CallToolRequestSchema switch statement that routes calls to the synchronize handler.case 'synchronize': return this.synchronize(args);
- index.js:683-744 (handler)Core handler function for the 'synchronize' tool. Validates input, checks existence of specified elements (lines/loops/vibes), generates synchronization status and visualization using visualizeSyncPattern.synchronize(args) { const { elements, master_rhythm = null, phase_offset = 0 } = args; if (!elements || elements.length === 0) { return { content: [ { type: 'text', text: `❌ No elements provided for synchronization. Please specify at least one line, loop, or vibe to synchronize.`, }, ], }; } const syncData = { elements, master_rhythm, phase_offset, timestamp: new Date().toISOString(), }; const syncResults = elements.map(element => { const hasLine = this.lines.has(element); const hasLoop = this.loops.has(element); const hasVibe = this.vibes.has(element); return { element, type: hasLine ? 'line' : hasLoop ? 'loop' : hasVibe ? 'vibe' : 'unknown', synced: hasLine || hasLoop || hasVibe, }; }); const validElements = syncResults.filter(r => r.synced); const invalidElements = syncResults.filter(r => !r.synced); if (validElements.length === 0) { return { content: [ { type: 'text', text: `❌ No valid elements found for synchronization.\n\nMissing elements: ${invalidElements.map(r => r.element).join(', ')}\n\nPlease create these elements first using create_line, create_loop, or create_vibe.`, }, ], }; } let resultText = `🔗 Synchronizing ${validElements.length} elements\n\nMaster Rhythm: ${master_rhythm || 'Auto-detected'}\nPhase Offset: ${phase_offset}°\n\n${syncResults.map(r => `${r.synced ? '✅' : '❌'} ${r.element} (${r.type})`).join('\n')}\n\n${this.visualizeSyncPattern(validElements.length, phase_offset)}`; if (invalidElements.length > 0) { resultText += `\n\n⚠️ Warning: ${invalidElements.length} elements not found: ${invalidElements.map(r => r.element).join(', ')}`; } return { content: [ { type: 'text', text: resultText, }, ], }; }
- index.js:224-242 (schema)Input schema definition for the 'synchronize' tool, specifying required 'elements' array and optional master_rhythm and phase_offset.inputSchema: { type: 'object', properties: { elements: { type: 'array', items: { type: 'string' }, description: 'Elements to synchronize (names of lines/loops/vibes)', }, master_rhythm: { type: 'string', description: 'Master rhythm to sync to', }, phase_offset: { type: 'number', minimum: 0, maximum: 360, description: 'Phase offset in degrees', }, },
- index.js:1006-1015 (helper)Helper function used by synchronize to generate a visual pattern representing the synchronized elements with phase offset.visualizeSyncPattern(count, offset) { const base = '◯'; const synced = '◉'; const pattern = []; for (let i = 0; i < count; i++) { const phase = (i * 360 / count + offset) % 360; pattern.push(phase < 180 ? synced : base); } return pattern.join(' → '); }