add_swing
Apply swing to Strudel music patterns by adjusting the swing amount (0-1) to modify rhythmic feel and groove in AI-powered music generation.
Instructions
Add swing to pattern
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Swing amount (0-1) |
Implementation Reference
- The core handler logic for the 'add_swing' tool. It retrieves the current pattern, appends '.swing(${amount})' to it, writes the modified pattern back to the editor, and returns a confirmation message.case 'add_swing': const currentSwing = await this.getCurrentPatternSafe(); const withSwing = currentSwing + `.swing(${args.amount})`; await this.writePatternSafe(withSwing); return `Added swing: ${args.amount}`;
- Input schema definition for the 'add_swing' tool, requiring a numeric 'amount' parameter between 0-1.name: 'add_swing', description: 'Add swing to pattern', inputSchema: { type: 'object', properties: { amount: { type: 'number', description: 'Swing amount (0-1)' } }, required: ['amount'] } },
- src/server/EnhancedMCPServerFixed.ts:442-444 (registration)Registration of the ListToolsRequestSchema handler, which returns the list of tools including 'add_swing' via getTools().this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: this.getTools() }));
- src/server/EnhancedMCPServer.ts:618-622 (handler)Handler logic for 'add_swing' in the original server implementation (similar to Fixed version).case 'add_swing': const currentSwing = await this.controller.getCurrentPattern(); const withSwing = currentSwing + `.swing(${args.amount})`; await this.controller.writePattern(withSwing); return `Added swing: ${args.amount}`;
- Input schema for 'add_swing' tool in the original server.name: 'add_swing', description: 'Add swing to pattern', inputSchema: { type: 'object', properties: { amount: { type: 'number', description: 'Swing amount (0-1)' } }, required: ['amount'] } },