render_time_selection
Render a specific time range from a REAPER project to an audio file for playback or export.
Instructions
Render a time range to an audio file using REAPER's render pipeline.
output_path: absolute path including extension (e.g. '/tmp/mix.wav'). REAPER uses the current render format; set a .wav extension for PCM output.
start_time / end_time: seconds
sample_rate: 0 = use project rate
channels: 1=mono, 2=stereo Returns output_path and file_size_bytes so you can verify the file was written. After rendering, attach the file to this conversation so the audio can be heard.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_path | Yes | ||
| start_time | Yes | ||
| end_time | Yes | ||
| sample_rate | No | ||
| channels | No |
Implementation Reference
- src/reaper_mcp/server.py:666-689 (handler)The MCP tool handler function for `render_time_selection`, decorated with `@mcp.tool()` and utilizing `adapter.render_time_selection`.
@mcp.tool() def render_time_selection( output_path: str, start_time: float, end_time: float, sample_rate: int = 0, channels: int = 2, ) -> dict[str, Any]: """ Render a time range to an audio file using REAPER's render pipeline. - output_path: absolute path including extension (e.g. '/tmp/mix.wav'). REAPER uses the current render format; set a .wav extension for PCM output. - start_time / end_time: seconds - sample_rate: 0 = use project rate - channels: 1=mono, 2=stereo Returns output_path and file_size_bytes so you can verify the file was written. After rendering, attach the file to this conversation so the audio can be heard. """ try: return _wrap( adapter.render_time_selection( output_path=output_path, start_time=start_time, end_time=end_time, - src/reaper_mcp/reaper_adapter.py:385-400 (handler)The adapter method that forwards the `render_time_selection` tool request to the REAPER client via `_client.call`.
def render_time_selection( self, output_path: str, start_time: float, end_time: float, sample_rate: int = 0, channels: int = 2, ) -> dict[str, Any]: return self._client.call( "render_time_selection", output_path=output_path, start_time=start_time, end_time=end_time, sample_rate=sample_rate, channels=channels, )