add_effect
Apply audio effects to music patterns in Strudel MCP Server by specifying effect names and parameters for sound manipulation during AI-powered music generation.
Instructions
Add effect to pattern
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| effect | Yes | Effect name | |
| params | No | Effect parameters |
Implementation Reference
- Handler for 'add_effect' tool: validates inputs, appends effect syntax (e.g., .effect(params)) to current pattern, writes it back to Strudel editor, returns confirmation.case 'add_effect': InputValidator.validateStringLength(args.effect, 'effect', 100, false); if (args.params) { InputValidator.validateStringLength(args.params, 'params', 1000, true); } const currentEffect = await this.getCurrentPatternSafe(); const withEffect = args.params ? currentEffect + `.${args.effect}(${args.params})` : currentEffect + `.${args.effect}()`; await this.writePatternSafe(withEffect); return `Added ${args.effect} effect`;
- Schema definition for 'add_effect' tool in the tools list returned by getTools(), used for MCP tool listing and input validation.name: 'add_effect', description: 'Add effect to pattern', inputSchema: { type: 'object', properties: { effect: { type: 'string', description: 'Effect name' }, params: { type: 'string', description: 'Effect parameters' } }, required: ['effect'] } },
- src/server/EnhancedMCPServerFixed.ts:571-573 (registration)Registration of tool list handler; 'add_effect' is included in getTools() array.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: this.getTools() }));
- Helper method that identifies 'add_effect' as requiring browser initialization before execution.private requiresInitialization(toolName: string): boolean { const toolsRequiringInit = [ 'write', 'append', 'insert', 'replace', 'play', 'pause', 'stop', 'clear', 'get_pattern', 'analyze', 'analyze_spectrum', 'analyze_rhythm', 'transpose', 'reverse', 'stretch', 'humanize', 'generate_variation', 'add_effect', 'add_swing', 'set_tempo', 'save', 'undo', 'redo', 'validate_pattern_runtime' ]; const toolsRequiringWrite = [ 'generate_pattern', 'generate_drums', 'generate_bassline', 'generate_melody', 'generate_chord_progression', 'generate_euclidean', 'generate_polyrhythm', 'generate_fill' ]; return toolsRequiringInit.includes(toolName) || toolsRequiringWrite.includes(toolName);