add_notes
Insert lyrics and musical notes into a Synthesizer V AI vocal track by specifying start time, duration, pitch, and lyrics for each note.
Instructions
Add one or more notes to a track
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | Array of notes to add | |
| trackId | Yes | ID of the track |
Implementation Reference
- src/index.ts:441-491 (handler)MCP server handler for the 'add_notes' tool. Performs input validation on trackId and notes array, then delegates to executeCommand('add_notes') with processed parameters, and formats the response.case "add_notes": { const args = request.params.arguments as any; const trackId = Number(args.trackId); if (isNaN(trackId)) { return { content: [{ type: "text", text: "Error: Invalid track ID" }], isError: true }; } if (!Array.isArray(args.notes) || args.notes.length === 0) { return { content: [{ type: "text", text: "Error: No notes provided" }], isError: true }; } const result = await executeCommand("add_notes", { trackId, notes: args.notes.map((note: any) => ({ lyrics: String(note.lyrics), startTime: Number(note.startTime), duration: Number(note.duration), pitch: Number(note.pitch) })) }); if (result.error) { return { content: [{ type: "text", text: `Error: ${result.error}` }], isError: true }; } return { content: [{ type: "text", text: result.message || `${args.notes.length} notes added successfully` }] }; }
- src/index.ts:276-315 (schema)Input schema definition for the 'add_notes' tool, specifying trackId (string) and notes (array of objects with lyrics, startTime, duration, pitch). Used in tool registration.{ name: "add_notes", description: "Add one or more notes to a track", inputSchema: { type: "object", properties: { trackId: { type: "string", description: "ID of the track" }, notes: { type: "array", description: "Array of notes to add", items: { type: "object", properties: { lyrics: { type: "string", description: "Lyrics text for the note" }, startTime: { type: "number", description: "Start time in ticks" }, duration: { type: "number", description: "Duration in ticks" }, pitch: { type: "number", description: "MIDI pitch (0-127)" } }, required: ["lyrics", "startTime", "duration", "pitch"] } } }, required: ["trackId", "notes"] } },
- src/index.ts:241-376 (registration)Registration of the 'add_notes' tool via the ListToolsRequestSchema handler, which returns the list of available tools including its schema.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "get_project_info", description: "Get information about the current Synthesizer V Studio project", inputSchema: { type: "object", properties: {}, required: [] } }, { name: "list_tracks", description: "List all tracks in the current project", inputSchema: { type: "object", properties: {}, required: [] } }, { name: "get_track_notes", description: "Get all notes in a specific track", inputSchema: { type: "object", properties: { trackId: { type: "string", description: "ID of the track" } }, required: ["trackId"] } }, { name: "add_notes", description: "Add one or more notes to a track", inputSchema: { type: "object", properties: { trackId: { type: "string", description: "ID of the track" }, notes: { type: "array", description: "Array of notes to add", items: { type: "object", properties: { lyrics: { type: "string", description: "Lyrics text for the note" }, startTime: { type: "number", description: "Start time in ticks" }, duration: { type: "number", description: "Duration in ticks" }, pitch: { type: "number", description: "MIDI pitch (0-127)" } }, required: ["lyrics", "startTime", "duration", "pitch"] } } }, required: ["trackId", "notes"] } }, { name: "add_track", description: "Add a new track to the project", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name of the new track" } }, required: [] } }, { name: "edit_notes", description: "Edit one or more notes", inputSchema: { type: "object", properties: { trackId: { type: "string", description: "ID of the track" }, notes: { type: "array", description: "Array of notes to edit", items: { type: "object", properties: { id: { type: "number", description: "The ID of the note" }, lyrics: { type: "string", description: "Lyrics text for the note" }, startTime: { type: "number", description: "Start time in ticks" }, duration: { type: "number", description: "Duration in ticks" }, pitch: { type: "number", description: "MIDI pitch (0-127)" } }, required: ["id"] } } }, required: ["trackId", "notes"] } }, ] }; });
- src/index.ts:76-84 (helper)Helper function that executes any command (including 'add_notes') by writing the action and params to the command file and polling for response from Synthesizer V Studio.async function executeCommand(action: string, params: any = {}): Promise<any> { const command = { action, ...params }; await writeCommand(command); return await readResponse(); }