Skip to main content
Glama

generate_variation

Create variations of music patterns for TidalCycles/Strudel, supporting subtle, moderate, extreme, glitch, and evolving transformation types.

Instructions

Create pattern variations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoVariation type (subtle/moderate/extreme/glitch/evolving)

Implementation Reference

  • MCP tool handler in executeTool switch statement: retrieves current pattern, generates variation using PatternGenerator service, writes the varied pattern to the editor, and returns success message.
    case 'generate_variation': const toVary = await this.getCurrentPatternSafe(); const varied = this.generator.generateVariation(toVary, args.type || 'subtle'); await this.writePatternSafe(varied); return `Added ${args.type || 'subtle'} variation`;
  • Tool registration in getTools(): defines name, description, and input schema for the generate_variation tool.
    { name: 'generate_variation', description: 'Create pattern variations', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Variation type (subtle/moderate/extreme/glitch/evolving)' } } } },
  • Input schema definition specifying optional 'type' parameter for variation styles.
    inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Variation type (subtle/moderate/extreme/glitch/evolving)' } } }
  • Core implementation in PatternGenerator service: appends Strudel-specific variation modifiers (e.g., fast, rev, jux) to the input pattern based on the specified type.
    generateVariation(pattern: string, variationType: string = 'subtle'): string { const variations: Record<string, string> = { subtle: '.sometimes(x => x.fast(2))', moderate: '.every(4, x => x.rev).sometimes(x => x.fast(2))', extreme: '.every(2, x => x.jux(rev)).sometimes(x => x.iter(4))', glitch: '.sometimes(x => x.chop(8).rev).rarely(x => x.speed(-1))', evolving: '.slow(4).every(8, x => x.fast(2)).every(16, x => x.palindrome)' }; return pattern + (variations[variationType] || variations.subtle); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/williamzujkowski/strudel-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server