humanize
Add natural timing variation to music patterns by setting a humanization level from 0 to 1.
Instructions
Add human timing variation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | Humanization amount (0-1) |
Implementation Reference
- src/server/tools/transform.ts:247-253 (handler)The execute handler for the 'humanize' tool. Reads the current pattern, validates the optional 'amount' argument (0-1 normalized), defaults to 0.01 if not provided, and appends '.nudge(rand.range(-amount, amount))' to introduce human timing variation.
case 'humanize': { if (args.amount !== undefined) InputValidator.validateNormalizedValue(args.amount, 'amount'); const p = await ctx.getCurrentPatternSafe(); const amt = args.amount || 0.01; await ctx.writePatternSafe(p + `.nudge(rand.range(-${amt}, ${amt}))`); return 'Added human timing'; } - The MCP tool schema definition for 'humanize'. Declares name, description ('Add human timing variation'), and inputSchema with an optional 'amount' parameter of type number (0-1).
{ name: 'humanize', description: 'Add human timing variation', inputSchema: { type: 'object', properties: { amount: { type: 'number', description: 'Humanization amount (0-1)' } }, }, }, - src/server/server.ts:108-109 (registration)The 'humanize' tool is registered on the MCP server by spreading transformModule.tools into the server's tool list (line 109). The dispatcher routes to transformModule.execute when the tool name is in transformModule.toolNames (lines 378-379).
// transform + effect + shape + set_tempo — extracted to src/server/tools/transform.ts (#104) ...transformModule.tools, - Uses InputValidator.validateNormalizedValue (src/utils/InputValidator.ts:278-290) to validate the 'amount' parameter is between 0 and 1.
case 'humanize': { if (args.amount !== undefined) InputValidator.validateNormalizedValue(args.amount, 'amount'); const p = await ctx.getCurrentPatternSafe(); const amt = args.amount || 0.01; await ctx.writePatternSafe(p + `.nudge(rand.range(-${amt}, ${amt}))`); return 'Added human timing'; } - src/server/tools/transform.ts:438-438 (registration)The transformModule object is exported from transform.ts, bundling tools (including 'humanize'), toolNames, and the execute dispatcher.
export const transformModule: ToolModule = { tools, toolNames, execute };