Skip to main content
Glama
williamzujkowski

Strudel MCP Server

stretch

Adjusts the timing of music patterns by applying a stretch factor to modify playback speed while preserving pitch.

Instructions

Time stretch pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
factorYesStretch factor

Implementation Reference

  • Handler function for the 'stretch' tool. Validates the factor, retrieves the current pattern, appends .slow(factor) to stretch it temporally, writes the modified pattern, and returns a confirmation message.
    case 'stretch':
      InputValidator.validateGain(args.factor); // Positive number, use gain validator for simplicity
      const toStretch = await this.getCurrentPatternSafe();
      const stretched = toStretch + `.slow(${args.factor})`;
      await this.writePatternSafe(stretched);
      return `Stretched by factor of ${args.factor}`;
  • Tool registration in getTools() method, including name, description, and input schema requiring a numeric 'factor' parameter.
    {
      name: 'stretch',
      description: 'Time stretch pattern',
      inputSchema: {
        type: 'object',
        properties: {
          factor: { type: 'number', description: 'Stretch factor' }
        },
        required: ['factor']
      }
    },
  • Input schema definition for the 'stretch' tool, specifying the required 'factor' as a number.
    {
      name: 'stretch',
      description: 'Time stretch pattern',
      inputSchema: {
        type: 'object',
        properties: {
          factor: { type: 'number', description: 'Stretch factor' }
        },
        required: ['factor']
      }
    },
  • 'stretch' is listed in tools requiring initialization check.
    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'
    ];

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