Skip to main content
Glama

nudge_midi_notes

Add human-like variation to MIDI notes by applying random timing and velocity offsets, with adjustable ranges for natural-sounding musical performances.

Instructions

Humanize all MIDI notes in an item with random timing and/or velocity offsets.

  • timing_range_ppq: maximum ±PPQ timing shift per note (0 = no timing change). At 960 PPQ, 20 PPQ ≈ 1/48th note of swing.

  • velocity_range: maximum ±velocity shift per note (0 = no velocity change). Velocity is clamped to 1-127.

  • seed: optional integer for reproducible results (omit for random each call). Returns the per-note changes applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes
item_indexYes
timing_range_ppqNo
velocity_rangeNo
seedNo

Implementation Reference

  • The method in ReaperAdapter that makes the actual call to the bridge client.
    def nudge_midi_notes(
        self,
        track_index: int,
        item_index: int,
        timing_range_ppq: float = 0,
        velocity_range: int = 0,
        seed: int | None = None,
    ) -> dict[str, Any]:
        return self._client.call(
            "nudge_midi_notes",
            track_index=track_index,
            item_index=item_index,
            timing_range_ppq=timing_range_ppq,
            velocity_range=velocity_range,
            seed=seed,
        )
  • The registration and wrapper function for the nudge_midi_notes tool.
    def nudge_midi_notes(
        track_index: int,
        item_index: int,
        timing_range_ppq: float = 0,
        velocity_range: int = 0,
        seed: int | None = None,
    ) -> dict[str, Any]:
        """
        Humanize all MIDI notes in an item with random timing and/or velocity offsets.
        - timing_range_ppq: maximum ±PPQ timing shift per note (0 = no timing change).
          At 960 PPQ, 20 PPQ ≈ 1/48th note of swing.
        - velocity_range: maximum ±velocity shift per note (0 = no velocity change).
          Velocity is clamped to 1-127.
        - seed: optional integer for reproducible results (omit for random each call).
        Returns the per-note changes applied.
        """
        try:
            return _wrap(
                adapter.nudge_midi_notes(
                    track_index=track_index,
                    item_index=item_index,
                    timing_range_ppq=timing_range_ppq,
                    velocity_range=velocity_range,
                    seed=seed,
                )
            )
        except Exception as exc:
            return _err(exc)

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