Skip to main content
Glama
williamzujkowski

Strudel MCP Server

humanize

Add natural timing variations to music patterns by adjusting humanization amount from 0 to 1, creating more organic-sounding rhythms in Strudel music generation.

Instructions

Add human timing variation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoHumanization amount (0-1)

Implementation Reference

  • Handler for 'humanize' tool: gets current pattern, appends .nudge() with random timing variation based on amount (0-1), writes back the modified pattern.
    case 'humanize':
      if (args.amount !== undefined) {
        InputValidator.validateNormalizedValue(args.amount, 'amount');
      }
      const toHumanize = await this.getCurrentPatternSafe();
      const humanized = toHumanize + `.nudge(rand.range(-${args.amount || 0.01}, ${args.amount || 0.01}))`;
      await this.writePatternSafe(humanized);
      return 'Added human timing';
  • Registration of 'humanize' tool in getTools() array, including name, description, and input schema.
    {
      name: 'humanize',
      description: 'Add human timing variation',
      inputSchema: {
        type: 'object',
        properties: {
          amount: { type: 'number', description: 'Humanization amount (0-1)' }
        }
      }
    },
  • Input schema definition for 'humanize' tool: optional 'amount' number between 0-1.
    inputSchema: {
      type: 'object',
      properties: {
        amount: { type: 'number', description: 'Humanization amount (0-1)' }
      }
    }
  • Helper function validateNormalizedValue used to validate the 'amount' parameter for humanize (and similar normalized params).
    static validateNormalizedValue(value: number, fieldName: string): void {
      if (typeof value !== 'number') {
        throw new Error(`${fieldName} must be a number`);
      }
    
      if (isNaN(value) || !isFinite(value)) {
        throw new Error(`${fieldName} must be a valid number`);
      }
    
      if (value < 0 || value > 1.0) {
        throw new Error(`${fieldName} must be between 0 and 1.0, got ${value}`);
      }
    }

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