auto_edit_to_music
Automatically edit video clips to match music beats in Adobe Premiere Pro. Cut footage to audio rhythm using beat detection for synchronized edits.
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 | |
| videoClipIds | Yes | An array of video clip IDs to use for the edit | |
| editStyle | Yes | The desired editing style | |
| sensitivity | No | Beat detection sensitivity (0-100) |
Implementation Reference
- src/tools/index.ts:370-378 (schema)Input schema and description for the 'auto_edit_to_music' tool, defining parameters: audioTrackId (string), videoClipIds (array of strings), editStyle (enum: 'cuts_only', 'cuts_and_transitions', 'beat_sync'), sensitivity (optional number 0-100). This is part of the tool registry returned by getAvailableTools().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:514-515 (registration)Tool registration and dispatch in the executeTool switch statement, calling the handler with validated arguments.case 'auto_edit_to_music': return await this.autoEditToMusic(args.audioTrackId, args.videoClipIds, args.editStyle, args.sensitivity);
- src/tools/index.ts:1889-1932 (handler)The core handler function for 'auto_edit_to_music'. Validates inputs, constructs and executes a Premiere Pro ExtendScript to detect beats in audio and sync video clips accordingly. Currently implements a placeholder that returns success without actual editing, noting need for advanced beat detection.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); }