configure_mic_routing
Set up multi-mic routing with MIDI volume controls for drum samples in DecentSampler. Route each mic position to separate DAW outputs and configure MIDI CC mappings for mixing flexibility.
Instructions
Configure multi-mic routing with MIDI controls for drum samples.
This tool will:
Set up individual volume controls for each mic position (close, OH L/R, room L/R)
Route each mic to its own auxiliary output for DAW mixing
Configure MIDI CC mappings for mic volumes
Generate proper XML structure for DecentSampler
Error Handling:
Validates mic position assignments
Checks for duplicate MIDI CC assignments
Ensures valid output routing targets
Verifies bus indices are unique and valid
Returns specific errors for routing conflicts
Success Response: Returns XML structure containing:
Configured mic bus routing
Volume control mappings
MIDI CC assignments
Complete routing matrix for all samples
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| micBuses | Yes | ||
| drumPieces | Yes |
Implementation Reference
- src/index.ts:630-674 (handler)Main execution handler for the configure_mic_routing tool. Validates input using validateMicRouting, constructs AdvancedDrumKitConfig with micBuses, generates and returns XML via generateGroupsXml.case "configure_mic_routing": { const args = request.params.arguments; if (!args || typeof args !== 'object' || !Array.isArray(args.micBuses) || !Array.isArray(args.drumPieces)) { throw new McpError( ErrorCode.InvalidParams, "Invalid arguments: expected object with micBuses and drumPieces" ); } try { // Validate mic routing configuration validateMicRouting( args.micBuses as MicBusConfig[], args.drumPieces.flatMap(piece => (piece.samples as Array<{ micConfig?: DrumMicConfig }>) .map(sample => sample.micConfig) .filter((config): config is DrumMicConfig => !!config) ) ); // Create AdvancedDrumKitConfig with mic routing const config: AdvancedDrumKitConfig = { globalSettings: { micBuses: args.micBuses as MicBusConfig[] }, drumPieces: args.drumPieces as AdvancedDrumKitConfig['drumPieces'] }; // Generate XML with mic routing const xml = generateGroupsXml(config); return { content: [{ type: "text", text: xml }] }; } catch (error: unknown) { if (error instanceof McpError) throw error; const message = error instanceof Error ? error.message : String(error); throw new McpError( ErrorCode.InternalError, `Failed to configure mic routing: ${message}` ); } }
- src/index.ts:284-385 (registration)Tool registration in ListToolsRequestSchema response, including full description and detailed inputSchema for micBuses and drumPieces configurations.{ name: "configure_mic_routing", description: `Configure multi-mic routing with MIDI controls for drum samples. This tool will: - Set up individual volume controls for each mic position (close, OH L/R, room L/R) - Route each mic to its own auxiliary output for DAW mixing - Configure MIDI CC mappings for mic volumes - Generate proper XML structure for DecentSampler Error Handling: - Validates mic position assignments - Checks for duplicate MIDI CC assignments - Ensures valid output routing targets - Verifies bus indices are unique and valid - Returns specific errors for routing conflicts Success Response: Returns XML structure containing: - Configured mic bus routing - Volume control mappings - MIDI CC assignments - Complete routing matrix for all samples`, inputSchema: { type: "object", properties: { micBuses: { type: "array", items: { type: "object", properties: { name: { type: "string", description: "Display name for the mic (e.g., 'Close Mic', 'OH L')" }, outputTarget: { type: "string", description: "Output routing (e.g., 'AUX_STEREO_OUTPUT_1')" }, volume: { type: "object", properties: { default: { type: "number", description: "Default volume in dB" }, min: { type: "number", description: "Minimum volume in dB (e.g., -96)" }, max: { type: "number", description: "Maximum volume in dB (e.g., 12)" }, midiCC: { type: "number", description: "MIDI CC number for volume control" } }, required: ["default"] } }, required: ["name", "outputTarget"] } }, drumPieces: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rootNote: { type: "number" }, samples: { type: "array", items: { type: "object", properties: { path: { type: "string" }, micConfig: { type: "object", properties: { position: { type: "string", enum: ["close", "overheadLeft", "overheadRight", "roomLeft", "roomRight"] }, busIndex: { type: "number" }, volume: { type: "number" } }, required: ["position", "busIndex"] } }, required: ["path", "micConfig"] } } }, required: ["name", "rootNote", "samples"] } } }, required: ["micBuses", "drumPieces"] } },
- src/index.ts:307-384 (schema)Input schema definition specifying structure for micBuses array and drumPieces with samples and micConfig.inputSchema: { type: "object", properties: { micBuses: { type: "array", items: { type: "object", properties: { name: { type: "string", description: "Display name for the mic (e.g., 'Close Mic', 'OH L')" }, outputTarget: { type: "string", description: "Output routing (e.g., 'AUX_STEREO_OUTPUT_1')" }, volume: { type: "object", properties: { default: { type: "number", description: "Default volume in dB" }, min: { type: "number", description: "Minimum volume in dB (e.g., -96)" }, max: { type: "number", description: "Maximum volume in dB (e.g., 12)" }, midiCC: { type: "number", description: "MIDI CC number for volume control" } }, required: ["default"] } }, required: ["name", "outputTarget"] } }, drumPieces: { type: "array", items: { type: "object", properties: { name: { type: "string" }, rootNote: { type: "number" }, samples: { type: "array", items: { type: "object", properties: { path: { type: "string" }, micConfig: { type: "object", properties: { position: { type: "string", enum: ["close", "overheadLeft", "overheadRight", "roomLeft", "roomRight"] }, busIndex: { type: "number" }, volume: { type: "number" } }, required: ["position", "busIndex"] } }, required: ["path", "micConfig"] } } }, required: ["name", "rootNote", "samples"] } } }, required: ["micBuses", "drumPieces"] }
- src/mic-routing.ts:120-129 (helper)Validation helper function called by the handler to validate mic bus configurations and mic routings before generating XML.export function validateMicRouting( buses: MicBusConfig[], mics: DrumMicConfig[] ): void { // First validate bus configurations validateBusConfigurations(buses); // Then validate mic routings validateMicRoutings(buses, mics); }
- src/mic-routing.ts:2-21 (helper)Type definitions for MicBusConfig and DrumMicConfig used in the tool's input validation and config building.export interface MicVolumeConfig { default: number; // dB value min?: number; // Optional min dB max?: number; // Optional max dB midiCC?: number; // MIDI CC number for volume control } export interface MicBusConfig { name: string; // e.g., "Close Mic", "OH L" outputTarget: string; // e.g., "AUX_STEREO_OUTPUT_1" volume?: MicVolumeConfig; effects?: any[]; // Placeholder for future effects support } export interface DrumMicConfig { position: 'close' | 'overheadLeft' | 'overheadRight' | 'roomLeft' | 'roomRight'; busIndex: number; // Reference to which bus this mic routes to volume?: number; // Optional per-sample volume adjustment }