create_midi_item
Add a MIDI item to a track with optional note data to compose or edit music in REAPER projects.
Instructions
Create a MIDI item on a track and optionally pre-populate it with notes.
start / end: time in seconds
notes: list of {start_ppq, end_ppq, pitch, velocity=100, channel=0}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_index | Yes | ||
| start | Yes | ||
| end | Yes | ||
| notes | No |
Implementation Reference
- src/reaper_mcp/server.py:410-432 (handler)The MCP tool definition for `create_midi_item`, which wraps the `ReaperAdapter` method.
@mcp.tool() def create_midi_item( track_index: int, start: float, end: float, notes: list[dict[str, Any]] | None = None, ) -> dict[str, Any]: """ Create a MIDI item on a track and optionally pre-populate it with notes. - start / end: time in seconds - notes: list of {start_ppq, end_ppq, pitch, velocity=100, channel=0} """ try: return _wrap( adapter.create_midi_item( track_index=track_index, start=start, end=end, notes=notes, ) ) except Exception as exc: return _err(exc) - src/reaper_mcp/reaper_adapter.py:227-240 (handler)The actual implementation in `ReaperAdapter` that calls the bridge client to create a MIDI item.
def create_midi_item( self, track_index: int, start: float, end: float, notes: list[dict[str, Any]] | None = None, ) -> dict[str, Any]: return self._client.call( "create_midi_item", track_index=track_index, start=start, end=end, notes=notes or [], )