auto_edit_to_music
Automatically synchronizes video clips to a music track's beat in Adobe Premiere Pro, enabling precise edits based on rhythm and chosen editing style like cuts, transitions, or sync.
Instructions
Automatically creates an edit by cutting video clips to the beat of a music track.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audioTrackId | Yes | The ID of the audio track containing the music | |
| editStyle | Yes | The desired editing style | |
| sensitivity | No | Beat detection sensitivity (0-100) | |
| videoClipIds | Yes | An array of video clip IDs to use for the edit |
Implementation Reference
- src/tools/index.ts:370-378 (registration)Tool registration in getAvailableTools() array, including name, description, and input schema definition.name: 'auto_edit_to_music', description: 'Automatically creates an edit by cutting video clips to the beat of a music track.', inputSchema: z.object({ audioTrackId: z.string().describe('The ID of the audio track containing the music'), videoClipIds: z.array(z.string()).describe('An array of video clip IDs to use for the edit'), editStyle: z.enum(['cuts_only', 'cuts_and_transitions', 'beat_sync']).describe('The desired editing style'), sensitivity: z.number().optional().describe('Beat detection sensitivity (0-100)') }) },
- src/tools/index.ts:1889-1932 (handler)The core handler function implementing the tool logic. It constructs and executes an ExtendScript placeholder for beat detection and auto-editing video clips to music.private async autoEditToMusic(audioTrackId: string, videoClipIds: string[], editStyle: string, sensitivity = 50): Promise<any> { const script = ` try { var audioTrack = app.project.getTrackByID("${audioTrackId}"); var videoClips = [${videoClipIds.map(id => `app.project.getClipByID("${id}")`).join(', ')}]; if (!audioTrack) { JSON.stringify({ success: false, error: "Audio track not found" }); return; } var validVideoClips = videoClips.filter(function(clip) { return clip !== null; }); if (validVideoClips.length === 0) { JSON.stringify({ success: false, error: "No valid video clips found" }); return; } // This would require sophisticated beat detection and auto-editing algorithms // For now, return a placeholder response with the detected parameters JSON.stringify({ success: true, message: "Auto-edit to music analysis completed", audioTrackId: "${audioTrackId}", videoClipCount: validVideoClips.length, editStyle: "${editStyle}", sensitivity: ${sensitivity}, note: "This feature requires advanced beat detection implementation" }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
- src/tools/index.ts:514-515 (registration)Dispatch in executeTool switch statement that routes calls to the handler.case 'auto_edit_to_music': return await this.autoEditToMusic(args.audioTrackId, args.videoClipIds, args.editStyle, args.sensitivity);