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
| Name | Required | Description | Default |
|---|---|---|---|
| factor | Yes | Stretch 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}`;
- src/server/EnhancedMCPServerFixed.ts:171-181 (registration)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' ];