/** * Send MIDI events to the CrossPad simulator via TCP remote control. * * Supports: note_on, note_off, cc (control change), program_change. * Uses the same remote control protocol as other sim commands. */ import { z } from "zod"; import type { McpServer, RegisteredTool } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { ToolContext } from "../tool-context.js"; export type MidiEventType = "note_on" | "note_off" | "cc" | "program_change"; export interface MidiSendParams { type: MidiEventType; channel: number; note?: number; velocity?: number; cc_num?: number; value?: number; program?: number; } export interface MidiSendResult { success: boolean; type: MidiEventType; channel: number; details: Record; error?: string; } /** * Send a MIDI event to the running simulator. */ export declare function crosspadMidiSend(params: MidiSendParams): Promise; export declare const TOOL_NAME = "crosspad_midi"; /** midi.py MidiRole — which USB MIDI endpoint the frame leaves by. */ export type MidiRole = "esp" | "stm"; export declare const MidiInputShape: { target: z.ZodEnum<{ device: "device"; sim: "sim"; }>; device: z.ZodOptional; action: z.ZodOptional>; role: z.ZodOptional>; on: z.ZodOptional; note: z.ZodOptional; vel: z.ZodOptional; channel: z.ZodOptional; frame: z.ZodOptional; n: z.ZodOptional; type: z.ZodOptional>; velocity: z.ZodOptional; cc_num: z.ZodOptional; value: z.ZodOptional; program: z.ZodOptional; }; export declare const MidiInput: z.ZodDiscriminatedUnion<[z.ZodObject<{ target: z.ZodLiteral<"device">; device: z.ZodOptional; action: z.ZodEnum<{ sysex: "sysex"; note: "note"; echo_rtt: "echo_rtt"; query_route: "query_route"; }>; role: z.ZodOptional>; on: z.ZodOptional; note: z.ZodOptional; vel: z.ZodOptional; channel: z.ZodOptional; frame: z.ZodOptional; n: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ target: z.ZodLiteral<"sim">; type: z.ZodEnum<{ note_on: "note_on"; note_off: "note_off"; cc: "cc"; program_change: "program_change"; }>; channel: z.ZodDefault; note: z.ZodOptional; velocity: z.ZodOptional; cc_num: z.ZodOptional; value: z.ZodOptional; program: z.ZodOptional; }, z.core.$strip>], "target">; export type MidiArgs = z.infer; export declare const O_Midi: { success: z.ZodBoolean; target: z.ZodOptional>; action: z.ZodOptional; device: z.ZodOptional; role: z.ZodOptional; result: z.ZodOptional; type: z.ZodOptional>; channel: z.ZodOptional; details: z.ZodOptional>; ts: z.ZodOptional; resultType: z.ZodOptional; confirmation: z.ZodOptional>; error: z.ZodOptional>; details: z.ZodOptional>; }, z.core.$loose>]>>; tool: z.ZodOptional; hint: z.ZodOptional; }; /** Pure: device-branch args → the daemon op and its args (`device` added by the caller). */ export declare function toMidiOp(args: MidiArgs): { op: string; args: Record; }; export declare function registerMidiTool(server: McpServer, ctx: ToolContext): RegisteredTool;