generate_fill
Create drum fills for music patterns by specifying style and duration. This tool helps musicians and producers add rhythmic variations to their compositions using Strudel MCP Server's music generation capabilities.
Instructions
Generate drum fill
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | Yes | Fill style | |
| bars | No | Number of bars |
Implementation Reference
- src/server/EnhancedMCPServerFixed.ts:493-504 (registration)Registration of the 'generate_fill' tool including name, description, and input schema.{ name: 'generate_fill', description: 'Generate drum fill', inputSchema: { type: 'object', properties: { style: { type: 'string', description: 'Fill style' }, bars: { type: 'number', description: 'Number of bars' } }, required: ['style'] } },
- Input schema definition for the generate_fill tool specifying style (required) and optional bars.inputSchema: { type: 'object', properties: { style: { type: 'string', description: 'Fill style' }, bars: { type: 'number', description: 'Number of bars' } }, required: ['style']
- Main handler logic for generate_fill: validates args, generates fill via PatternGenerator, appends to current pattern, writes it, and returns confirmation.case 'generate_fill': InputValidator.validateStringLength(args.style, 'style', 100, false); if (args.bars !== undefined) { InputValidator.validatePositiveInteger(args.bars, 'bars'); } const fill = this.generator.generateFill(args.style, args.bars || 1); const currentFill = await this.getCurrentPatternSafe(); const newFillPattern = currentFill ? currentFill + '\n' + fill : fill; await this.writePatternSafe(newFillPattern); return `Generated ${args.bars || 1} bar fill`;
- Implementation of generateFill method in PatternGenerator service, providing predefined Strudel patterns for different drum fill styles.generateFill(style: string, bars: number = 1): string { const fills: Record<string, string> = { techno: `s("bd*8, cp*4").fast(${bars})`, house: `s("bd*4, cp*2, hh*16").fast(${bars})`, dnb: `s("bd*8, sn*8").fast(${bars * 2})`, trap: `s("bd*4, hh*32").fast(${bars})`, breakbeat: `s("bd cp bd cp, hh*8").iter(4).fast(${bars})` }; return fills[style] || fills.techno; }