Skip to main content
Glama

insert_midi_event

Insert MIDI control, pitch-bend, or program-change events into REAPER projects to automate parameters and modify instrument settings during music production.

Instructions

Insert a MIDI CC, pitch-bend, or program-change event into a MIDI item.

  • event_type: 'cc' | 'pitch_bend' | 'program_change'

  • ppq: position in PPQ ticks

  • channel: 0-15

  • cc: provide cc_number (0-127) and value (0-127)

  • pitch_bend: provide bend (-8192 to 8191, 0 = center)

  • program_change: provide program (0-127)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes
item_indexYes
event_typeYes
ppqYes
channelNo
cc_numberNo
valueNo
bendNo
programNo

Implementation Reference

  • The implementation of the insert_midi_event logic in the Reaper adapter, which calls the underlying client.
    def insert_midi_event(
        self,
        track_index: int,
        item_index: int,
        event_type: str,
        ppq: int,
        channel: int = 0,
        cc_number: int | None = None,
        value: int | None = None,
        bend: int | None = None,
        program: int | None = None,
    ) -> dict[str, Any]:
        return self._client.call(
            "insert_midi_event",
            track_index=track_index,
            item_index=item_index,
            event_type=event_type,
            ppq=ppq,
            channel=channel,
            cc_number=cc_number,
            value=value,
            bend=bend,
            program=program,
        )
  • The MCP tool registration for insert_midi_event in the server, which maps the request to the adapter.
    @mcp.tool()
    def insert_midi_event(
        track_index: int,
        item_index: int,
        event_type: str,
        ppq: int,
        channel: int = 0,
        cc_number: int | None = None,
        value: int | None = None,
        bend: int | None = None,
        program: int | None = None,
    ) -> dict[str, Any]:
        """
        Insert a MIDI CC, pitch-bend, or program-change event into a MIDI item.
        - event_type: 'cc' | 'pitch_bend' | 'program_change'
        - ppq: position in PPQ ticks
        - channel: 0-15
        - cc: provide cc_number (0-127) and value (0-127)
        - pitch_bend: provide bend (-8192 to 8191, 0 = center)
        - program_change: provide program (0-127)
        """
        try:
            return _wrap(
                adapter.insert_midi_event(

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielkinahan/ReaMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server